Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Lua ➜ Setting Variables in Triggers for use in Lua Script files

Setting Variables in Triggers for use in Lua Script files

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by William Gray   USA  (3 posts)  Bio
Date Thu 13 Mar 2008 05:31 PM (UTC)
Message
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 :)

Dagaswolf -- have you hugged your undertaker today?
Top

Posted by William Gray   USA  (3 posts)  Bio
Date Reply #1 on Thu 13 Mar 2008 06:34 PM (UTC)
Message
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!

Dagaswolf -- have you hugged your undertaker today?
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #2 on Thu 13 Mar 2008 08:43 PM (UTC)
Message
Quote:

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



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


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


13,062 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.