Page 1 of 1

problem with druid antidote

Posted: Tue Oct 04, 2016 7:44 pm
by beanybabe
I use these lines of code, but keep getting error of it trying to cast druid antidote on class combinations that do not include druid like warrior/mage anyone know why?

Code: Select all

 <skill name="DRUID_ANTIDOTE" hotkey="MACRO" priority="30" autouse="false" />
	
        if (player.Class1 or player.Class2 == CLASS_DRUID) and (not player:hasBuff("Corrosion")) then	
		player:cast("DRUID_ANTIDOTE")
	end

Re: problem with druid antidote

Posted: Wed Oct 05, 2016 11:57 am
by beanybabe
x

Re: problem with druid antidote

Posted: Wed Oct 05, 2016 11:11 pm
by beanybabe
I think I figured what may be happening. If running more than one rom client and you put bot on second char loaded and you have countplayers() it causes the error. here is the code i think that causing it.

if someone comes near it should sound an alarm but it is causing the bot to crash and giving error in profile for antidote instead

Code: Select all

	while ((CountPlayers()) and (CountPlayers(nil,true, true) > 0)) do
		if (player.Class1 or player.Class2 == CLASS_DRUID) and (not player:hasBuff("Corrosion")) then	
			player:cast("DRUID_ANTIDOTE")
		end
		if (player.Class1 == CLASS_ROGUE) and (not player:hasBuff("500675")) and shouldhide == "true" then
			player:cast("ROGUE_HIDE");
		end  
		yrest(200)
		playalarm()
		print("1 or more players found. Don't bot. Wait")
		rest(10000);
	end;	

Re: problem with druid antidote

Posted: Fri Oct 07, 2016 10:30 am
by kenzu38
Nah, the problem is with your code. Not with countplayers.

Code: Select all

if (player.Class1 or player.Class2 == CLASS_DRUID) and (not player:hasBuff("Corrosion")) then
Every class combo or even without a combo will fulfill your condition since all of them have player.Class1.

It should be written like this:

Code: Select all

if (player.Class1 == CLASS_DRUID or player.Class2 == CLASS_DRUID) and (not player:hasBuff("Corrosion")) then

Re: problem with druid antidote

Posted: Fri Oct 07, 2016 3:07 pm
by beanybabe
Thank you that has been acting up for over a year.
I used that bit of code in many places I am surprised it did not cause a lot more problems. I must have cut and paste it wrong one time then kept copying it. the other classes have the correct code somehow I miss copied that druid segment.