hedfun2
2013-06-07 16:22:56
I want a boolean or something that says when chopping do this. How would I make this?
2013-06-07 16:22:56
2013-06-07 16:43:23
2013-06-07 16:45:23
2013-06-07 16:54:06
From: denart5The problem with that is is that the times always vary, so you'll get false negative.
You could make the time between clicking the tree and a log added to your inv as isChopping and then just if(isChopping) then (…)
2013-06-07 17:17:13
2013-06-07 17:18:04
From: Rich
The problem with that is is that the times always vary, so you'll get false negative.
@OP, I'd definitely follow BMWxi's advice :)
2013-06-07 17:33:28
From: denart5What about when the tree has been cut? It would return true because it would be waiting for a log to be added, but that wouldn't happen because there's no tree.
Yes the time varies but I mean that it returns true untill the log is added to the inv.
2013-06-07 17:41:27
From: Rich
What about when the tree has been cut? It would return true because it would be waiting for a log to be added, but that wouldn't happen because there's no tree.
2013-06-09 21:44:49
2013-06-12 14:18:31
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;
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;
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;