Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
MadBomber
Beginner


Joined: 17 Oct 2002
Posts: 26
Location: USA

PostPosted: Mon Dec 16, 2002 11:52 am   

A tough trigger to write, maybe you can help.
 
I'm trying to write an auto-forage script. This is seeming to be a difficult task. What I want to do is, start foraging. If it sees "You gain %d experience!", I want it to forage again. If it sees "Your search comes up empty" I want it to forage again. BUT, if it sees "Your search comes up empty" for the second time in a row, I want my char to stand, move west, rest, and forage again - resetting the trigger (I would imagine). Now when my char sees "You are getting tired.", I want him to recall until his movement is at max. When it sees his movement is maxxed, he will wake up, go south, go 5w, rest, forage. And the entire process starts over again.

I was thinking a multistate trigger and maybe a couple variables could do this, but I keep gettings stuck. Here are some things you may need to know if you help me:
forage - that is the forage command

<550hp 173m 301mv 11ac> - this is my prompt, my movement is currently at its max.
You are getting tired. - the line I recieve, while foraging, if my mv is low.
You receive %d experience. - the line I see on a successful forage, %d representing any number.
Your search comes up empty. - the line I see on a failed forage.
All othere commands I use, such as recall or directions, sit and rest, are all standard - s,w,n,e,recall,sit,rest

If I figure it out before anyone helps me, I'll post so nobody wastes their time on this.
Thanks for the help,
MadBomber

--------------------
Currently Using zMUD 6.16 &
Currently Using zMUD 6.39aBeta
Reply with quote
MadBomber
Beginner


Joined: 17 Oct 2002
Posts: 26
Location: USA

PostPosted: Mon Dec 16, 2002 1:20 pm   
 
Ok. I got it. Needed multiple triggers to do it but it works really awesome. I have it to where it even changes directions if I run into a dead end and now will recall and sleep for half an hour for the area to refresh if I foraged too much and am not getting good results. Also added a trigger to talk in group chat so that a new prompt would pop up every ten seconds to check if my MV is maxxed yet. Here is what all the triggers/vars look like in case anyone is interested:
#VAR fordir {w} {_nodef}

#ALARM "for_temp" -10 {gt blarg - foraging} {disable}
#TRIGGER "forage4" {Alas, you cannot go that way.} {#IF (@fordir=w) {#VAR fordir n} {#VAR fordir w}}
#TRIGGER "forage3" {You are getting tired.} {#T- forage1;#T- forage2;drop all;get pack;get candle;recall;sleep;#T+ for_temp}
#COND "forage3" {<%dhp %dm (@maxmv)mv %dac>} {#T- for_temp;#T+ forage1;#T+ forage2;wak;s;w;w;w;w;rest;for;#STATE forage3 0;#VAR fordir w} {nocr|prompt}
#TRIGGER "forage1" {You receive &gain experience.} {for;#ALA for_gain +2:00 {recall;sleep;#T- forage;#T- for_temp;#ALA for_reset +30:00 {#T- forage1;#STATE forage1 0;#T- forage2;#STATE forage2 0;#STATE forage3 1;#T+ forage3;#T+ forage;#T+ for_temp}};#STATE forage2 0}
#TRIGGER "forage2" {Your search comes up empty.} {for}
#COND "forage2" {Your search comes up empty.} {for}
#COND "forage2" {Your search comes up empty.} {stand;@fordir;rest;for;#STATE forage2 0}
Take Care,
MadBomber

--------------------
Currently Using zMUD 6.16 &
Currently Using zMUD 6.39aBeta
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Dec 16, 2002 4:52 pm   
 
For those who might think of copying this script, be aware it's for the beta version.
The #COND and #STATE commands are NOT currently available in the public version
(6.16).

You should also be aware that you can't use cut-and-paste with this script. One of the
side effects of using [ code ] and [ /code ] is that the lines all run together when you
try to cut-and-paste them. Another side effect is that the forum wordwrap gets
disabled. These two effects are the reasons I almost never use those tags.

LightBulb
Senior Member
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net