problem with druid antidote

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
beanybabe
Posts: 647
Joined: Wed Mar 06, 2013 1:27 am

problem with druid antidote

#1 Post by beanybabe » Tue Oct 04, 2016 7:44 pm

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

User avatar
beanybabe
Posts: 647
Joined: Wed Mar 06, 2013 1:27 am

Re: problem with druid antidote

#2 Post by beanybabe » Wed Oct 05, 2016 11:57 am

x

User avatar
beanybabe
Posts: 647
Joined: Wed Mar 06, 2013 1:27 am

Re: problem with druid antidote

#3 Post by beanybabe » Wed Oct 05, 2016 11:11 pm

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;	

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: problem with druid antidote

#4 Post by kenzu38 » Fri Oct 07, 2016 10:30 am

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

User avatar
beanybabe
Posts: 647
Joined: Wed Mar 06, 2013 1:27 am

Re: problem with druid antidote

#5 Post by beanybabe » Fri Oct 07, 2016 3:07 pm

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.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 27 guests