Jump to content

Recommended Posts

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

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. 

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

 

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?

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

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