-
S3v3n11
- Posts: 91
- Joined: Thu Jul 09, 2009 7:37 am
#1
Post
by S3v3n11 » Mon Oct 25, 2010 1:20 pm
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);
-
S3v3n11
- Posts: 91
- Joined: Thu Jul 09, 2009 7:37 am
#2
Post
by S3v3n11 » Mon Oct 25, 2010 1:48 pm
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);
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#3
Post
by rock5 » Mon Oct 25, 2010 7:43 pm
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.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:
- “They say hard work never hurt anybody, but I figure, why take the chance.”
Who is online
Users browsing this forum: Ahrefs [Bot] and 4 guests