Processing output while running script?

General discussion about the Genesis Web Client located at https://www.genesismud.org/play/

Moderator: Eowul

Forum rules
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
Post Reply
Resnick
Beginner
Posts: 20
Joined: 27 Mar 2016 04:54

Processing output while running script?

Post by Resnick » 01 Apr 2016 04:43

Is there a way in an alias to wait for a response before continuing with a script?

E.g.
You> Search here for herbs
Output> You found a purple berry.
You> exa berry
Output> The berry is a blah blah blah attanar. blah blah blah
You> if output contains attanarput herb in special pouch. else put herb in pouch.

trick
Apprentice
Posts: 29
Joined: 19 Feb 2016 14:26

Re: Processing output while running script?

Post by trick » 01 Apr 2016 09:15

Maybe there is, but in general I think it is done by separate trigger.
If you want it to fire only when you are searching for the herbs, one way that works is to set a switch in an alias and use that alias instead of plain mud command for searching.

Then in the trigger you check for the switch and respond only if the switch is 1 (or whatever condition you try it on)


Best would be if it were possible to enable/disable triggers from GWC javascript, but I have no idea if it can be done.

User avatar
morgzaash
Adventurer
Posts: 98
Joined: 13 Jul 2015 10:25
Location: Sopot, PL
Contact:

Re: Processing output while running script?

Post by morgzaash » 01 Apr 2016 11:25

If you recognize herbs maybe just after search add "put attanar(s) in pouch" ?

User avatar
Mayobe
Adept
Posts: 133
Joined: 23 Jan 2016 08:28
Location: Bree

Re: Processing output while running script?

Post by Mayobe » 01 Apr 2016 22:08

The web client does not currently support the kind of tit-for-tat transaction you're trying to set up here.

I think morgzaash has the best solution for Attenar (assuming you have half-decent herbalism). If you have the skill to identify the herb then it will respond by name, so you can just do:

"put attenars in [special pouch]"
"put herbs in [normal pouch]"

Then just ignore the error message.

Resnick
Beginner
Posts: 20
Joined: 27 Mar 2016 04:54

Re: Processing output while running script?

Post by Resnick » 02 Apr 2016 05:16

Mayobe wrote:The web client does not currently support the kind of tit-for-tat transaction you're trying to set up here.

I think morgzaash has the best solution for Attenar (assuming you have half-decent herbalism). If you have the skill to identify the herb then it will respond by name, so you can just do:

"put attenars in [special pouch]"
"put herbs in [normal pouch]"

Then just ignore the error message.
Thanks for the answers everyone. In particular, thanks for yours Mayobe. Currently, I do use triggers to react to output (and not just for herbing) but multi sequenced triggers are clumsy and difficult to manage / modify. So I was hoping there was a better way.

User avatar
Mayobe
Adept
Posts: 133
Joined: 23 Jan 2016 08:28
Location: Bree

Re: Processing output while running script?

Post by Mayobe » 02 Apr 2016 07:51

Yes, of course it's possible to react to output, but it's not possible to set up a system that will capture the 'next' line without some information about what that line may be. For example, you can't realistically capture the herb description the way you were describing without some real shennanigans.

I think the closest you could get would be something like:

alias
* turn on a gwc bool
* exa herb
* say [codeword] //or something similar that will cause a unique line of text to be sent to you

trigger for (.*)
* if the bool is on then do your business

trigger for [codeword]
* turn off the bool

Resnick
Beginner
Posts: 20
Joined: 27 Mar 2016 04:54

Re: Processing output while running script?

Post by Resnick » 02 Apr 2016 18:48

Mayobe wrote:Yes, of course it's possible to react to output, but it's not possible to set up a system that will capture the 'next' line without some information about what that line may be. For example, you can't realistically capture the herb description the way you were describing without some real shennanigans.

I think the closest you could get would be something like:

alias
* turn on a gwc bool
* exa herb
* say [codeword] //or something similar that will cause a unique line of text to be sent to you

trigger for (.*)
* if the bool is on then do your business

trigger for [codeword]
* turn off the bool
Noted Mayobe. The stubborn side of me still says there must be a way (with no evidence to back it up). I will dig deeper. I was hoping there was some javascript wait command and some gwc.output interrupt that would interrupt the wait and then I could process the last line of output.

Post Reply
http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/