Setting Variables in Triggers for use in Lua Script files

Posted by William Gray on Thu 13 Mar 2008 05:31 PM — 3 posts, 13,318 views.

USA #0
i want to start off by saying sorry for the ignorance.

i have followed the instructions in the previous posts about getting started... and have my mush client set up to use Lua scripting.

in the mud that i am playing (aardmud.org:4010) there are notices that are seen from time to time. on if which is

"INFO: Malignant rumors fly as Dagaswolf gains in strength."

what this message signifies is that the user "Dagaswolf" is at level 201 (which is SuperHero) and he/she has "pup'ed" or Powered Up another player. what i would like to do is the following:

i have a trigger who's pattern = INFO: Malignant rumors fly as * gains in strength.

what i need to do is set a variable called "shpup" to the value of the *... then i call a Lua script function called "sh_pup" that i want to check to see if the user is my char... if it is just send the following command:
Send("clandonate 2000")

if it is not my char i want to do the following:
Send("clandonate 2000")
Send("clantalk *cheer " .. pupuser)
where "pupuser" is the following: world.GetVariable("shpup")

any and all help is very appreciated



thanks :)
USA #1
ok... i think i got this figured out... just send "wildcards" as one of the parameters to the function call.

then use: local varname1 = wildcards[1]
local varname2 = wildcards[2]
etc....


found it in another post :)


thanks anyway.... i will be asking more questions as i go along ... i am sure :)



have a great day!
Australia Forum Administrator #2
Quote:

Send("clantalk *cheer " .. pupuser)
where "pupuser" is the following: world.GetVariable("shpup")



Send("clantalk *cheer " .. GetVariable("shpup"))