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
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Sat Jun 28, 2008 2:23 am   

infite loop error?
 
Code:
#alias {buffme} {#if (@autobuffrad) {#if (@autorad = 1) {rad;#variable autorad 10}}
#if (@autobuffglobe) {#if (@autoglobe = 1) {globe;#variable autoglobe 10}}
#if (@autoannstance = 1) {#if (@stanceann = 1) {#switch (@autoheal > -1) {#var autoheal -1} {#add autoheal -1};#switch (@autoregen > -1) {#var autoregen -1} {#add autoregen -1};#if (@bsleep <> 2) {#var bsleep -1};ann;#var stanceann 0}}
#if (@autosymmstance = 1) {#if (@stancesymm = 1) {symm;#var stancesymm 0}}}
#var autobuffrad 1
#var autorad 1
#var autoglobe 1
#var autobuffglobe 1
#var autoheal 1
#var autoregen 1
#var bsleep 1


for some reason, i keep getting an infite loop error with this alias. can't figure out why tho.... =[
Reply with quote
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Sat Jun 28, 2008 2:30 am   
 
wow.... nevermind.... i see it...

Code:
#if (@autobuffrad = 1) {#if (@autorad = 1) {rad;#variable autorad 10}}
#if (@autobuffglobe = 1) {#if (@autoglobe = 1) {globe;#variable autoglobe 10}}
#if (@autoannstance = 1) {#if (@stanceann = 1) {#switch (@autoheal > -1) {#var autoheal -1} {#add autoheal -1};#switch (@autoregen > -1) {#var autoregen -1} {#add autoregen -1};#if (@bsleep <> 2) {#var bsleep -1};ann;#var stanceann 0}}
#if (@autosymmstance = 1) {#if (@stancesymm = 1) {symm;#var stancesymm 0}}
Reply with quote
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Sat Jun 28, 2008 2:33 am   
 
er... still getting the error... =\
Reply with quote
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Sat Jun 28, 2008 2:40 am   
 
so, i think i got it. didn't like that i hit enter after each "command"... but now i've got other alias's that are getting the infinite loops in them, when... they shouldn't be. any good way to check them? =[
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat Jun 28, 2008 12:14 pm   
 
Presumably it's because one of the other aliases you have there (I assume "globe" and "rad" and stuff are aliases) is calling the buffme alias.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Sat Jun 28, 2008 12:38 pm   
 
Code:
#alias {globe} {invo 'globe of flu'}
#alias {rad} {radical defiance}
#alias {ann} {annulment stance}
#alias {symm} {stance of symmetry}


However... I'm beginning to think that its the alias that is calling the BUFFME.

Code:
healme;regenme;buffme
#LOCAL $temp
#if (@bsleep = 1) {#if (@tick <= 4) {
    sleep
    #var bcombat 0
    #var bsleep 10
    }
  }
#if (@act_lock = 0) {#IF (@hit_cur >= 1000) {
    #local $nextmob $break
    #loopdb @mob_list {
      #IF ($break = 1) {#BREAK}
      #if %val {#forall %dbkeys( @order_list) {#if (%db( @order_list, %i) = @tempcount) {#if (%i = %key) {
              $nextmob = %key
              #addkey mob_list %key %eval( %val - 1)
              $break = 1
              #break
              } {
              #IF (%db( @mob_list, %i) = 0) {tempcount = @tempcount + 1}
              #BREAK
              }}}}
      }
    #IF $nextmob {
      #IF (%db( @mob_list, $nextmob) = 0) {tempcount = @tempcount + 1}
      #var bdetect 0
      #var bmove 0
      #var bcombat 1
      #var act_lock 1
      #send %concat( @attack, " ", $nextmob)
      } {
      #LOOPDB @mob_list {#IF (%val >= 1) {$temp = 1}}
      #IF $temp {act} {#var bmove 1
      move}
      }
    }
  }


Now... Its rather lengthy, and there are a few loops in there, but the first line is where it should be doing the calling of the other three aliases, right? Or am I missing something again? ^^ Thanks Fang!
Reply with quote
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Sat Jun 28, 2008 3:46 pm   
 
Now I'm gettting the loop in REGENME-

Code:
#alias {regenme] {#if (@autoregen = 1) {#if (@end_cur < @end_min) {#5 regen;emote - RegeningDone!}}}
#variable autoregen 1
#variable end_cur 20000
#variable end_min 18500
#alias {regen} {invoke 'invigorate'}


I'm really think that the issue lies with my ACT alias, however, I can't find out whats wrong with it. When I do the individual alias's outside of the ACT alias, they work. =*[
Reply with quote
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Sat Jun 28, 2008 3:50 pm   
 
Yup... ACT alias...

Code:
#LOCAL $temp
#if (@bsleep = 1) {
  #if (@tick <= 4) {
    sleep
    #var bcombat 0
    #var bsleep 10
    }
  }
#if (@act_lock = 0) {
  #if (@hit_cur >= 1000) {
    #local $nextmob $break
    #loopdb @mob_list {
      #if ($break = 1) {#break}
      #if %val {#forall %dbkeys( @order_list) {
        #if (%db( @order_list, %i) = @tempcount) {
          #if (%i = %key) {
              $nextmob = %key
              #addkey mob_list %key %eval( %val - 1)
              $break = 1
              #break
              } {
              #if (%db( @mob_list, %i) = 0) {tempcount = @tempcount + 1}
              #break
              }
            }
          }
        }
      }
    #IF $nextmob {
      #IF (%db( @mob_list, $nextmob) = 0) {tempcount = @tempcount + 1}
      #var bdetect 0
      #var bmove 0
      #var bcombat 1
      #var act_lock 1
      #send %concat( @attack, " ", $nextmob)
      } {
      #LOOPDB @mob_list {#IF (%val >= 1) {$temp = 1}}
      #IF $temp {act} {#var bmove 1
      move}
      }
    }
  }
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat Jun 28, 2008 4:08 pm   
 
It's hard to diagnose infinite loops because they normally involve more than one setting. It's easy to see when an alias is calling itself, but it's harder to see when an alias is calling another alias which calls the first, or when an alias is calling an alias that prints text that fires a trigger that uses a function that calls the first alias. In short, check through everything in that alias that could potentially do something (expression triggers that use the variables, oninput triggers, aliases) and then go through everything that they reference, and so on until you find the loop.

I was playing with the debugger trying to see if there was a way to get it to help with this, but even with every message enabled it's not telling me when an alias is run (for example, an alias calls another alias - the debugger doesn't mention this). Am I missing something, or is this just a feature the debugger lacks?
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Jul 01, 2008 5:05 pm   
 
That's true...the script debugger doesn't currently list all aliases that are called...only if they cause a new thread to spawn. I'll consider adding more messages like that in the future.
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