|
shaun.murray Magician
Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: Tue Dec 15, 2009 4:35 pm
Infinite Loop Detected. HuH? |
Code: |
<alias name="healme" id="282">
<value>#if (@nocast = 0) {
$PossibleHeals = 0
$NeededHeals = 0
#if (@autoheal = 1) {
#if (@hit_cur <= @hit_min) {
#var autoheal 10
$NeededHeals = (@hit_min - @hit_cur) / 1004
$PossibleHeals = @spi_cur / 40
#loop %min( $NeededHeals, $PossibleHeals) {heal}
}
}
}</value>
</alias> |
#var nocast = 0
#var autoheal = 1
#var hit_cur = 30000
#var hit_min = 31000
#var spi_cur = 7100
I can't for the life of me figure out why its saying that I have an infinite loop. =[ |
|
|
|
shaun.murray Magician
Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: Tue Dec 15, 2009 4:58 pm |
aiight, its not my alias, i think its how the alias is being called. ugh! tia! lol
|
|
|
|
shaun.murray Magician
Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: Tue Dec 15, 2009 5:19 pm |
Ok, so same variables from previous but I put in a notification in a window to how many heals are coming. And it looks like my %min is what the issue is. I made this about a year ago, and have since dusted it off, and started playing again. So I'm a little rusty. The concept should be pretty easy to tell, but I'm trying to make it heal me up, as long as I have the spirit available.
Code: |
<alias name="healme" id="282">
<value>#if (@nocast = 0) {
$PossibleHeals = 0
$NeededHeals = 0
#if (@autoheal = 1) {
#if (@hit_cur <= @hit_min) {
#var autoheal 10
$NeededHeals = (@hit_min - @hit_cur) / 903
$PossibleHeals = @spi_cur / 40
#loop %min( $NeededHeals, $PossibleHeals) {heal};#window misc ~-~-~-~- HEALED ~-~-~-~-
}
}
}</value>
</alias> |
Here is the output before the infiniteloop window pop'd up.
---- HEALED ----
---- HEALED ----
---- HEALED ----
---- HEALED ----
---- HEALED ----
---- HEALED ----
---- HEALED ----
---- HEALED ----
---- HEALED ----
---- HEALED ----
---- HEALED ----
---- HEALED ----
---- HEALED ----
---- HEALED ----
---- HEALED ----
---- HEALED ----
---- HEALED ----
---- HEALED ----
---- HEALED ----
---- HEALED ----
---- HEALED ----
---- HEALED ----
---- HEALED ----
---- HEALED ----
---- HEALED ---- |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue Dec 15, 2009 9:39 pm |
If that is the actual alias, the problem isn't here. You have the line
Code: |
};#window misc ~-~-~-~- HEALED ~-~-~-~- |
outside of your loop--you forgot to put it inside the braces {}. So, if that is actually the way the alias is defined, it means that something is calling the alias 'healme' in a big loop. How are you executing 'healme'? |
|
|
|
shaun.murray Magician
Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: Wed Dec 16, 2009 1:54 pm |
looks like i've got quite the code rewrite then, if its the alias that is calling the healme to be fubard. its rather long, and kinda spaghetti i'm afraid. =[ anyways, lets get to it! lol!
here is the sample of a run, the bolded is the alias in question working (first # is the needed heals, second # is the possible heals based on spirit).
Quote: |
A Secluded Grove [ exits: north east south west ]
Larger than a normal lion, this beast's fur is pitch black.
This shadow ape stares at you with blood red eyes.
This wolfen is smaller than the others.
[Lag: 0] [Align: -1000] [ 61482741 ] [Reply: ]
[H:29851/32967] [M:100/100] [S:7046/7166] [E:20417/21970]0
176
0
176
vici fis lion
The power of your dextrous hands EVISCERATES (2333) a dark lion!!
You land [ 13 of 15 ] attacks on a dark lion: RUPTURING (488) damage!
[Lag: 4000] [Sheykh: (perfect condition)] [dark lion: (severely wounded)]
[h:29851/32967] [m:100/100] [s:7046/7166] [e:20375/21970]
A dark lion misses [ 11 ] attacks on you!
You land [ 14 of 14 ] attacks on a dark lion: RUPTURING (434) damage!
[Lag: 3391] [Sheykh: (perfect condition)] [dark lion: (near death)]
[h:29851/32967] [m:100/100] [s:7046/7166] [e:20375/21970]
A dark lion lands [ 1 of 11 ] attacks on you: scratching (18) damage.
You land [ 7 of 7 ] attacks on a dark lion: MUTILATING (748) damage!!
A dark lion falls to the ground! He is dead!
You receive 2,580,500 (+318,399 learn, +131,402 rp) exp.
You get a pile of 140,480 gold.
[Lag: 1000] [Align: -1000] [ 64582326 ] [Reply: ]
[H:29833/32967] [M:100/100] [S:7046/7166] [E:20375/21970]0
176
vici fis ape
The power of your dextrous hands EVISCERATES (2439) a shadow ape!!
You land [ 11 of 12 ] attacks on a shadow ape: MUTILATING (561) damage!!
[Lag: 4000] [Sheykh: (perfect condition)] [shadow ape: (bleeding freely)]
[h:29833/32967] [m:100/100] [s:7046/7166] [e:20333/21970]
A shadow ape misses [ 11 ] attacks on you!
You land [ 9 of 12 ] attacks on a shadow ape: DEHISCING (778) damage!!
A shadow ape falls to the ground! He is dead!
You receive 1,885,077 (+234,939 learn, +96,627 rp) exp.
You get a pile of 113,759 gold.
[Lag: 1000] [Align: -1000] [ 66847589 ] [Reply: ]
[H:29833/32967] [M:100/100] [S:7046/7166] [E:20333/21970]0
176
0
176
vici fis pup
The power of your dextrous hands EVISCERATES (2130) a wolfen pup!!
You land [ 11 of 14 ] attacks on a wolfen pup: MUTILATING (563) damage!!
Lost dog: Rheal Khayman has arrived.
A sixth order angel has arrived.
[Lag: 4000] [Sheykh: (perfect condition)] [wolfen pup: (near death)]
[h:29833/32967] [m:100/100] [s:7046/7166] [e:20291/21970]
Lost dog: Rheal Khayman leaves west.
A sixth order angel leaves west.
[Lag: 3797] [Sheykh: (perfect condition)] [wolfen pup: (near death)]
[h:29833/32967] [m:100/100] [s:7046/7166] [e:20291/21970]
A wolfen pup misses [ 9 ] attacks on you!
You land [ 5 of 6 ] attacks on a wolfen pup: MUTILATING (586) damage!!
A wolfen pup falls to the ground! He is dead!
You receive 1,484,875 (+186,915 learn, +76,617 rp) exp.
You get a pile of 67,602 gold.
[Lag: 1000] [Align: -1000] [ 68634652 ] [Reply: ]
[H:29833/32967] [M:100/100] [S:7046/7166] [E:20291/21970]0
176
east
Ancient Ruins [ exits: north east south west ]
This shadow ape stares at you with blood red eyes.
[ 2 ] a corpse of a lesser golem
a corpse of a wolfen berzerker
a corpse of a wolfen pup
a corpse of a wolfen warrior
[Lag: 0] [Align: -1000] [ 68634652 ] [Reply: ]
[H:29833/32967] [M:100/100] [S:7046/7166] [E:20288/21970]0
176
0
176
0
176
vici fis ape
The power of your dextrous hands EVISCERATES (2288) a shadow ape!!
You land [ 12 of 13 ] attacks on a shadow ape: RUPTURING (462) damage!
[Lag: 4000] [Sheykh: (perfect condition)] [shadow ape: (badly wounded)]
[h:29833/32967] [m:100/100] [s:7046/7166] [e:20246/21970]
A shadow ape lands [ 1 of 11 ] attacks on you: tickling (1) damage.
You land [ 10 of 12 ] attacks on a shadow ape: MUTILATING (558) damage!!
[Lag: 4000] [Sheykh: (perfect condition)] [shadow ape: (mortally wounded)]
[h:29832/32967] [m:100/100] [s:7046/7166] [e:20246/21970]
A shadow ape misses [ 12 ] attacks on you!
You land [ 2 of 2 ] attacks on a shadow ape: SUNDERING (1660) damage!!
A shadow ape falls to the ground! He is dead!
You receive 2,029,730 (+252,303 learn, +103,862 rp) exp.
You get a pile of 122,266 gold.
[Lag: 1000] [Align: -1000] [ 71074239 ] [Reply: ]
[H:29832/32967] [M:100/100] [S:7046/7166] [E:20246/21970]0
176
east
(6) corpses withers into dust.
Timer now at 60 secs.
[Lag: 797] [Align: -1000] [ 71074239 ] [Reply: ]
[H:31480/32967] [M:100/100] [S:7166/7166] [E:21344/21970]
Ancient Ruins [ exits: north east south west ]
This shadow ape stares at you with blood red eyes.
[Lag: 0] [Align: -1000] [ 71074239 ] [Reply: ]
[H:31480/32967] [M:100/100] [S:7166/7166] [E:21337/21970]vici fis ape
A twirling hammer flies in from the west!
A holy hammer inflicts ERADICATING (33754) damage on a shadow ape!!
A shadow ape falls to the ground! He is dead!
You dive out of the way of a hammer but still get hit with OBLITERATING (5891) damage!!
A twirling hammer flies east!
A twirling hammer flies in from the east!
You dive out of the way of a hammer but still get hit with OBLITERATING (5145) damage!!
A twirling hammer flies west!
There is no one here by that name.
[Lag: 0] [Align: -1000] [ 71339103 ] [Reply: ]
[H:20444/32967] [M:100/100] [S:7166/7166] [E:21337/21970]10
179
invoke 'med heal'
invoke 'med heal'
invoke 'med heal'
invoke 'med heal'
invoke 'med heal'
invoke 'med heal'
invoke 'med heal'
invoke 'med heal'
invoke 'med heal'
invoke 'med heal'
You assemble the incantation of, 'lgjoeaeo gcgamobk.'
You enter a state of deep meditation.
[Lag: 12000] [Align: -1000] [ 71339103 ] [Reply: ]
[H:21347/32967] [M:100/100] [S:7126/7166] [E:21788/21970]
You assemble the incantation of, 'lgjoeaeo gcgamobk.'
You enter a state of deep meditation. |
here is some of the code (pretty much variables are null at this point):
Code: |
<alias name="healme" id="282">
<value>#if (@nocast = 0) {
$PossibleHeals = 0
$NeededHeals = 0
#if (@autoheal = 1) {
#if (@hit_cur <= @hit_min) {
#var autoheal 10
$NeededHeals = (@hit_min - @hit_cur) / 903; #echo $NeededHeals
$PossibleHeals = @spi_cur / 40;#echo $PossibleHeals
#loop %min( $NeededHeals, $PossibleHeals) {heal;#window debugwindow ~-~-~-~- HEALED ~-~-~-~-}
}
}
}</value>
</alias> |
Code: |
<alias name="act" id="55">
<value>#if (@autoregen = 10) {#var autoregen 1};#if (@autoheal = 10) {#var autoheal 1}
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
}
}
}
}</value>
</alias> |
sorry if this is a bit long, i'm kinda starting over from scratch (tend to lose it, if you don't use it... in this case at least). any help is GREATLY appreciated, as my runs are a lil jacked, as you can see. heh. TIA!!!!!! |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Wed Dec 16, 2009 3:34 pm |
It looks like you changed the alias "healme". Now you have the #window debug command within the loop, as you undoubtedly had originally intended. Did you actually change the code, or did your earlier posting not match the actual code in your session?
In any case, it looks to me like this worked correctly. It determined that you needed 10 heals, and it cast 10 heals. If it is casting the correct number of heals, this may not be your problem.
I do see a different potential problem. The alias 'act' calls itself, and as far as I can tell, it does not put itself into a new thread. Double check me guys, am I right that this is not creating new threads?
If this is the case, here is what is happening. You start 'act', and _before it is finished_ it will execute the alias 'act'. This one will eventually also execute the alias 'act, and so on. The first 'act' never finishes, and you end up with dozens of layers of 'act'. I'm not sure, but perhaps this would eventually result in the infinite loop error, since you eventually get too many layers deep. |
|
|
|
shaun.murray Magician
Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: Wed Dec 16, 2009 3:40 pm |
so basically the infinite loop is the act alias, and not the healme alias? that's a lil odd that its reporting it wrongly. eitherway... heh. i'm actually going thru that alias (and my whole core atm to be honest) and trying to clean everything up. i'll keep posting my results as i come across them to correct this.
as far as changing the healme alias, the only change i made, is putting that output inside the brackets, and adding an output of the temp variables to see what all is going on. other then that, no logic change... |
|
|
|
shaun.murray Magician
Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: Wed Dec 16, 2009 4:09 pm |
as far as the alias act calling itself, it only does that to initiate the move alias. and it can only do it if its unlocked (the @act_lock variable check that i put in there). right?
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Wed Dec 16, 2009 9:34 pm |
I haven't completely figured out your program logic, but I believe the way it is written, it is possible for the following situation to occur:
Code: |
Execute 'act':
Stuff happens
Execute 'act':
Stuff happens
Execute 'act':
Stuff happens
Execute 'act':
etc.
|
In the above situation, none of the 'act' aliases can finish until the ones beneath it finish. You end up with 'act' calling itself over and over and the first act won't finish until all the others do first. There is a limit to how many levels deep you can keep doing this. If you go too deep, Cmud will give an error, I'm not sure what kind. It may be the 'infinite loop error', because it looks like it keeps calling the same function over and over in a loop. I can't tell offhand whether you have put in any limitation on how deep this recursion can go.
Actually, looking at it a bit closer, it looks like the recursion should not normally go more than one level deep. As you said, 'act' can only call itself if @act_lock equals 0, and shortly before executing 'act' the alias sets @act_lock to 1. Still, having a script call itself without putting it in a new thread is somewhat dangerous, to be done cautiously and with controls to make sure it doesn't go too far into the recursion I describe above. |
|
|
|
|
|
|
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
|
|