Littellj
2012-03-31 00:52:56
Need to make my script wait while choping tree. Trying to use IsMoving but it's constantly clicking the tree. Help? =o
Also, Trying to get it to put the angle to high still haven't been able to figure this out :(
I put the WaitRandomRange(5000,10000) to help see if working.
Also, Trying to get it to put the angle to high still haven't been able to figure this out :(
I put the WaitRandomRange(5000,10000) to help see if working.
program ArticPines;
{$DEFINE SRL5}
{$DEFINE SMART}
{$i srl/srl.simba}
var
x, y, i: integer;
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
BoxRewards := ['XP','xp','lamp'];
LampSkill := Skill_Woodcutting;
Active := True;
end;
end;
Function IsMoving_W: Boolean;
begin
Result := PixelShift(IntToBox(MMCX-30, MMCY-30, MMCX+30, MMCY+30), 200) > 10000;
end;
procedure Light;
var
SlotBox:TBox;
DropsPattern: TIntegerArray;
begin
DropsPattern:=[1,2];
For i:=0 to 1 Do
Begin
FindNormalRandoms;
SlotBox:=InvBox(DropsPattern[i]);
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, True);
Wait(20+Random(20));
MoveMouse(X, Y+40);
ClickMouse(X, Y, mouse_Left);
Wait(20+Random(20));
MoveMouse(X, Y+40);
ClickMouse(X, Y, mouse_Left);
Wait(20+Random(20));
MoveMouse(X, Y+40);
ClickMouse(X, Y, mouse_Left);
Wait(20+Random(20));
MoveMouse(X, Y+40);
ClickMouse(X, Y, mouse_Left);
Wait(20+Random(20));
MoveMouse(X, Y+40);
ClickMouse(X, Y, mouse_Left);
Wait(50+Random(20));
End;
End;
function FindTree (Var X,Y: Integer) : boolean;
var
MyTPA : TPointArray;
MyPoint : TPoint;
i : integer;
begin
result := False;
x := MSCx; //need to get color
y := MSCy;
FindColorsSpiralTolerance( x, y, MyTPA, 7371627, MSx1, MSy1, MSx2, MSy2, 10);
if (Length(MyTPA) < 1) then
Exit;
for i:=0 to High(MyTPA)do
begin
MyPoint:= MyTPA[i]
MMouse( MyPoint.x, MyPoint.y, 3, 3);
if WaitUpTextMulti(['hop','rctic'], 400) then
begin
Result := True;
GetMousePos( x, y);
Exit;
end;
end;
//use TPA's
//positions mouse
//check uptext
//GetMousePos( x, y);
end;
function FindTree2 (Var X,Y: Integer) : boolean;
var
MyTPA : TPointArray;
MyPoint : TPoint;
i : integer;
begin
result := False;
//need to get color
x := MSCx;
y := MSCy;
FindColorsSpiralTolerance( x, y, MyTPA, 14147017, MSx1, MSy1, MSx2, MSy2, 10);
if (Length(MyTPA) < 1) then
Exit;
for i:=0 to High(MyTPA)do
begin
MyPoint:= MyTPA[i]
MMouse( MyPoint.x, MyPoint.y, 3, 3);
if WaitUpTextMulti(['hop','rctic'], 400) then
begin
Result := True;
GetMousePos( x, y);
Exit;
end;
end;
//use TPA's
//positions mouse
//check uptext
//GetMousePos( x, y);
end;
procedure chop;
begin
if not LoggedIn then
Exit;
//areacheck
FindNormalRandoms;
if InvFull then
//Light;
MakeCompass(0);
if (FindTree( x, y) or FindTree2( x, y)) then
begin
writeln('Found Tree');
ClickMouse2(True);
While IsMoving_W do
Wait(RandomRange( 5000, 10000));
Wait(RandomRange( 500, 1000));
//Alch
end;
end;
begin
Smart_Server := 86;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetUpSRL();
DeclarePlayers;
LoginPlayer;
LogInPlayer;
SetAngle(0);
MakeCompass(0);
repeat
if not LoggedIn then LoginPlayer;
//areacheck;
chop;
until(AllPlayersInactive)
Logout;
TerminateScript;
end.