Nidht wrote:
Why timeup > 800? Lightning isn't necessarily 0.8 seconds to cast. It takes longer on the server I play.
I think it should be:
VAR timeup,timetocast = (whatever time it takes to cast)
And by putting "manabefore > uo.mana" it will do absolutely nothing...
In fact you are partly right on something: it shouldn't be timeup > 800 but having another variable timeincrease or something like that set to 0 each time is cast and raising the 50. Then the comparison would be timeincrease > timeup. About manabefore > uo.mana it does something: when you cast a spell you use mana, so your mana will decrease. If your mana level is lower than your mana before trying to cast the spell you've sucessfully casted the spell (if for whatever reason it goes faster than what you expected with your time maximum). Also depends on how fast your mana is recovered, that's why I keep the maximum time for casting.
the corrected code should be something like this:
Code:
sub Lightningstrike()
var timeup = 3000
var timecast = 0
var manabefore = 0
while (not uo.Injournal('MYCASTINGSTOP'))
uo.deletejournal()
timecast = 0
manabefore = uo.mana
uo.cast('Lightning','lasttarget')
repeat
wait (50)
timecast = timecast + 50
until (uo.Injournal("fizzle") or (timecast > timeup) or (manabefore > uo.mana)
wend
end sub