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 ➜ how do I check multiple lines

how do I check multiple lines

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


Pages: 1  2 

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #15 on Thu 22 Sep 2011 10:44 PM (UTC)
Message
I would put some debugging displays in there. Assuming the trigger fires, and I wouldn't be too confident, then you will probably find that it is getting:


"   Resist Fire"


(note the spaces). Thus " Resist Fire" won't match "Resist Fire".

- Nick Gammon

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

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #16 on Fri 23 Sep 2011 04:03 AM (UTC)
Message
I see a * at the beginning of the trigger. Wouldn't that offset everything, making %2 the first Resist capture?

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #17 on Fri 23 Sep 2011 07:54 AM (UTC)

Amended on Fri 23 Sep 2011 07:55 AM (UTC) by Nick Gammon

Message
Yes I noticed that too, but since he is checking %1 through %11 maybe that isn't a big issue.

However this is:


if "%10" == "Resist Fire" then
Send("Say Resist Fire")
end--if
if "%11" == "Resist Fire" then
Send("Say Resist Fire")
end--if


The normal %1 etc. only works from %0 to %9. After that you need to use the < and > symbols, like this:


if "%<10>" == "Resist Fire" then
  Send("Say Resist Fire")
end--if
if "%<11>" == "Resist Fire" then
  Send("Say Resist Fire")
end--if


There are probably better ways of doing this than testing 11 things like that.

- Nick Gammon

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

Posted by Warbit   USA  (47 posts)  Bio
Date Reply #18 on Fri 23 Sep 2011 12:23 PM (UTC)
Message
thanks you two I will add spaces in front of it to test to see if it fires.

I will have to read the debug display info. to see how to do that if this doesn't work.

Will get back to you all, with my results.
Top

Posted by Warbit   USA  (47 posts)  Bio
Date Reply #19 on Tue 27 Sep 2011 12:38 PM (UTC)
Message
Sorry tried it it did work.
then tried with forward and backward spacing add. buy in trigger box it made every

if "%1" == "   Resist Fire                             
 "  then

fall onto two line, out i figured out another way to do what i wanted to do.
So I believe I am going to let this question, die. unless something else pops up, that I need to figure out how it works. Thanks Nick and all you people for attempting to help me solve my issue.
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.


59,431 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

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.