I want a boolean or something that says when chopping do this. How would I make this?
I want a boolean or something that says when chopping do this. How would I make this?
Check out Flight's tutorial on using Pixelshift: http://villavu.com/forum/showthread.php?t=74090![]()
You could make the time between clicking the tree and a log added to your inv as isChopping and then just if(isChopping) then (...)
If it is EOC, you could count the xp bar total, have a wait, and if it gains xp in that amount of time, it returns a true. if not, it returns a false. I have used this method a few times.
pixelshift is the only way to go, there's an entire include file just for checking if your player is animating.
<TViYH> i had a dream about you again awkwardsaw
Malachi 2:3
An effective method is to like as everyone said use pixelshift. This is function I use:
Simba Code:Function isChopping: Boolean;
var
PBox: TBox;
begin
PBox := IntToBox(MSCX - 20, MSCY - 35, MSCX + 20, MSCY + 10);;
Result := (AveragePixelShift(PBox, 250, 500) > 90);
Report(true);
SMART_DrawBoxEx(false, false, PBox, clRed);
//writeln(IntToStr(AveragePixelShift(PBox, 250, 500)));
end;
Directly jacked from INeedBot's AIOChopper.
There HAVE been false positives caused by people around you, but for the most part is a effective and reliable.
Another method off the top of my head is to click the tree and while having your cursor over the tree wait for the uptext to change. When the uptext disappears it means the tree has been cut down.
The only issue to this is how you are going to get your cursor over the tree. If you click it from a few squares away, the position of the tree on the page changes and it may come out from under the cursor. You could then use say findobj to find it, but if there are multiple trees then it may move the cursor over the wrong one.
A combination of both methods can be utilized for damn near 100% accuracy.
If you are working on a magic tree chopper, you may need to teach your cursor to move slightly every 3 minutes to prevent being logged out. Only if you are in one of the few areas without several other people.
<Offtopic>
I am assuming you are making a woodcutter so I am going to post my ent detection code here for you.
The Function
Simba Code:Procedure FindEnt;
begin
if (not (IsUpText('hop'))) then
begin
writeln ('Error: Cursor must be on the tree!');
Exit;
end;
if (CountColorTolerance(65535,82, 5, 110, 23, 55) > 20) then
begin
writeln ('An ent has been detected, getting off...');
Mmouse(643, 84, 3, 3);
Clickmouse2(mouse_left);
writeln ('Waiting a moment for the ent to go away...');
wait(randomrange(20000,25000));
end;
end;
Function Usage (please don't use findobj. just an example.)
Simba Code:if ((not(isuptext('Mag'))) AND (FindObjCustom (x, y, ['Mag', 'agic'], [6130056, 3692372, 1988429], 3))) then
begin
writeln ('Moving cursor to the active magic tree...');
MMouse(x, y, 3, 3);
end;
FindEnt;
</Offtopic>
Last edited by bob_dole; 06-13-2013 at 01:34 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)