Jump to content

Vampiric Touch cast twice


dvdood

Recommended Posts

Even if i set condition same as for shadow ward: pain     (buff / buff casted by me false) it sometimes casts twice in a row and thats quite a bit of mana wasted. Can i somehow prevent that. 

Link to comment
Share on other sites

I am already using your fight class, modified for my needs :) I tried right now without modifications but same thing happens, vampiric touch sometimes is cast twice in a row for no reason :/

Link to comment
Share on other sites

There is a reason. The reason is the dot is appearing on the target after the cast is done. And the checking is done before the dot is on the target. So for example during the casting the button of the spell will be 'pushed' second time because the dot is not on the target yet. You need to make a delay to try to cast spell only after one second or more ? :) There is a solution an was done very very long ago in lua unlockers time.

 

public bool canImmolate()
    {
        int canImmolate = Lua.LuaDoString<int>(@"
			vImmolate=0
			local i=1 while(i<=40)do 
			   local a={UnitDebuff(""target"",i)}; -- Get the debuff's info
			   if a[8]==""player"" then 
				  if a[1]==""Immolate"" then vImmolate=a[7]-GetTime() 
				  end 
			   end
			   i=i+1 
			end
			if vUAflag==nil then vUAflag=0 end; 
			if ({UnitCastingInfo(""player"")})[1]==""Immolate"" and vUAts==nil then 
			   vUAflag=1 vUAts=GetTime() 
			end;
			if vUAflag==1 and GetTime()-vUAts>2 then 
			   vUAflag=0 vUAts=nil 
			end
			spell = 0
			if vUAflag==0 and vImmolate<1 then spell = 1 end", "spell");

        if (canImmolate == 1) return true;
        return false;
    }

Immolate example ( it's working with c# rotation for me ) in sense if (canImmolate()) - cast immolate etc. Of course the problem is with all 'dot's with cast time'. Other bots have something like preventDoubleCast procedure but this is not here ;)

Link to comment
Share on other sites

1 hour ago, dvdood said:

I am already using your fight class, modified for my needs :) I tried right now without modifications but same thing happens, vampiric touch sometimes is cast twice in a row for no reason :/

Oh, sorry for the issue with it then :( . I think the best way to fix this is to actually do it in c# or use lua. Like @forerun said, the bot starts casting again because it has not detected that the target has the buff yet. Alternatively, there may be a wait to add a wait time of preventing it from being casting successfully more than once every x seconds in the Not spell is C# code part of the Spell Settings. I do not have a code example of this, though. Or even.. ..  add a Thread.Sleep(250) right after the spell is casted. 

Link to comment
Share on other sites

Im not very bright in these things, "inside lua in fight class editor"  not sure how to check inside lua, i load fight class and then what :D

or where to add Thread.Sleep(250)

Link to comment
Share on other sites

  • 4 months later...

Sorry for bumping, but I was looking for the solution of this problem so I reply here instead of opening another topic.

The problem with double cast happens to me too, not everytime but let's say 50% of times. I don't know if this can be avoided with changing the fps of the fight class, or other settings. So as other users said (and on other similar topics too), you can implement some C# code to prevent the double cast. But if you don't know about C# code (like me), you can use this simple lua script

1) Spell Name:

  • SpellStopCasting()

2) Conditions:

  • LUA script: Lua Script
stop = "no"
if UnitCastingInfo("player") == "Vampiric Touch"
then
stop = "yes"
end

            Return Value Research: yes
            Return Value Var: stop

  • Target Buff Casted By Me: Vampiric Touch (true)

3) Set on top right corner:

  • Not Spell, is Lua script: true


Put the spell with an higher priority than Vampiric Touch and you're done.

Tested and working. Greetings.

 

Link to comment
Share on other sites

On 2018-01-05 at 9:50 PM, scripterx said:

Sorry for bumping, but I was looking for the solution of this problem so I reply here instead of opening another topic.

The problem with double cast happens to me too, not everytime but let's say 50% of times. I don't know if this can be avoided with changing the fps of the fight class, or other settings. So as other users said (and on other similar topics too), you can implement some C# code to prevent the double cast. But if you don't know about C# code (like me), you can use this simple lua script

1) Spell Name:

  • SpellStopCasting()

2) Conditions:

  • LUA script: Lua Script

stop = "no"
if UnitCastingInfo("player") == "Vampiric Touch"
then
stop = "yes"
end

            Return Value Research: yes
            Return Value Var: stop

  • Target Buff Casted By Me: Vampiric Touch (true)

3) Set on top right corner:

  • Not Spell, is Lua script: true


Put the spell with an higher priority than Vampiric Touch and you're done.

Tested and working. Greetings.

 

Hello,
I am sorry to say that I did not make this to work. 
My bot still applies Vampiric Touch twice. 

I am however playing on 2.4.3 if that does any difference?

Link to comment
Share on other sites

11 hours ago, leogetz said:

Hello,
I am sorry to say that I did not make this to work. 
My bot still applies Vampiric Touch twice. 

I am however playing on 2.4.3 if that does any difference?

If your using the FC editor, just put a 3 second CD on the spell.

Sometimes wrobot takes .5 second to refresh debuffs on the target (clients/ server delay).. so if Vampiric Touch has the ability to be chain cast it may be casting it again because it hasnt refreshed the target buffs yet.

I still use iftargethsbuff- however i put a 2-3 sec CD on the DoT spell to avoid the double cast.

Edited by eeny
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...