Mar 212009
Achaea MUD ZMud script for random walking, useful for auto exploring.
#CLASS {Aliases|aSystem|RandomWalkA}
#ALIAS _RandomWalk {
#ADDKEY Personal RandomWalkTakeSteps 0
#IF (%1 = Fast) {}
#IF (%1 = Slow) {
#EXEC _Debug "_RandomWalk : Starting Slow"
#T+ AlRandomWalkBig
}
}
#ALIAS _TakeRandomStep {
#VAR AllExits "" _nodef RandomWalkA
#LOOP 1,10 {#IF (%roomlink( , %item( @Directions, %i))>0) {#ADDITEM AllExits %item( @Directions, %i)}}
_SendCommandOnPrompt %item( @AllExits, %random( 1, %numitems( @AllExits)))
}
#VAR AllExits {n|ne|e|se|s|sw|w|nw}
#ALARM "AlRandomWalkSmall" {*1} {
;#EXEC _Debug "_RandomWalk Slow Still Wants To Walk"
#IF (@Personal.RandomWalk) {
#IF (@EQBal and %if( @Personal.Hunting, %null( @RoomDenizenEnimies), true) and not %inwalk) {
; #EXEC _Debug "_RandomWalk Slow Walking"
#ADDKEY Personal RandomWalkSteps %eval( @Personal.RandomWalkSteps + 1)
#EXEC _TakeRandomStep
#T- AlRandomWalkSmall
#T+ AlRandomWalkBig
}
} {
#T- AlRandomWalkSmall
#T- AlRandomWalkBig
#EXEC _Debug "_RandomWalk Stopping"
}
} "" {disable}
#ALARM "AlRandomWalkBig" {*10} {
;#EXEC _Debug "_RandomWalk Slow Wants To Walk"
#IF (@Personal.RandomWalk) {
#IF (@EQBal and %if( @Personal.Hunting, %null( @RoomDenizenEnimies), true) and not %inwalk) {
; #EXEC _Debug "_RandomWalk Slow Walking"
#ADDKEY Personal RandomWalkSteps %eval( @Personal.RandomWalkSteps + 1)
#EXEC _TakeRandomStep
} {
#T- AlRandomWalkBig
#T+ AlRandomWalkSmall
}
} {
#T- AlRandomWalkBig
#EXEC _Debug "_RandomWalk Stopping"
}
} "" {disable}
#CLASS 0