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
PHLN
Adept


Joined: 30 Dec 2001
Posts: 220
Location: Canada

PostPosted: Fri May 31, 2002 3:18 pm   

Looping and Stopping Triggers
 
Hello again,
I was curious if there is a way for me to make a looping trigger that buy bandage then aid self .. and keep doing it till my hp is at its max ? ... maybe I can start this loop from a aliase or something .. like .. healself ?
My prompt look like this([GT 9:43 am] HP:380/562 MA:505/505 MV:477/595 XP to Lvl:92% W/A:3 Standing)>
The begining might have a afk note like this
(AFK [GT 9:51 am] HP:416/562 MA:505/505 MV:496/595 XP to Lvl:92% W/A:3 Standing)>
If this looping and stopping of triggers is possible .. please help me out with it .. thank you
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri May 31, 2002 4:17 pm   
 
The first step is to write a trigger that extracts your HP from the prompt. You might as well get your mana and moves at the same time.
#TR {HP:(%d)/(%d) MA:(%d)/(%d) MA:(%d)/(%d)} {#VAR hp %1;#VAR maxhp %2;#VAR ma %3;#VAR maxma %4;#VAR mv %5;#VAR maxmv %6} {} {nocr|prompt}
For your script, you'll need a trigger that checks your HP AFTER you aid yourself. This should be in a class that your "healself" alias can enable, so that you can still use bandages one at a time when you want to.
#AL healself {#T+ selfheal;buy bandage;aid self}
#TR {you apply the bandage to yourself} {#IF (@hp < @maxhp) {buy bandage;aid self} {#T- selfheal}} {selfheal}


LightBulb
Vague questions get vague answers
Reply with quote
PHLN
Adept


Joined: 30 Dec 2001
Posts: 220
Location: Canada

PostPosted: Fri May 31, 2002 4:33 pm   
 
thank you .. *smile* ... all of you are coder are what ? .. hehe .. cause I have no idea what those lines mean .. but they work
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