Gammon Forum
Entire forum
MUSHclient
General
Please help, been trying to figure this out for a few hours now :(
Please help, been trying to figure this out for a few hours now :(
|
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Pages: 1
2
Posted by
| AaronM86
(42 posts) bio
|
Date
| Reply #15 on Tue 30 Mar 2010 12:40 AM (UTC) |
Message
| Another question popped into my mind lol, kind of pertains to this same subject. Is it possible to do 2 ifs in the same trigger? For instance:
if string.lower("%1") == "self" then
world.Send("say Not going to happen")
if string.lower("%1") == "terkal" then
world.Send("say Not going to happen")
else
world.Send("cast %2 %1")
end | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #16 on Tue 30 Mar 2010 12:48 AM (UTC) |
Message
| What language is this? Lua?
You can do it with elseif, eg.
if string.lower("%1") == "self" then
Send ("say Not going to happen")
elseif string.lower("%1") == "terkal" then
Send("say Not going to happen")
else
Send("cast %2 %1")
end
If you have a lot of them, you could use a table, eg.
not_going_to = {
self = true,
terkal = true,
nick = true,
twisol = true,
-- add more here
}
if not_going_to [string.lower ("%1")] then
Send("say Not going to happen")
else
Send("cast %2 %1")
end
That indexes into the table with the word converted to lower-case. If it matches you say "not going to happen". If not, you do it. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| AaronM86
(42 posts) bio
|
Date
| Reply #17 on Tue 30 Mar 2010 12:57 AM (UTC) |
Message
| Yes, Lua. :) And thank you both once again lol. I'm going to also store all of these set ups in an notepad so I can try to assemble these as best I can on my own in the future. I feel bad pestering with miniscule things lol, I do try to figure it out on my own before I post, just to let you know :) Regardless, thanks! | 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.
43,635 views.
This is page 2, subject is 2 pages long:
1
2
It is now over 60 days since the last post. This thread is closed.
  Refresh page
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.