Recast-spell after cast.
Moderators: Murderator+, Murderator
Recast-spell after cast.
I have to ask how to automatically recast spell (like lightning) in pvp imediatelly after cast. I think i cant use Journal becose that isnt perfect.
Simple.
The quick Wait in the repeat should work with the journal since it will check every 0.05 seconds
Nothing is perfect.
Code: Select all
sub Lightningstrike()
Lightningcast:
UO.Cast('Lightning','lasttarget')
Repeat
Wait(50)
Until UO.InJournal("fizzle") OR timeup>8000 #(or however long lightning takes to cast on your server)
goto Lightningcast
The quick Wait in the repeat should work with the journal since it will check every 0.05 seconds

Nidht wrote:Simple.Code: Select all
sub Lightningstrike()
Lightningcast:
UO.Cast('Lightning','lasttarget')
Repeat
Wait(50)
Until UO.InJournal("fizzle") OR timeup>8000 #(or however long lightning takes to cast on your server)
goto Lightningcast
The quick Wait in the repeat should work with the journal since it will check every 0.05 secondsNothing is perfect.
Still based on pause , but i try that, if someone have another macro i will invite it here. Thx for patience.
Nidht wrote:Simple.Code: Select all
sub Lightningstrike()
Lightningcast:
UO.Cast('Lightning','lasttarget')
Repeat
Wait(50)
Until UO.InJournal("fizzle") OR timeup>8000 #(or however long lightning takes to cast on your server)
goto Lightningcast
The quick Wait in the repeat should work with the journal since it will check every 0.05 secondsNothing is perfect.
Yoko doesnt know command Timeup, then i cant run that macro.
lazy guy...
Code: Select all
sub Lightningstrike()
var timeup = 3000
var manabefore = 0
while (not uo.Injournal('MYCASTINGSTOP'))
uo.deletejournal()
manabefore = uo.mana
uo.cast('Lightning','lasttarget')
repeat
wait (50)
timeup = timeup + 50
until (uo.Injournal("fizzle") or (timeup > 800) or (manabefore > uo.mana)
wend
end sub
Well, I'd think he would notice that if timeup was a variable that he had to create it..... lol
Sorry, but if I'm not gonna submit the script for mutli-usage or need it myself I'm really lazy
Atleast I typed out the main part of the code so he would know what exactly he needed to do and fix the rest. Unless of course he is new to scripting...
Sorry, but if I'm not gonna submit the script for mutli-usage or need it myself I'm really lazy

Drakull wrote:lazy guy...Code: Select all
sub Lightningstrike()
var timeup = 3000
var manabefore = 0
while (not uo.Injournal('MYCASTINGSTOP'))
uo.deletejournal()
manabefore = uo.mana
uo.cast('Lightning','lasttarget')
repeat
wait (50)
timeup = timeup + 50
until (uo.Injournal("fizzle") or (timeup > 800) or (manabefore > uo.mana)
wend
end sub
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...
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: Select all
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