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


Joined: 16 Feb 2012
Posts: 3
Location: United States

PostPosted: Mon Feb 20, 2012 12:20 am   

Help with combat bot. Having trouble getting it to stop moving when its ment to.
 
Code:
#class Bot
#var mobs %null %null
#var incombat %null
#class look
#TRIGGER {^A student is here getting ready for class.  He sure looks like a dork!
} {mobs=%additem("mob",@mobs);#if (@mobs=%null) {#RESUME a1} {#SUSPEND a1;kill student}}

#TRIGGER {Alas, an Acme student is dead!  R.I.P.} {look;%pop(@mobs)   }
#CLASS {walk}
#TRIGGER {Obvious exits:} {
  #ALARM "a1" +2 {
    #STEP
    #PAUSE
    }
  } "" {notrig}
#CLASS 0
#class 0
#class 0


Ok it follows the path like its meant to sees all the target and starts killing the target but in the middle of battle it trys to execute the next step on the path but i dont understand why if i suspend the alarm.Thanks for any help/ideas thanks!
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Mon Feb 20, 2012 1:24 pm   
 
Why are you testing the value of @mobs right after you set it?
At that point you know it will have a non %null value.

Also, why not have the trigger that finds a mob to kill do the #pause, instead of the step alarm?
So long as you have the mapper set to slow/safe mode it shouldnt try to run you along the path at lightning speed.
_________________
Discord: Shalimarwildcat
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Mon Feb 20, 2012 2:29 pm   
 
He's just using this extremely old #step script from finished script forum. Unlikely he knows what's what, he just started to use it and now it "doesn't work" :p
_________________
The Proud new owner of CMud.

--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
--------------------------------
Reply with quote
Einder
Novice


Joined: 03 Jan 2008
Posts: 48

PostPosted: Wed Aug 01, 2012 8:23 pm   
 
Instead of using
Quote:
#if (@mobs=%null) {#RESUME a1} {#SUSPEND a1;kill student}
try just using #suspend;kill student. Then when you get
Quote:
Alas, an Acme student is dead! R.I.P.
you can use #resume to continue moving. Or you could set it to look and make sure there are no other mobs to kill so that it only resumes when the room is empty.
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