Yoko
http://forum.yoko.com.ua/

Recast-spell after cast.
http://forum.yoko.com.ua/viewtopic.php?f=20&t=1135
Page 1 of 1

Author:  Biba [ 2004-08-12 23:49:17 ]
Post subject:  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.

Author:  Thdin [ 2004-08-13 03:16:17 ]
Post subject: 

Simple.

Code:
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.

Author:  Biba [ 2004-08-13 13:20:16 ]
Post subject: 

Nidht wrote:
Simple.

Code:
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.

Author:  Biba [ 2004-08-15 21:56:54 ]
Post subject: 

Nidht wrote:
Simple.

Code:
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.

Author:  Drakull [ 2004-08-18 04:28:15 ]
Post subject: 

lazy guy...
Code:
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

Author:  Thdin [ 2004-08-18 07:09:31 ]
Post subject: 

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...

Author:  Thdin [ 2004-08-18 07:11:31 ]
Post subject: 

Drakull wrote:
lazy guy...
Code:
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...

Author:  Drakull [ 2004-08-18 09:23:07 ]
Post subject: 

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


Author:  Biba [ 2004-08-18 11:20:04 ]
Post subject: 

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).

Author:  Thdin [ 2004-08-18 17:46:32 ]
Post subject: 

OH I get it. Manabefore is the ORIGINAL mana and UO.Mana will be less after cast... RIGHT :P Sorry

Page 1 of 1 All times are UTC+02:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/