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 ➜ Suggestions ➜ Allowing multiple Send/Script calls on same line, Repeat on same line

Allowing multiple Send/Script calls on same line, Repeat on same line

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


Pages: 1  2 3  

Posted by Kevnuke   USA  (145 posts)  Bio
Date Reply #15 on Thu 11 Mar 2010 11:09 PM (UTC)

Amended on Thu 11 Mar 2010 11:11 PM (UTC) by Kevnuke

Message
Twisol said:

Lady's slipper is absolutely an herb! You find it in the grasslands. (I think I know my herbs, I'm a long-time Sylvan. ;) )

I'm referring to herbs you -eat- to cure an affliction. As I said -that- herb is used to make concoctions. None of the ones you eat or smoke or apply have apostrophes or dashes.

Twisol said:

Also, you can find non-herb items on the same line as herb items in the rift, so if you don't account for all possibilities in the match, you'll have a hard time getting a match when you should be. Match the general case, and trim down to the specific case in script.


If even one item in a pattern matches, then it matches the whole line. Such is evident when you have only one thing on a line match and "omit from output" is on for that trigger. So realizing this.. i could simply use a trigger that does this "(\d+)\s(\w+)" that is only on when i type "info rift" and is turned off by the prompt (Use the minimum needed to match, as Nick suggested earlier). since it isn't anchored and is assumed greedy, it will match whether i get the minimum of one herb on that line or the maximum three on the line, then use a function with string.gmatch as Nick suggested earlier.

Correct me if I'm wrong

EDIT: Typo
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #16 on Fri 12 Mar 2010 02:13 AM (UTC)
Message
Kevnuke said:
Twisol said:
Lady's slipper is absolutely an herb! You find it in the grasslands. (I think I know my herbs, I'm a long-time Sylvan. ;) )

I'm referring to herbs you -eat- to cure an affliction. As I said -that- herb is used to make concoctions. None of the ones you eat or smoke or apply have apostrophes or dashes.

At no other point did you make this distinction clear!

Kevnuke said:
Twisol said:
Also, you can find non-herb items on the same line as herb items in the rift, so if you don't account for all possibilities in the match, you'll have a hard time getting a match when you should be. Match the general case, and trim down to the specific case in script.

If even one item in a pattern matches, then it matches the whole line. Such is evident when you have only one thing on a line match and "omit from output" is on for that trigger. So realizing this.. i could simply use a trigger that does this "(\d+)\s(\w+)" that is only on when i type "info rift" and is turned off by the prompt (Use the minimum needed to match, as Nick suggested earlier). since it isn't anchored and is assumed greedy, it will match whether i get the minimum of one herb on that line or the maximum three on the line, then use a function with string.gmatch as Nick suggested earlier.

Correct me if I'm wrong

Hmm. That is possible, yes. It's not really as explicit as I personally prefer, but yes.

'Soludra' on Achaea

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

Posted by Kevnuke   USA  (145 posts)  Bio
Date Reply #17 on Fri 12 Mar 2010 02:27 AM (UTC)
Message
Twisol said:
Hmm. That is possible, yes. It's not really as explicit as I personally prefer, but yes.


Only having it on between the command and the prompt isn't explicit enough? It's less than a one second window.. O.o
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #18 on Fri 12 Mar 2010 02:28 AM (UTC)
Message
I was more referring to matching just a snippet of the line instead of using as much of the line as you can. I disagree with using the least possible to match, because the more you can use, the more reliable the matches can be. It's very, very easy for extra content to sneak between the command and the response output.

'Soludra' on Achaea

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

Posted by Kevnuke   USA  (145 posts)  Bio
Date Reply #19 on Fri 12 Mar 2010 02:49 AM (UTC)

Amended on Fri 12 Mar 2010 03:16 AM (UTC) by Kevnuke

Message
My bad, I actually trigger it off of the "Glancing into your rift you see:" line, to turn on that trigger. I turn on the glancing line trigger with the command, or the script does it, and starts the chain reaction.

Also, does achaea always send one or the other DO or WILL, when it requests to negotiate in ATCP or is it random? All the examples i've seen are that it sends WILL.

EDIT: Typo
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #20 on Fri 12 Mar 2010 02:50 AM (UTC)

Amended on Fri 12 Mar 2010 02:52 AM (UTC) by Twisol

Message
Kevnuke said:
My bad, I actually trigger it off of the "Glancing into your rift you see:" line, to turn on that trigger. I turn on the glancing line trigger with the command, or the script does it, and starts the chain reaction.

And I assume that line itself is only enabled once you use the command? Much better. Still possible to get the wrong thing, but the more layers the better.

