ryno101
02-09-2012, 03:09 AM
i used yohojos tut for cutting trees, but im having the problem (on other trees like willow that take multiple cuts) after every wait it clicks the tree again is there a way to check and wait till the tree/object has moved or been chopped and how could i implement it to my script? and if i cant find a tree how do i set a random angle to find some without interfering with the terminate script, also theres a problem it wants to drop the inv be4fore it makes the bows and before it has a full inv
also how would i find/pickup say birds nests that are on the ground
this is what i have so far
program Firstwillow;
//{$DEFINE SMART}
{$DEFINE SRL5}
{$i srl/srl.simba}
{$i SPS/sps.simba}
const
SERVER = 0; // Enter "0" to pick a random server.
MEMBERS = True; // Set to True if using a RS-Members account. False if F2P.
SRLStats_Username = ''; // Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
NumbOfPlayers= 1; //How many players are you using
StartPlayer= 0; //Player to start auoting with! (0 means first char)
LoadsPerLogin= 15; //How Many Loads To Do Per Login!
LoadsTotal= 9999; //How Many Total Lods To Do Per Character!
AntiBDrop= True; //False for faster dropping. True for antiban dropping.
Sleepyweepy= 3; //Minutes to wait before logging in again.0 = Disabled.
YDebug= True; //Shows whats happening on the runescape screen in a
//debug window, so you dont have to open/close SMART.
var
TooLong:Integer;
procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];
with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Active := True;
end;
end;
Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;
function ChangeCamera: boolean;
var
i, II, PosNeg:integer;
begin
Case random(2) of
0: PosNeg := 1;
1: PosNeg := -1;
end;
i := Round(rs_GetCompassAngleDegrees/45 - 1);
if i < 0 then i := 0;
if i > 7 then i := 7;
For II := 0 to 4+Random(4) do
begin
if (Length(GetMMDotsOnMS('npc')) > 0) then
begin
Result := true;
exit;
end;
i := i+PosNeg;
if i > 7 then i := 0;
if i < 0 then i := 7;
MakeCompass(inttostr(i*(40+random(6))));
end;
end;
Function CheckAndClick(uptext, option:string; x,y:integer; rclick:boolean) :boolean;
Begin
MMouse(x, y, 5, 5);
if waitUptext (Uptext, 1500+ random (500)) then
Begin
Result:=True;
GetMousePos(x, y);
If RClick then
Mouse(x, y, 0, 0,False);
result:=WaitOption(Option, 2000);
if result Then FFlag(0);
end else
Begin
Mouse(x, y, 0, 0,true);
Wait(100+Random(50));
FFlag(0);
End;
End;
Procedure Antiban;
Begin
Case Random(192) Of
0: HoverSkill('woodcutting', True);
1: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
2: ExamineInv;
3: RandomAngle(1);
4: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
5: HoverSkill('random', True);
End;
End;
Procedure DebugShiftCount;
var
PBox: TBox;
begin
PBox := IntToBox(245, 130, 285, 195);
Writeln(IntToStr(AveragePixelShift(PBox, 250, 500)));
end;
Procedure FailSafe(Reson:String);
Begin
RandomAngle(2)
Players[CurrentPlayer].Loc:=Reson;
Logout;
Stats_Commit;
//progressreport;
Writeln(Reson);
TerminateScript;
End;
function ivycolour: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.47, 0.32);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 2568755, MSX1, MSY1, MSX2, MSY2, 3);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
//function FindObject(var fx, fy: Integer): Boolean;
//var
//: TPointArray;
// ararP: T2DPointArray;
// tmpCTS, i, arL: Integer;
// P: TPoint;
//begin
// tmpCTS := GetColorToleranceSpeed;
// ColorToleranceSpeed(2);
// SetColorSpeed2Modifiers(0.26, 2.36);
// if not(FindColorsTolerance(arP, 2766647, MSX1, MSY1, MSX2, MSY2, 3)) then
// begin
// Writeln('Failed to find the color, no object found.');
// ColorToleranceSpeed(tmpCTS);
// SetColorSpeed2Modifiers(0.2, 0.2);
// Exit;
// end;
// SortTPAFrom(arP, Point(MSCX, MSCY));
// ararP := SplitTPAEx(arP, 10, 10);
// arL := High(ararP);
// for i := 0 to arL do
// begin
// P := MiddleTPA(ararP[i]);
// MMouse(P.x, P.y, 5, 5);
// Wait(100 + Random(100));
// if (IsUpText('Take')) then
// begin;
// Result := True;
// Break;
// end;
// end;
// ColorToleranceSpeed(tmpCTS);
// SetColorSpeed2Modifiers(0.2, 0.2);
// If (i = arL + 1) Then
// Begin
// Writeln('FindObject could not find object.');
// Exit;
// End;
// GetMousePos(fx, fy);
//End;
Function ChopDown:Boolean;
Var
Boo, Bee, PlusOne, TreeCounter, TooLong: Integer;
Begin
FindNormalRandoms;
MarkTime(TooLong);
PlusOne:= InvCount + 1;
Boo:=MSCX
Bee:=MSCY
if findobjtpa( Boo, Bee, IvyColour, 8, 1, 30, 60, 300, ['llow']) Then
writeln('got one');
getmousepos(Boo, Bee);
DebugShiftCount;
Case Random(2) of
0:Mouse(Boo, Bee, 5, 5, True);
1: Begin
mouse(Boo, Bee, 5,5, False);
WaitOption('illow', 7000+Random(450));
End;
End;
Flag;
MarkTime(TreeCounter);
if (TimeFromMark(TooLong) > 10000) then
repeat
if (TimeFromMark(TooLong) > 15000) then
FindNormalRandoms;
StatsGuise('AntiBan and Waiting');
AntiBan;
WaitOption('illow', 11000+Random(450));
MakeCompass(rs_GetCompassAngleDegrees+60+random(10 0));
FailSafe ('could not find willow');
If Invcount=PlusOne Then
Writeln ('We Got One');
Until (InvCount=PlusOne) Or (TimeFromMark(TreeCounter) > 7000)
End;
Procedure DropLogs;
Var
Boo, Bee, LogDTM, I:Integer;
SlotBox:TBox;
LogPattern:TIntegerArray;
Begin
LogDTM := DTMFromString('mrAAAAHic42BgYHBhYmBwBGIvIA4CYlcgNg diEyAOBOInQDW3gfgGEL8E4ndQDBJ/CsQmegJAkgkn5mLADxgJYBgAAPWmCfI=');
LogPattern :=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19, 23,27,4,8,12,16,20,24,28];
For i:=0 to 27 do
Begin
StatsGuise('Dropping Log' + IntToStr(I));
SlotBox:=InvBox(LogPattern[I]);
If FindDTM(LogDTM,Boo,Bee,SlotBox.X1,SlotBox.Y1,SlotB ox.X2,SlotBox.Y2) Then
MMouse (boo, bee, 5, 5);
Begin
MouseItem (LogPattern[I],mouse_Right);
ChooseOption ('rop' );
wait (250 + random (50));
FreeSRLBitmaps;
MarkTime(TooLong);
End;
End;
End;
procedure makebow;
var
Boo, Bee, LogDTM, I:Integer;
SlotBox:TBox;
LogPattern:TIntegerArray;
begin
LogDTM := DTMFromString('mrAAAAHic42BgYHBhYmBwBGIvIA4CYlcgNg diEyAOBOInQDW3gfgGEL8E4ndQDBJ/CsQmegJAkgkn5mLADxgJYBgAAPWmCfI=');
LogPattern :=[1];
For i:=0 to 0 do
begin
If FindDTM(LogDTM,Boo,Bee,SlotBox.X1,SlotBox.Y1, SlotBox.X2,SlotBox.Y2) Then
MMouse (boo, bee, 5, 5);
SlotBox:=InvBox(LogPattern[I]);
MouseItem (LogPattern[I],mouse_Left);
mmouse(292,429,20,20);
wait (500 + random (150));
clickmouse(292,429,1);
wait (500 + random (150));
mmouse(257,425,25,25);
clickmouse(257,425,1);
wait(53000 + random (1000));
end;
end;
Begin
SetupSRL;
DeclarePlayers;
Repeat
ChopDown;
DebugShiftCount;
if invFull then
makebow;
DropLogs;
wait (7500 + random (150));
Until(False);
End.
its a bit messy since im experimenting with random things atm
also how would i find/pickup say birds nests that are on the ground
this is what i have so far
program Firstwillow;
//{$DEFINE SMART}
{$DEFINE SRL5}
{$i srl/srl.simba}
{$i SPS/sps.simba}
const
SERVER = 0; // Enter "0" to pick a random server.
MEMBERS = True; // Set to True if using a RS-Members account. False if F2P.
SRLStats_Username = ''; // Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
NumbOfPlayers= 1; //How many players are you using
StartPlayer= 0; //Player to start auoting with! (0 means first char)
LoadsPerLogin= 15; //How Many Loads To Do Per Login!
LoadsTotal= 9999; //How Many Total Lods To Do Per Character!
AntiBDrop= True; //False for faster dropping. True for antiban dropping.
Sleepyweepy= 3; //Minutes to wait before logging in again.0 = Disabled.
YDebug= True; //Shows whats happening on the runescape screen in a
//debug window, so you dont have to open/close SMART.
var
TooLong:Integer;
procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];
with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Active := True;
end;
end;
Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;
function ChangeCamera: boolean;
var
i, II, PosNeg:integer;
begin
Case random(2) of
0: PosNeg := 1;
1: PosNeg := -1;
end;
i := Round(rs_GetCompassAngleDegrees/45 - 1);
if i < 0 then i := 0;
if i > 7 then i := 7;
For II := 0 to 4+Random(4) do
begin
if (Length(GetMMDotsOnMS('npc')) > 0) then
begin
Result := true;
exit;
end;
i := i+PosNeg;
if i > 7 then i := 0;
if i < 0 then i := 7;
MakeCompass(inttostr(i*(40+random(6))));
end;
end;
Function CheckAndClick(uptext, option:string; x,y:integer; rclick:boolean) :boolean;
Begin
MMouse(x, y, 5, 5);
if waitUptext (Uptext, 1500+ random (500)) then
Begin
Result:=True;
GetMousePos(x, y);
If RClick then
Mouse(x, y, 0, 0,False);
result:=WaitOption(Option, 2000);
if result Then FFlag(0);
end else
Begin
Mouse(x, y, 0, 0,true);
Wait(100+Random(50));
FFlag(0);
End;
End;
Procedure Antiban;
Begin
Case Random(192) Of
0: HoverSkill('woodcutting', True);
1: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
2: ExamineInv;
3: RandomAngle(1);
4: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
5: HoverSkill('random', True);
End;
End;
Procedure DebugShiftCount;
var
PBox: TBox;
begin
PBox := IntToBox(245, 130, 285, 195);
Writeln(IntToStr(AveragePixelShift(PBox, 250, 500)));
end;
Procedure FailSafe(Reson:String);
Begin
RandomAngle(2)
Players[CurrentPlayer].Loc:=Reson;
Logout;
Stats_Commit;
//progressreport;
Writeln(Reson);
TerminateScript;
End;
function ivycolour: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.47, 0.32);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 2568755, MSX1, MSY1, MSX2, MSY2, 3);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
//function FindObject(var fx, fy: Integer): Boolean;
//var
//: TPointArray;
// ararP: T2DPointArray;
// tmpCTS, i, arL: Integer;
// P: TPoint;
//begin
// tmpCTS := GetColorToleranceSpeed;
// ColorToleranceSpeed(2);
// SetColorSpeed2Modifiers(0.26, 2.36);
// if not(FindColorsTolerance(arP, 2766647, MSX1, MSY1, MSX2, MSY2, 3)) then
// begin
// Writeln('Failed to find the color, no object found.');
// ColorToleranceSpeed(tmpCTS);
// SetColorSpeed2Modifiers(0.2, 0.2);
// Exit;
// end;
// SortTPAFrom(arP, Point(MSCX, MSCY));
// ararP := SplitTPAEx(arP, 10, 10);
// arL := High(ararP);
// for i := 0 to arL do
// begin
// P := MiddleTPA(ararP[i]);
// MMouse(P.x, P.y, 5, 5);
// Wait(100 + Random(100));
// if (IsUpText('Take')) then
// begin;
// Result := True;
// Break;
// end;
// end;
// ColorToleranceSpeed(tmpCTS);
// SetColorSpeed2Modifiers(0.2, 0.2);
// If (i = arL + 1) Then
// Begin
// Writeln('FindObject could not find object.');
// Exit;
// End;
// GetMousePos(fx, fy);
//End;
Function ChopDown:Boolean;
Var
Boo, Bee, PlusOne, TreeCounter, TooLong: Integer;
Begin
FindNormalRandoms;
MarkTime(TooLong);
PlusOne:= InvCount + 1;
Boo:=MSCX
Bee:=MSCY
if findobjtpa( Boo, Bee, IvyColour, 8, 1, 30, 60, 300, ['llow']) Then
writeln('got one');
getmousepos(Boo, Bee);
DebugShiftCount;
Case Random(2) of
0:Mouse(Boo, Bee, 5, 5, True);
1: Begin
mouse(Boo, Bee, 5,5, False);
WaitOption('illow', 7000+Random(450));
End;
End;
Flag;
MarkTime(TreeCounter);
if (TimeFromMark(TooLong) > 10000) then
repeat
if (TimeFromMark(TooLong) > 15000) then
FindNormalRandoms;
StatsGuise('AntiBan and Waiting');
AntiBan;
WaitOption('illow', 11000+Random(450));
MakeCompass(rs_GetCompassAngleDegrees+60+random(10 0));
FailSafe ('could not find willow');
If Invcount=PlusOne Then
Writeln ('We Got One');
Until (InvCount=PlusOne) Or (TimeFromMark(TreeCounter) > 7000)
End;
Procedure DropLogs;
Var
Boo, Bee, LogDTM, I:Integer;
SlotBox:TBox;
LogPattern:TIntegerArray;
Begin
LogDTM := DTMFromString('mrAAAAHic42BgYHBhYmBwBGIvIA4CYlcgNg diEyAOBOInQDW3gfgGEL8E4ndQDBJ/CsQmegJAkgkn5mLADxgJYBgAAPWmCfI=');
LogPattern :=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19, 23,27,4,8,12,16,20,24,28];
For i:=0 to 27 do
Begin
StatsGuise('Dropping Log' + IntToStr(I));
SlotBox:=InvBox(LogPattern[I]);
If FindDTM(LogDTM,Boo,Bee,SlotBox.X1,SlotBox.Y1,SlotB ox.X2,SlotBox.Y2) Then
MMouse (boo, bee, 5, 5);
Begin
MouseItem (LogPattern[I],mouse_Right);
ChooseOption ('rop' );
wait (250 + random (50));
FreeSRLBitmaps;
MarkTime(TooLong);
End;
End;
End;
procedure makebow;
var
Boo, Bee, LogDTM, I:Integer;
SlotBox:TBox;
LogPattern:TIntegerArray;
begin
LogDTM := DTMFromString('mrAAAAHic42BgYHBhYmBwBGIvIA4CYlcgNg diEyAOBOInQDW3gfgGEL8E4ndQDBJ/CsQmegJAkgkn5mLADxgJYBgAAPWmCfI=');
LogPattern :=[1];
For i:=0 to 0 do
begin
If FindDTM(LogDTM,Boo,Bee,SlotBox.X1,SlotBox.Y1, SlotBox.X2,SlotBox.Y2) Then
MMouse (boo, bee, 5, 5);
SlotBox:=InvBox(LogPattern[I]);
MouseItem (LogPattern[I],mouse_Left);
mmouse(292,429,20,20);
wait (500 + random (150));
clickmouse(292,429,1);
wait (500 + random (150));
mmouse(257,425,25,25);
clickmouse(257,425,1);
wait(53000 + random (1000));
end;
end;
Begin
SetupSRL;
DeclarePlayers;
Repeat
ChopDown;
DebugShiftCount;
if invFull then
makebow;
DropLogs;
wait (7500 + random (150));
Until(False);
End.
its a bit messy since im experimenting with random things atm