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
dk92870
Newbie


Joined: 07 Mar 2002
Posts: 4
Location: USA

PostPosted: Fri Mar 08, 2002 6:02 am   

auto kill bot?
 
I am trying to write a script or a series of triggers / actions? so that I can have the character auto kill monster (one type of monster only).
Basically what the bot will do are the following:
1) rest in Room2 and kill in Room1.
2) bot will wait in Room2 for monster(assume the name is Rat), once Rat show up, Bot will attack RAT and walk to Room1 (speed walk, so RAT won't be able to attack Bot).
3) each time Bot in Room1 it will check Hit Point and Magic Point, if HP is low, it will cast Heal spell until HP is above some number (let's say 30HP). When all conditions (HP and MP) are met. Bot will do a speedwalk to Room2, attack Rat and back to Room1 (Again, sending a series of commands, so Bot will not get attack).
4) In case the command for walking back to Room1 got 'cut' or delayed, Bot will keep trying to walk back to Room1 ASAP.

The mud I am playing is based on Mordor/Isengard Mud.
If anyone has script similar to what I described above or if someone can show me some guideline on creating such script or triggers/actions.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Mar 08, 2002 5:09 pm   
 
Here's a basic outline for you to work from

Start in Room 2
#TR {a RAT appears} {attack rat;speedwalk room1}
#TR {you have arrived in room one} {checkHP}
#AL checkHP {#IF (@HP < 30) {cast heal;checkHP} {rest}}
#TR {all conditions are met} {speedwalk room2}
#TR {You have arrived in room two} {#IF (@rathere = true} {attack rat;speedwalk room1} {rest}}

LightBulb
All scripts untested unless otherwise noted
Reply with quote
dk92870
Newbie


Joined: 07 Mar 2002
Posts: 4
Location: USA

PostPosted: Sun Mar 10, 2002 9:27 am   
 
This is what I have so far. I tried the partial working script on Zmud and it seems not working. I guess my problem is I don't know when to use #TRIGGER, #ALIAS, #VA, and etc. Also I don't know how to call #PATH from #TRIGGER or #.....

-----
#VA HpMax 25
#VA MpMax 30
#ALIAS MonName {rat?}

#TRIGGER {&%dHpVar H &%dMpVar M}

#TRIGGER {You see %w @MonName} {poke @MonName; eastRoom}
#TRIGGER {a @MonName just arrived.} {poke @MonName; eastRoom}
#TRIGGER {Rest Area} {checkHP}
#TRIGGER {all condition are met} {westRoom}
#TRIGGER {Battle Field} {#IF (@MonsterHere = true} {poke ini; eastRoom} {rest}}

#rest
#goAttack

#PATH eastRoom {e}
#PATH westRoom {w}
#ALIAS checkMP {#IF (@MpVar < @MpMax) {rest; look; checkMP} {goAttack}}
#ALIAS checkHP {#IF (@HpVar < @HpMax) {cast vigor; look; checkHP} {checkMP}}
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Mar 10, 2002 3:14 pm   
 
The script outline I provided is NOT intended to work. It's intended to provide you with an outline for developing a script which will work. A working script can only be developed with knowledge of the MUD's output and the MUD's commands.

Zugg included an extensive helpfile with numerous examples which makes it fairly clear when (and how) to use #TRIGGER, #ALIAS, #VARIABLE, etc. However,
Use #TRIGGER when you want your character to react automatically to something that happens on the MUD, such as "disarms you and sends your sword flying" could trigger "get sword;wield sword"
Use #ALIAS when you want to create a new command which will tell your character to take several actions, such as "eatfood" could mean "open lunchbox, get sandwich from lunchbox, eat sandwich, close lunchbox"
You can also use #ALIAS to substitute a shorter/different word for an existing command, such as "bs" instead of "backstab"
Use #VARIABLE for things that will change, such as how many hp is enough to start a fight or the name of the monster you are fighting

For clearer explanations, READ THE HELPFILE!

LightBulb
All scripts untested unless otherwise noted
Reply with quote
dk92870
Newbie


Joined: 07 Mar 2002
Posts: 4
Location: USA

PostPosted: Wed Mar 13, 2002 7:55 am   
 
I have trimmed my bot down to the following:

#ALIAS checkMP {#IF (@MpVar < 5) {look;checkMP} {west}}
#ALIAS checkHP {#IF (@HpVar < 5) {cast heal;look;checkHP} {checkMP}}


#TRIGGER {&%dHpVar H &%dMpVar M} {}
#TRIGGER {Rest Area} {checkHP}
#TRIGGER {Please wait %d %w second} {#WAIT 2000}
#TRIGGER {rat?} {k rat;east}


the above commands work, but when it spot the rat, it executed k rat, east, k rat, east, k rat, east like 4 or 5 times.
I figure I need to put #Wait command.
do I put #wait on every trigger or is there a way to make all the triggers run into a cycle?
I am using Zmud 6.16

David
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Mar 13, 2002 1:40 pm   
 
Try disabling the Trigger on Trigger option for the rat trigger.

Kjata
Reply with quote
dk92870
Newbie


Joined: 07 Mar 2002
Posts: 4
Location: USA

PostPosted: Thu Mar 14, 2002 8:01 am   
 
I disable trigger on trigger check box.
one more question, when I issued commands {k rat; east} it prompted me to wait 3 seconds.
Is there a way to make the commands act at the same time? Basically, function like a macro key where I can set the key to execute two commands. k rat and east at the same time. When I used macro key with this setting, I rarely got prompted with the message "please wait 3 seconds." And the rat won't be able to hit me ......
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