Now, the big problem is when you get an error message. Maybe you're underground (not actually sure if that prevents IR or not). There are lots of error messages, and some of them don't necessarily refer specifically to your command. It's a problem I hit and can't do much about with a MAP plugin I wrote. =/

'Soludra' on Achaea

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

Posted by Kevnuke   USA  (145 posts)  Bio
Date Reply #21 on Fri 12 Mar 2010 03:01 AM (UTC)
Message
I was actually planning to replace (\w+) with an ored list of all the curing herbs.

For example:

"[\s*\d+]\s(sileris|bayberry bark|skullcap)"

not to mention, that not much is going to match on that initial number in square brackets pattern :)
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #22 on Fri 12 Mar 2010 03:05 AM (UTC)
Message
That would work too. I personally prefer to use regex to validate a line's format first, then use script to actually check the values. To each his/her own, in the end.

'Soludra' on Achaea

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

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #23 on Fri 12 Mar 2010 03:06 AM (UTC)
Message
Kevnuke said:
Also, does achaea always send one or the other DO or WILL, when it requests to negotiate in ATCP or is it random? All the examples i've seen are that it send WILL.


If it were random, someone would have complained very loudly to the Achaea admins by now. No, I'm pretty sure it's always WILL.

'Soludra' on Achaea

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

Posted by Kevnuke   USA  (145 posts)  Bio
Date Reply #24 on Fri 12 Mar 2010 03:13 AM (UTC)
Message
Sweet! Then i don't have to make a nested if statement heh.
You wouldn't happen to have a dump from Achaea of the telnet negotiations it sends from the time you connect to the time you DC would ya? And does the Char.Vitals negotiation get sent with the prompt, or more often?
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #25 on Fri 12 Mar 2010 04:05 AM (UTC)
Message
Kevnuke said:
You wouldn't happen to have a dump from Achaea of the telnet negotiations it sends from the time you connect to the time you DC would ya? And does the Char.Vitals negotiation get sent with the prompt, or more often?


No, not really. I know you get an IAC WILL ATCP, then you send IAC DO ATCP in response, and immediately send your 'hello' message and module list according to the spec. Then after that it's ATCP messages in IAC SB ATCP <message> IAC SE.

Char.Vitals is sent with every prompt, yes.

I wrote an ATCP plugin specifically to deal with the low-level details, although it seems like it might get phased out soon. If you don't want to do the work yourself, you can grab it from [1]. A good base to work from is my roomname plugin [2], also - just edit scripts/main.lua to do what you want, and use the current content to see how to communicate with the ATCP plugin.

[1] http://jonathan.com/?page_id=29

'Soludra' on Achaea

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

Posted by Kevnuke   USA  (145 posts)  Bio
Date Reply #26 on Fri 12 Mar 2010 04:20 AM (UTC)
Message
Yeah i was actually going to make a plugin for myself (and others if they want it) that grabs the subnegotiations and uses them for an autosipper and a curing system. Not sure how long it'll take me but I just want to see what I can accomplish. And I greatly appreciate all the plugins from various authors out there. They are great for ideas. :)
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #27 on Fri 12 Mar 2010 04:31 AM (UTC)

Amended on Fri 12 Mar 2010 04:33 AM (UTC) by Twisol

Message
Kevnuke said:

Yeah i was actually going to make a plugin for myself (and others if they want it) that grabs the subnegotiations and uses them for an autosipper and a curing system. Not sure how long it'll take me but I just want to see what I can accomplish. And I greatly appreciate all the plugins from various authors out there. They are great for ideas. :)


Well, a spot of advice for you: Writing it yourself to learn is all fine and stuff - it's a fantastic way to improve your abilities - but when there's already something that works well, and is proven to work, and there are already at least two other versions of the same thing, you might not want to make a point of releasing it for other people to use. What will yours do that mine (and Nick's, and Worstje's(?)) can't? Or how does it do it better? Mine in particular has existed for a long time, and I'm only the third and most recent maintainer.

Again, writing it yourself to learn is great, I would never say no to that. Go for it! But when you have three plugins, and they each need a different kind of ATCP plugin, which all do the same thing, something's wrong!

'Soludra' on Achaea

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

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #28 on Fri 12 Mar 2010 04:39 AM (UTC)
Message
Perhaps every plugin could not only implement ATCP functionality by duplicating code, but indeed implement different handling of ATCP functionality. :P

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #29 on Fri 12 Mar 2010 04:42 AM (UTC)
Message
David Haley said:

Perhaps every plugin could not only implement ATCP functionality by duplicating code, but indeed implement different handling of ATCP functionality. :P


Well, that's what I mean by "What will yours do that mine can't? Or how does it do it better?" I don't mean to discourage ATCP-plugin development altogether, but I do want to encourage thinking about why, specifically, it should be released.

'Soludra' on Achaea

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


109,278 views.

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

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.