Aaaaargh!
Re: Aaaaargh!
grrr, guess i've still got something wrong...
Re: Aaaaargh!
There's no need to wrap the venoms table definition in a function.. just put it in a script and it'll get defined when the profile loads.Omni wrote:You're setting the variable venoms to both a function and a table.maharach wrote:i don't seem to understand how to initialize tables at login, i'm trying to add a function to my init() script -
function venoms()
venoms = {}
venoms.w = "wyg"
venoms.s = ...
end
and it doesn't seem to be doing anything. and for the alias i'm using this version -
send("outpouch " ..venoms[matches[2]])
if balance.forests==1 then
send("blowpipe " .. venoms[matches[2]] .. " " .. target)
else
send("spit " .. venoms[matches[2]] .. " at " .. target)
end
i'm assuming this isn't the way to go, heh
Re: Aaaaargh!
FYI.... when defining tables sometimes it is usefull to define then like this....
MyTable = MyTable or {}
....this will create the table if it does not exist but not destroy it if it already does.(this works for items in the table or sub-tables.... MyTable["mySubTable"] = MyTable["mySubTable"] or {} )
MyTable = MyTable or {}
....this will create the table if it does not exist but not destroy it if it already does.(this works for items in the table or sub-tables.... MyTable["mySubTable"] = MyTable["mySubTable"] or {} )