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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
mandy
Novice


Joined: 10 Jul 2007
Posts: 47

PostPosted: Sat Sep 17, 2011 1:57 am   

Walker Script + Mapper
 
So, I've been trying to design a script using the #walk command to follow along in larger areas. It 'mostly' works and I'm looking to do more improvements but it has some slight bugs.

First, a class folder for the mobs/items/players I'm looking for. Each mob has a trigger and the commands are:
Code:
mobs = 1
mobfound = [color=orange]|mob id|[/color]
#T- [color=orange]|MOB Class|[/color]


Second, the mud prompt. Its in it's own class folder to make it easier for an on/off switch.
Code:
#wait 500
#IF (@items = 1 and @players = 0) {getall}
#IF (!@mobs or @players) {nextroom}
#IF (@mobs and !@players) {kill @mobfound}
#T- prompt
#T- roomtrig


Third, the trigger that designates that I've made it to the room. (roomtrig)
Code:
#OK
players = 0
items = 0
mobs = 0
mapstep = %roomnum
#IF (@currentstep == @mapstep) {#T+ prompt}
#T+ [color=orange]|MOB CLASS|[/color]
#ECHO @currentstep
#ECHO @nextstep
#echo @mapstep


Next, the nextroom alias:
Code:
#T+ roomtrig
#walk @nextstep
currentstep = @nextstep
nextstep = (@currentstep +1)



To use:
    Mark your spot on the mapper
    Set the currentstep variable to the value of %roomnum
    Set the nextstep variable to the value of %roomnum + 1
    Use the nextroom alias.
    Kill the mob/Get the items
    Use the nextroom alias
    Lather/Rinse/Repeat.


It works... mostly but it does see to randomly stop too much or not stop enough. Please feel free to provide any feedback.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Sep 20, 2011 1:31 am   
 
One possible problem is the #WAIT in your prompt trigger. That puts the trigger into a new thread. If for some reason you get another prompt before that #WAIT finishes, it will trigger again, and create yet another thread. You could end up with several of these threads sitting around and trying to send the nextroom or kill commands. That can mess you up.
Reply with quote
mandy
Novice


Joined: 10 Jul 2007
Posts: 47

PostPosted: Tue Sep 20, 2011 1:35 am   
 
It did the same thing before the wait was added. the wait was added per advice when i was having the same problem.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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