SRL Archive - First Scripts

TreeCutter Elite


10wnu9

2012-04-29 08:05:30

:garfield: Hey guys, I've finally completed my New First script although It doesn't work properly when dropping :duh:.

So I decided I would post It here and get some help from you guys.


program New;
{$DEFINE SMART}
{$i srl/srl.simba}
{$DEFINE SRL5}

//Run The script anywhere where there is many
//Trees or Oaks, Works anywhere, recommended spot:-
// Lumbridge castle orWest Of Cooking Guild Grand Exchange!


//Any Problems found, Pm Me Or Leave an Issue on
//Thread!



//This Is My very First Script, If You
//Are Using It Please Leave Constructive Critiscism!

Const
World = 103; //May not Work As of Yet.
MEMBERS = True;

Stats_UserID = '';
Stats_Password = '';

AutoUpdate = True;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; // Username?
Players[0].Pass := ''; // Password?
Players[0].Nick := '10w'; // 3 letters of your username (not the first letter)
Players[0].Active := True;
end;

function CheckAndClick(UpText, Option:String; X,Y:Integer;RClick:Boolean) :Boolean;
begin
MMouse(x,y,4,4);
if WaitUptext(Uptext, 1500+Random(500)) then
begin
Result:= True;
GetMousePos(x, y);
if RClick then
begin
Mouse(x, y, 3, 3, False);
Result:= WaitOption(Option,1800);
if Result then
FFlag(0);
end else
begin
Mouse(x, y, 3, 3, True);
Wait(100+Random(50));
FFlag(0);
end;
end;
end;

procedure AntiBan;
begin
if(not(LoggedIn))then
Exit;
FindNormalRandoms;
case Random(2) of
0:
begin
Wait(12000+Random(387));
Gametab(Tab_Stats) Hoverskill ('Random',False);
Wait(305+Random(298));
Gametab(Tab_Inv);
MakeCompass('0');
Wait(400+Random(222));
MakeCompass('Random');
end;
1: PickUpMouse;
2:
begin
MakeCompass('0');
wait(1000+random(700));
FindNormalRandoms;
end;
end;
end;


function TreeColour: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.16, 0.12);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 3557969, MSX1, MSY1, MSX2, MSY2, 5);
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
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 4.65) and (X <= 8.75) and (Y >= 4.89) and (Y <= 9.24) and (Z >= 3.27) and (Z <= 5.90) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;


procedure ChopTree;
var
x, y, PlusOne, TooLong, TreeFindFailsafe, TreeWaitFailsafe: integer;
begin
PlusOne:= InvCount;
x:=MSCX;
y:=MSCY;
MarkTime(TooLong);
MarkTime(TreeFindFailsafe);
repeat
repeat
if FindObjTPA(x, y, TreeColour, 5, 1, 15, 60, 600, ['Cho'])then
begin
case Random(2) of
0: Mouse(x, y, 4, 4, True);
1: begin
Mouse(x, y, 4, 4, False);
WaitOption('Chop', 270);
end;
end;
Flag;
Break;
end;
if (TimeFromMark(TooLong) > 30000) then
MakeCompass('Random');
until(TimeFromMark(TreeFindFailsafe) > 25000);
if (TimeFromMark(TreeFindFailsafe) > 25000) then
begin
writeln('Couldnt find tree');
Logout;
TerminateScript;
end else
begin
wait(RandomRange(200, 500));
if InvCount > PlusOne then
begin
WriteLn('We Got the log!!');
MakeCompass('Random');
break;
end else
begin
MarkTime(TreeWaitFailsafe);
repeat
wait(RandomRange(50, 150));
until(InvCount > PlusOne) or (TimeFromMark(TreeWaitFailsafe) > RandomRange(5000, 10000));
MakeCompass('0');
if (TimeFromMark(TreeWaitFailsafe) > 4000) then
begin
writeln('Log wasnt cut');
break;
end else
begin
writeln('Log was Cut! :)');
break;
end;
end;
end;
until(False);
end;


