Page 1 of 1

Guild Castle "Working" buff

Posted: Mon Oct 25, 2010 1:20 pm
by S3v3n11
Tried to use the code below but does not seem to work. Anyone know how to check to see if a playing is currently "farming" in the castle?

Code: Select all

	local target = player:getTarget();
    target:updateBuffs();
    local bool = target:hasBuff("Working");
	 if( bool == true ) then
             printf ( os.date() .. ":has buff.\n");
     else
            printf ( os.date() .. ":Does not have buff.\n");
     end
	 yrest(2000*1);

Re: Guild Castle "Working" buff

Posted: Mon Oct 25, 2010 1:48 pm
by S3v3n11
This seems to work:

Code: Select all

	local buff=RoMScript("UnitBuff('player',1)");
	 if( buff == "Working" ) then
             printf ( os.date() .. ":has buff.\n");
     else
            printf ( os.date() .. ":Does not have buff.\n");
     end
	 yrest(2000*1);

Re: Guild Castle "Working" buff

Posted: Mon Oct 25, 2010 7:43 pm
by rock5
Your first code checks if your target is working. Your second code checks if your player is working.

As far as I can tell your first code should work to tell you if your target is working. It wont work if you don't have anything targeted.

If you want to use the rombot functions to see if your player is working then try this;

Code: Select all

	if player:hasBuff("Working") then
             printf ( os.date() .. ":has buff.\n");
     else
            printf ( os.date() .. ":Does not have buff.\n");
     end
	 yrest(2000*1);
BTW, you don't need to do updateBuffs() because it is done as part of the hasBuff() function.

Re: Guild Castle "Working" buff

Posted: Mon Oct 25, 2010 9:05 pm
by S3v3n11
Thanks rock!