PDA

View Full Version : Casting custom spells with various cooldowns



drame
04-29-2016, 05:57 PM
Hello,

We all know how strike spell work, and it is handled by magic shooter. When exori max xxx is on cooldown then it is casting normal version instead or gran and so on.

Lets say that there are 3 new spells, and they don't show their cooldown so magic shooter can't read it properly and make right move ending up spamming and eventually puffing one of them.

So if I have 3 attack spells (group cooldown 1s), spellA - 8s, spellB - 4s, spellC - 1s
how would I have to write script so it would cast each one of them properly? Like spellA then spellB then spam spellC untill one of the other ones go off cooldown and repeat this?

I will be grateful for any kind of help.
Best regards.

yompa93
04-29-2016, 11:48 PM
something like this maybe :confused:




SpellA = "SpellA"
SpellB = "SpellB"
SpellC = "SpellC"

----------------------------------------------------------------
LastCastA = 0
LastCastB = 0
LastCastC = 0
Module.New('AttackSpells', function(module)
if Self.Mana() > 200 and os.time() - LastCastA >= 8 then
Self.Cast(SpellA)
LastCastA = os.time()
wait(2000)
elseif Self.Mana() > 150 and os.time() - LastCastB >= 4 then
Self.Cast(SpellB)
LastCastB = os.time()
wait(2000)
elseif Self.Mana() > 100 and os.time() - LastCastC >= 2 then
Self.Cast(SpellC)
LastCastC = os.time()
wait(2000)
end
end)

The cooldown between attacks are about 3 seconds if i'm not mistaken, if it's lower just change wait(3000) to whatever it is so you're not spamming the spells

EDIT:
The cd between attacks are 2 secs, edited the script.

arllei12
07-31-2016, 11:02 PM
this system really worked for me, but I wanted to do a combination with magic attack and runes, and also only perform the sequence if there is a target and reset the sequence to each new target, is it possible?

shadowart
08-01-2016, 11:29 AM
What you're looking for is going to take a few hundred lines of code and a lot of debugging (which can only really be done on your weird OT). The number people on these forums who can write it in the first place is not too high and if you do find one willing to do it I expect that you would have to pay significantly more than what the most expensive hunting scripts cost.

arllei12
08-01-2016, 02:02 PM
ot that game launcher 5 Sec on target, and in the meantime have to use SD, then that's the combo of it >> DOT> SD> DOT ...

shadowart
08-01-2016, 04:33 PM
Just an SD shooter is way easier than a general rune shooter. You might have better luck with that.

arllei12
08-01-2016, 05:23 PM
then how do I get it?

arllei12
08-01-2016, 11:19 PM
What you're looking for is going to take a few hundred lines of code and a lot of debugging (which can only really be done on your weird OT). The number people on these forums who can write it in the first place is not too high and if you do find one willing to do it I expect that you would have to pay significantly more than what the most expensive hunting scripts cost.


After 2 hours trying I managed to do the script, it took exactly 6 lines and not hundreds as you speak (and looks that I have no knowledge with any programming language). So I'm one single issue (as OTserv does not affect much), I not getting to turn this "Self.UseItemWithTarget (3155)" in atack magic. this code line so will use the sd if you target but could not put it to use magic when you have to target. If you can help fix I thank you.