!@#%! I know this has got to be something stupid..
Posted: Tue Jun 01, 2004 1:58 am
I have looked over this god damn code 5,000,000,000,000,000,000 times and cannot figure out what in the HELL is wrong with it, the exact same code was working a few nights before just being called from a diffrent mac
I know this code is probably not very clean and could be made much more efficiant, but its what I've come up with so far from looking at example's and surfing around for answers, I'd use a movetomob out of like hunter or something, but it goes to melee range, and im a caster so i need to keep my distance to send pet.. so just a little help on what in the fucking hell is up with this code would be much appreciated.
Oh yes, the error it puts out is: Calculate encountered a bad - formation, then spews out
As the problem causing code.
Code: Select all
sub MoveToMob(Distancetomob)
/if (${Target.Distance}<${Distancetomob}) {
/face fast
/return
}
:Movementloop
/if (${Me.Speed}==0) {
/keypress up hold
}
/varcalc ObstCount ${ObstCount}+1
/if (${Bool[${Target}]}==0) {
/keypress up
/return
}
/face fast
/if (${Target.Distance}<${Distancetomob}) {
/face fast
/keypress up
/return
}
/if (${ObstCount}>=3) {
/delay 5
/call CheckObst
/goto :Movementloop
}
/if (${Target.Distance}>${Distancetomob}) /goto :MovementLoop
/return
Sub CheckObst
/if (${Math.Calc[${Math.Calc[${Math.Calc[${Math.Calc[${Me.Y}-${MyYLoc}]}^2]}+${Math.Calc[${Math.Calc[${MyXLoc}-${Me.X}]}^2]}]}^.5]}<2) /call Hitobst 5
/varset MyXLoc ${Me.X}
/varset MyYLoc ${Me.Y}
/return
Sub Hitobst(Delayofturn)
/keypress up
/keypress down hold
/if (${Math.Rand[100]}>50) {
/Delay 1s
/keypress down
/keypress Right hold
/Delay ${Delayofturn}
/keypress Right
/keypress up hold
/Delay 1s
/keypress up
} else {
/Delay 1s
/keypress down
/keypress left hold
/Delay ${Delayofturn}
/keypress left
/keypress up hold
/Delay 1s
/keypress up
}
:speedstop
/if (${Me.Speed}!=0) /goto :speedstop
/return
Oh yes, the error it puts out is: Calculate encountered a bad - formation, then spews out
Code: Select all
/if (${Math.Calc[${Math.Calc[${Math.Calc[${Math.Calc[${Me.Y}-${MyYLoc}]}^2]}+${Math.Calc[${Math.Calc[${MyXLoc}-${Me.X}]}^2]}]}^.5]}<2) /call Hitobst 5