Page 1 of 1

Recast-spell after cast.

Posted: 2004-08-12 23:49:17
by Biba
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.

Posted: 2004-08-13 03:16:17
by Thdin
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 seconds :) Nothing is perfect.

Posted: 2004-08-13 13:20:16
by Biba
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 seconds :) Nothing is perfect.

Still based on pause , but i try that, if someone have another macro i will invite it here. Thx for patience.

Posted: 2004-08-15 21:56:54
by Biba
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 seconds :) Nothing is perfect.

Yoko doesnt know command Timeup, then i cant run that macro.

Posted: 2004-08-18 04:28:15
by Drakull
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

Posted: 2004-08-18 07:09:31
by Thdin
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 :P 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...

Posted: 2004-08-18 07:11:31
by Thdin
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...

Posted: 2004-08-18 09:23:07
by Drakull
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


Posted: 2004-08-18 11:20:04
by Biba
I thank u all, but any 1 script doesnt work exception in parser or somehow. I want to try it with Lightning and Flamestrike, bud i dont know too much spell scripts, only craft (you put).

Posted: 2004-08-18 17:46:32
by Thdin
OH I get it. Manabefore is the ORIGINAL mana and UO.Mana will be less after cast... RIGHT :P Sorry