procedure DropLogs;
var
x, y, LogDTM, I:Integer;
SlotBox:TBox;
LogPattern:TIntegerArray;
begin
LogDTM:= DTMFromString('mbQAAAHicY2VgYIhlYmAIAuJgIE4A4gwg7mGE4BlAPB2Iu4HY0VIEqJqJwUBBAUxDMCZgxILBAADLpQW6');
LogPattern:=[1,5,9,13,17,21,25,28,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,16,12,8,4];
for I:=1 to 28 do
begin
FindNormalRandoms;
Status('Dropping Log:'+ IntToStr(I));
SlotBox:=InvBox(LogPattern[I]);
If FindDTM(LogDTM,x,y,Slotbox.x1,Slotbox.y1, SlotBox.x2, Slotbox.y2) Then
begin
MouseItem(LogPattern[I], MOUSE_RIGHT); //instead of 0 you can also use mouse_Right
ChooseOption('rop');
end;
end;
end;

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
repeat
ChopTree;
if InvFull Then
WriteLn('Dropping!');
DropLogs;
until(false);
end.



Theres the script, Hopefully somebody will test it and tell me what is wrong with the dropping procedure, Thanks.


Credits: Gucci And Sex :spot:


Thanks.

Abu

2012-05-01 16:39:29

Problem found:
{$i srl/srl.simba}

The slash is the wrong way round.

Jakkle

2012-05-01 21:23:13

From: abu_jwka
Problem found:
{$i srl/srl.simba}

The slash is the wrong way round.


To whom ?
It does not matter which way you put the slash, it will still compile and work.

Jakkle

2012-05-01 21:37:34

From: 10wnu9
:garfield: Hey guys, I've finally completed my New First script although It doesn't work properly when dropping :duh:.


procedure DropLogs;
var
x, y, LogDTM, I:Integer;
SlotBox:TBox;
LogPattern:TIntegerArray;
begin
LogDTM:= DTMFromString('mbQAAAHicY2VgYIhlYmAIAuJgIE4A4gwg7mGE4BlAPB2Iu4HY0VIEqJqJwUBBAUxDMCZgxILBAADLpQW6');
LogPattern:=[1,5,9,13,17,21,25,28,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,16,12,8,4];
for I:=1 to 28 do
begin
FindNormalRandoms;
Status('Dropping Log:'+ IntToStr(I));
SlotBox:=InvBox(LogPattern[I]);
If FindDTM(LogDTM,x,y,Slotbox.x1,Slotbox.y1, SlotBox.x2, Slotbox.y2) Then
begin
GetMousePos(x, y);
Wait(200 + Random(50));
Mouse(x, y, 0, 0, False);
WaitOption('Drop', 200)
end;
end;
end;

Try this and let me know if that works :)

Getdropped

2012-05-01 22:28:43

From: Jakkle

procedure DropLogs;
var
x, y, LogDTM, I:Integer;
SlotBox:TBox;
LogPattern:TIntegerArray;
begin
LogDTM:= DTMFromString('mbQAAAHicY2VgYIhlYmAIAuJgIE4A4gwg7mGE4BlAPB2Iu4HY0VIEqJqJwUBBAUxDMCZgxILBAADLpQW6');
LogPattern:=[1,5,9,13,17,21,25,28,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,16,12,8,4];
for I:=1 to 28 do
begin
FindNormalRandoms;
Status('Dropping Log:'+ IntToStr(I));
SlotBox:=InvBox(LogPattern[I]);
If FindDTM(LogDTM,x,y,Slotbox.x1,Slotbox.y1, SlotBox.x2, Slotbox.y2) Then
begin
GetMousePos(x, y);
Wait(200 + Random(50));
Mouse(x, y, 0, 0, False);
WaitOption('Drop', 200)
end;
end;
end;

Try this and let me know if that works :)


My version ;)

procedure DropLogs;
var
x, y, LogDTM, I:Integer;
begin
LogDTM:= DTMFromString('mbQAAAHicY2VgYIhlYmAIAuJgIE4A4gwg7mGE4BlAPB2Iu4HY0VIEqJqJwUBBAUxDMCZgxILBAADLpQW6');
FindNormalRandoms;
If FindDTM(LogDTM,x,y,MIX1,MIY1, MIX2, MIY2) Then
begin //finds dtm and gets position
GetMousePos(x, y);
Wait(200 + Random(50));
Mouse(x, y, 4, 4, False); //make sure to use random mouse movements for anti-ban
WaitOption('Drop', 200)
end;
FreeDTM(logDTM);//make sure to free DTMS
end;

Hope I helped ;)

10wnu9

2012-05-03 08:58:50

Hey guys, I'm currently at school, I'll test later.