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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
ragautier
Beginner


Joined: 11 Aug 2007
Posts: 29

PostPosted: Thu Aug 30, 2007 1:53 pm   

[2.01] Script that locks cMUD up REAL Bad
 
#var mylist {}
#var mydir u
#function countopens {%eval( %if( (%roomlink( %roomnum, n)=-2), 1, 0)+%if( (%roomlink( %roomnum, s)=-2), 1, 0)+%if( (%roomlink( %roomnum, w)=-2), 1, 0)+%if( (%roomlink( %roomnum, e)=-2), 1, 0))}
#UNTIL (@mydir=d) {
#if (%roomlink( %roomnum, d) = -2) {d} {
#if %eval( @countopens > 1) {#var mylist %push( %roomnum, @mylist)}
#if %roomlink( %roomnum, e)=-2 {
e
#WAIT 300
} {
#if %roomlink( %roomnum, w)=-2 {
w
#WAIT 300
} {
#if %roomlink( %roomnum, s)=-2 {
s
#WAIT 300
} {
#if %roomlink( %roomnum, n)=-2 {
n
#WAIT 300
} {
#WALK %pop( mylist)
say walking back to last room
#UNTIL (%walkactive = 0) {#WAIT 200}
}
}
}
}
}
#var mydir %left( %lastdir, 1)
#wait 300
}

This is a script that I use to autowalk mazes (where down is 'out' of the maze).
Two problems in CMUD 2.01
#1 - #WALK %pop (mylist) does not autowalk to the first room I've pushed into the stack var.
I have confirmed that mylist contains a stack of room numbers. However, it does not pop the first room and start walking it
#2 - When it gets to that point, the script just kind of dies. If I start manually walking back to that room and pass through it,
the script locks up cMUD to where only killing the process will stop it. ESC wont work - cant type in #ABORT 1 because I/O is locked,
none of the buttons work - can't min/max/close it...etc

Rich
Reply with quote
Llwethen
Novice


Joined: 08 Dec 2006
Posts: 37
Location: Lancaster,Oh

PostPosted: Thu Aug 30, 2007 3:46 pm   
 
Problem with %pop confirmed here
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Aug 30, 2007 5:53 pm   
 
Also, keep in mind that the #FUNCTION command was changed to be #VARFUNC. The #FUNCTION command in v2.x now creates "real" programming functions that require a #RETURN command to return a result.

But I think it is the %pop that causes your infinite loop as already mentioned.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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