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

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  How to write trigger for text without newline?

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: How to write trigger for text without newline?
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please)
Maximum of 6000 characters. Text only please, no HTML.
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1 2  

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Mon 24 May 2010 03:19 AM (UTC)  quote  ]
Message
I've taken the liberty of changing the topic from "How to deal with the problem?" to "How to write trigger for text without newline?" to be more helpful for people trying to search for this later on.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Tianxz   (30 posts)  [Biography] bio
Date Mon 24 May 2010 02:15 AM (UTC)  quote  ]
Message
That is great answer.
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Sun 23 May 2010 06:17 AM (UTC)  quote  ]
Message
Template:faq=11 Please read the MUSHclient FAQ - point 11.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Sun 23 May 2010 06:09 AM (UTC)  quote  ]
Message
Can't multiline triggers be convinced to process this? At worse, there's always looking at packets received...

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Sun 23 May 2010 03:35 AM (UTC)  quote  ]
Message
Ahh, that explains a lot. Hmm... You might want to try enabling "Convert IAC EOR/GA to newline". It's in Game -> Configure -> Output, at the bottom of the list on the right.

If that doesn't work, there's not much more you can do. If all of these questions come in the same order every time, you can try triggering on a line right before the first question, and sending your answers all at once. It's a little hacky, but under the circumstances...

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Tianxz   (30 posts)  [Biography] bio
Date Sun 23 May 2010 03:32 AM (UTC)  quote  ]
Message
Oh. I found the problem prehaps is the question a doesn't send the \n to mushclient. So the trigger can't be triggered. How can I do it?
[Go to top] top

Posted by Tianxz   (30 posts)  [Biography] bio
Date Sun 23 May 2010 03:26 AM (UTC)  quote  ]
Message
Additional: The first trigger work on input the "enter". I don't why?
[Go to top] top

Posted by Tianxz   (30 posts)  [Biography] bio
Date Sun 23 May 2010 03:24 AM (UTC)  quote  ]
Message
Yes,I send to script.

There are four question and one by one.

First, Mud send the question A to me. I make a trigger on question A and send $world->Send('2'); to script. But The mud can't send the question B to me. It Send the question B and C to me after I input the "enter" in command window. It only ask me answer the question C.

If I send the $world->Send('2');$world->Send('1'); to the script. It still can't display next question. Only after I inut the "enter", it send the the question B,C and Dto me and ask me answer the question D.

If I don't input the "enter", it can't trigger the trigger and send answer to server even I choice send it to world immediate with 2.
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Sun 23 May 2010 03:10 AM (UTC)  quote  ]
Message
What's the "Send to" box set to? It should be set to "Script", and make sure there's no slash on that line.

In this case, you could also set "Send to" to "World", and just have 2 in the send box. That would do the exact same thing.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Tianxz   (30 posts)  [Biography] bio
Date Sun 23 May 2010 03:00 AM (UTC)  quote  ]

Amended on Sun 23 May 2010 03:11 AM (UTC) by Tianxz

Message
I use the Send and Execute to try it. But both can't work correctly.

The problem is
The mud ask me a Question A. Then the trigger will answer this question with 2. I use the command:/$world.Send('2');

Then the mud continue ask me another Question.

I trace it and find the trigger doesn't work before I input the "Enter". The trigger on question A only work after I input "enter". So I think the regular expression is good. It can't work after I input "enter" if it is wrong. I find when I input the "enter" just send the answer to question 2. But I don't know where is the problem.

Thank you.
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Sun 23 May 2010 02:40 AM (UTC)  quote  ]
Message
Please make sure you're using Execute, not execute, and Send, not send. Other than that... well, please explain exactly what you mean by "can't work correctly".

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Tianxz   (30 posts)  [Biography] bio
Date Sun 23 May 2010 02:34 AM (UTC)  quote  ]
Message
Not only send("2") but also execute('2') can't work correctly.
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Sun 23 May 2010 02:16 AM (UTC)  quote  ]
Message
Execute checks aliases first, Send doesn't.

Though, neither of them needs a newline at the end, they both add one automatically. Perhaps you should try quoting the number, that is, "2" instead of 2. $world->Execute("2") should work fine.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Tianxz   (30 posts)  [Biography] bio
Date Sun 23 May 2010 02:13 AM (UTC)  quote  ]
Message
what is the different between the execute and send?
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Sun 23 May 2010 01:29 AM (UTC)  quote  ]
Message
You might want to try just using Send, because I don't think you're planning on having a 2 alias (are you?)

$world->Send("2");

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[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.


3,097 views.

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

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]