Aaaaargh!

maharach
Posts: 3
Joined: Sat Feb 26, 2011 4:12 am

Re: Aaaaargh!

Post by maharach »

grrr, guess i've still got something wrong...

Denarii
Posts: 111
Joined: Thu Dec 03, 2009 10:54 pm

Re: Aaaaargh!

Post by Denarii »

Omni wrote:
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
You're setting the variable venoms to both a function and a table.
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.

User avatar
Omit
Posts: 190
Joined: Sun Aug 01, 2010 10:54 pm
Location: Middle Earth
Contact:

Re: Aaaaargh!

Post by Omit »

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 {} )

Post Reply