View unanswered posts | View active topics It is currently 12 Dec 2017 08:25

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.



Reply to topic  [ 7 posts ] 
Processing output while running script? 
Author Message
Beginner

Joined: 27 Mar 2016 04:54
Posts: 20
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.


01 Apr 2016 04:43
Profile
Apprentice

Joined: 19 Feb 2016 14:26
Posts: 29
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.


01 Apr 2016 09:15
Profile
Adventurer
User avatar

Joined: 13 Jul 2015 10:25
Posts: 78
Location: Sopot, PL
If you recognize herbs maybe just after search add "put attanar(s) in pouch" ?


01 Apr 2016 11:25
Profile WWW
Adept
User avatar

Joined: 23 Jan 2016 08:28
Posts: 133
Location: Bree
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.


01 Apr 2016 22:08
Profile
Beginner

Joined: 27 Mar 2016 04:54
Posts: 20
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.


02 Apr 2016 05:16
Profile
Adept
User avatar

Joined: 23 Jan 2016 08:28
Posts: 133
Location: Bree
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


02 Apr 2016 07:51
Profile
Beginner

Joined: 27 Mar 2016 04:54
Posts: 20
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.


02 Apr 2016 18:48
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.