[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  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] Refresh page


Posted by William Gray   USA  (3 posts)  [Biography] 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?
[Go to top] top

Posted by William Gray   USA  (3 posts)  [Biography] 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?
[Go to top] top

Posted by Nick Gammon   Australia  (22,989 posts)  [Biography] 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
[Go to top] 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.


9,053 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]