-
richi
- Posts: 8
- Joined: Tue Jan 24, 2012 1:30 pm
#1
Post
by richi » Thu Feb 09, 2012 11:25 am
Can somebody tell me why
Code: Select all
<!-- # 1 --><waypoint x="-27897" z="32817" y="-279">
table.insert(settings.profile.options.friends, "namehere");
</waypoint>
don't work ?
There come : [string "..."]:2: bad argument #1 to 'insert' <table expected, got nil>
-
richi
- Posts: 8
- Joined: Tue Jan 24, 2012 1:30 pm
#3
Post
by richi » Thu Feb 09, 2012 12:26 pm
What's wrong with
Code: Select all
<!-- # 2 --><waypoint x="-26084" z="33576" y="-145">
settings.profile.friends["namehere"] = nil;
</waypoint>
?
It should reverse the first code but it also don't work
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#4
Post
by rock5 » Thu Feb 09, 2012 1:19 pm
Actually no.
Code: Select all
table.insert(settings.profile.friends, "namehere");
Inserts it with a number. eg.
Code: Select all
settings.profile.friends[num] = "namehere"
You would have to first search for the value before you could delete it.
To save you the trouble, Lisa wrote a userfunction to do something like that. I think it was called changeOptionFriendMob. Do a search.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:
- “They say hard work never hurt anybody, but I figure, why take the chance.”
-
kuripot
- Posts: 493
- Joined: Mon Nov 07, 2011 9:14 pm
#5
Post
by kuripot » Thu Feb 09, 2012 5:42 pm
not sure but you can try
Code: Select all
settings.profile.friends = {"Name of Mobs","Name of Mobs"}
and also put in your userfunction folder
-
Attachments
-
- userfunction_profilechange.lua
- and also put in your userfunction folder
- (1.42 KiB) Downloaded 147 times
-
lisa
- Posts: 8332
- Joined: Tue Nov 09, 2010 11:46 pm
- Location: Australia
#6
Post
by lisa » Thu Feb 09, 2012 8:02 pm
richi wrote:settings.profile.friends["namehere"] = nil;
The table is a numbered system
1 = "name"
2 = "namelol"
3 = "namers"
So as rock said you would need to do
Code: Select all
settings.profile.friends[num] = "namehere"
if you want no names in the table.
which creates a blank table.
This is a simple little userfunction I made a while back.
Usage is like this
Code: Select all
changeOptionFriendMob("mob", "Wolf", "Add")
changeOptionFriendMob("friend", "Hokeypokey", "Remove")
So state
friend or mob
name
add or remove
default is to add, so if 3rd arg is nil then it will add.
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#7
Post
by rock5 » Fri Feb 10, 2012 12:56 am
Lisa I noticed your function still doesn't check if the name already exists. So if continuously reloading the file, you will end up with multiple entries of the same name.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:
- “They say hard work never hurt anybody, but I figure, why take the chance.”
-
lisa
- Posts: 8332
- Joined: Tue Nov 09, 2010 11:46 pm
- Location: Australia
#8
Post
by lisa » Fri Feb 10, 2012 2:29 am
yeah I haven't changed this since I made so very very long ago.
I don't even use it anymore anyway, I used to use it for KS when I would fly over the first boss. so add it to friends to make sure not to attack it while flying over it.
Who is online
Users browsing this forum: Ahrefs [Bot] and 1 guest