Rasta Magician
Newcomer
- Joined
- Jan 5, 2008
- Sythe Gold
- 0
- Messages
- 8
hello everyone, I'm Rasta Magician at Srl Forums, I'm one of the Yellow members, and this is a script i posted there
have a good look, enjoy and keep your eyes out for when i start Selling my Every Tree Banker and PowerChopper on these forums.
You Need Rev #16 and Scar 3.15 for this script. Get Them Here
A Smart Cutter, the longer it runs, the better it gets!
Features:
!! Each Player can cut a different tree!
!! Smart tree finding! New way to find trees!
!! Fully AutoColor!
** Does not click ent and if tree turns into an ent it gets away from it and looks for another one!
** Realizes when your not cutting!
** AntiRandoms and AntiBan!
** MultiPlayer!
** SRL Stats!
** Good Progress Report!
How To Use:
- Fill in DeclarePlayers
- Place your Players close to the desired trees
- Axe in Inv or Equipped (or both)
- Click Run!
SRL Rev 16, Scar 3.15
Enjoy! Post Proggies!
~RM
You Need Rev #16 and Scar 3.15 for this script. Get Them Here
RM Extreme Cutter
By Rasta Magician, For all your cutting needs
By Rasta Magician, For all your cutting needs
A Smart Cutter, the longer it runs, the better it gets!
Features:
!! Each Player can cut a different tree!
!! Smart tree finding! New way to find trees!
!! Fully AutoColor!
** Does not click ent and if tree turns into an ent it gets away from it and looks for another one!
** Realizes when your not cutting!
** AntiRandoms and AntiBan!
** MultiPlayer!
** SRL Stats!
** Good Progress Report!
RM said:Extra Details (just if your curious)
- checks if the tree has an ent before clicking and keeps mouse over tree to look for color changes
- Checks for ent in chat box
- looks in chatbox to know that you are already cutting the tree
- if a you don't get a new log for 30 seconds it clicks the tree again
- if your mouse hasn't moved for over a minute it clicks a gametab and goes back to the previous one to avoid logging out.
- autocolors for every needed tree.
- only sets a player to false after an unsolvable random or no axe
- If you cant find the trees it logs out, after the second time this happens it'll just start cutting any tree available.
- waits for uptext or 1 sec before dropping logs/ random stuff. moves axe to inv#1 if it finds it in the middle of the inv.
- Uses bitmaps to count how many logs you got. if bitmaps fail it adds 27 to the log count
- it looks for randoms quite often
- Uses a tree finding method that get's better as it runs
- when i have time to remember and write more i'll add them
by me:
---> ver 1.0
[ Total Loads: 54
[ Total Logs: 1458
[ Time Running: 5 Hours, 4 Minutes and 25 Seconds
Nick, Tree, Logs, Active
***, Willow, 270, True
***, Willow, 189, False
***, Willow, 270, True
***, Willow, 270, True
***, Willow, 243, True
***, Willow, 162, False
***, Willow, 54, False
by HayHay89
[ Total Loads: 9
[ Total Logs: 243
[ Time Running: 1 Hours, 32 Minutes and 38 Seconds
Nick, Tree, Logs, Active
, Yew, 243, True
How To Use:
- Fill in DeclarePlayers
- Place your Players close to the desired trees
- Axe in Inv or Equipped (or both)
- Click Run!
SRL Rev 16, Scar 3.15
Enjoy! Post Proggies!
~RM
Code:
program RMPowerCutter;
{.include srl/srl.scar}
{.include srl/srl/skill/WoodCutting.scar}
Const
LoadsWanted = 2;
YourSRLId = '4066'; //your srl stats ID
YourSRLPass = 'helloworld'; // your srl stats pass
ScriptName = 'RM Power Cutter JM';
ScriptVersion = '1.21';
RMDebug = True;
{
everything should be ready to roll?
}
Procedure DeclarePlayers;
begin
NumberOfPlayers(2);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active := true;
Players[0].Strings[0] := 'Willow'; //Tree, Oak, Willow, Yew;
Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :='';
Players[1].Active := True;
Players[1].Strings[0] := 'Willow'; //Tree, Oak, Willow, Yew;
{
Players[2].Name :='';
Players[2].Pass :='';
Players[2].Nick :='';
Players[2].Active := true;
Players[2].Strings[0] := 'Willow'; //Tree, Oak, Willow, Yew;
Players[3].Name :='';
Players[3].Pass :='';
Players[3].Nick :='';
Players[3].Active := true;
Players[3].Strings[0] := 'Willow'; //Tree, Oak, Willow, Yew;
Players[4].Name :='';
Players[4].Pass :='';
Players[4].Nick :='';
Players[4].Active := true;
Players[4].Strings[0] := 'Willow'; //Tree, Oak, Willow, Yew;
Players[5].Name :='';
Players[5].Pass :='';
Players[5].Nick :='';
Players[5].Active := True;
Players[5].Strings[0] := 'Willow'; //Tree, Oak, Willow, Yew;
Players[6].Name :='';
Players[6].Pass :='';
Players[6].Nick :='';
Players[6].Active := True;
Players[6].Strings[0] := 'Willow'; //Tree, Oak, Willow, Yew;
Players[7].Name :='';
Players[7].Pass :='';
Players[7].Nick :='';
Players[7].Active := True;
Players[7].Strings[0] := 'Oak'; //Tree, Oak, Willow, Yew;
}
end;
procedure Intro;
var
TSA, s:TStringArray;
i, h, j:integer;
begin
ChangeReportWidth(1);
SetLength(TSA, 5);
SetLength(s, 5);
TSA[0]:='RRRRRR AA SSSSSSSS TTTTTTTTTTTT AA ';
TSA[1]:='RR R AAAA SS TT AAAA ';
TSA[2]:='RR RR AA AA SSSSSSS TT AA AA ';
TSA[3]:='RR R AAAAAAAA SS TT AAAAAAAA ';
TSA[4]:='RR R AA AA SSSSSSS TT AA AA';
repeat
ClearDebug;
for i:= 0 to High(TSA) do
begin
ClearDebug;
Inc(h);
s[i]:= TSA[i];
SetLength(s[i], h);
for j:= 0 to High(s) do
writeln(s[j]);
wait(50);
end;
until(h >= length(TSA[4]))
wait(500);
ClearDebug;
TSA[0]:='MMMM MMMM AA GGGGGGGG IIIIII CCCCCC IIIIII AA NNNN NN ';
TSA[1]:='MM MM MM MM AAAA GG II CC II AAAA NN NN NN ';
TSA[2]:='MM MM MM MM AA AA GG GGGGG II CC II AA AA NN NN NN ';
TSA[3]:='MM M MM AAAAAAAA GG GG II CC II AAAAAAAA NN NNN ';
TSA[4]:='MM MM AA AA GGGGGGGGG IIIIII CCCCCC IIIIII AA AA NN NN ';
h:=0;
repeat
ClearDebug;
for i:= 0 to High(TSA) do
begin
ClearDebug;
Inc(h);
s[i]:= TSA[i];
SetLength(s[i], h);
for j:= 0 to High(s) do
writeln(s[j]);
wait(50);
end;
until(h >= length(TSA[4]))
wait(500);
ClearDebug;
writeln('Thank you for using RM Cutter!');
ChangeReportWidth(350);
wait(500);
end;
type
Monster = record
Name: string;
UpText: TStringArray;
Colors: TIntegerArray;
AutoColor: boolean;
RG, RB, GB: integer;
end;
var
Find: Array of Monster;
AllTIA: Array[0..3] of TIntegerArray;
LoadsDone, TotalLoads, OakBMP, TreeBMP, SpotMark:integer;
//by RM
Function NoRandoms: boolean;
begin
if not LoggedIn then exit;
if FindNormalRandoms then Result:=true;
ClickToContinue;
if FindFight then
begin
RunAway('s', True, 1, (22000+Random(5000)));
Result:=True;
NoRandoms;
end;
end;
Function HowManyActive: integer;
var i, t, p:integer;
begin
p := High(Players);
for i:=0 to p do
if Players[i].Active then Inc(t);
Result := t;
end;
procedure Proggy;
var i:integer;
begin
ClearReport;
SrlRandomsReport;
AddToReport('[[[[[[ '+ScriptName+' '+ScriptVersion+' ]]]]]]');
AddToReport('[ Total Loads: '+IntToStr(TotalLoads));
AddToReport('[ Total Logs: '+IntToStr(TotalLoads*27));
AddToReport('[ Time Running: '+TimeRunning);
AddToReport('[[[[[[ '+ScriptName+' '+ScriptVersion+' ]]]]]]');
AddToReport('[ By: Rasta Magician ]');
AddToReport('[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]');
AddToReport('');
AddToReport('Nick, Tree, Logs, Active');
for i:=0 to High(Players) do
AddToReport(Players[i].Nick+', '+Players[i].Strings[0]+', '+
IntToStr(Players[i].Integers[0])+', '+
BoolToStr(Players[i].Active));
Disguise(' A: '+IntToStr(HowManyActive)+'/'+IntToStr(Length(Players))+' Logs: '+IntToStr(TotalLoads*27));
end;
procedure DropAllLogs;
var x, y, logs, i, t, k, tries:integer;
begin
if RMDebug then writeln('Dropping Logs');
if not LoggedIn then exit;
Inc(LoadsDone);
Inc(ReportVars[0]);
Inc(TotalLoads);
try begin
case lowercase(Players[CurrentPlayer].Strings[0]) of
'tree', 'normal': i:= 56;
'oak': i:= 57;
'willow': i:= 58;
'yew': i:= 60;
end;
logs := CountItems(srl_GetBitmap(i), 'bmp', [10])
if logs = 0 then logs := 27;
wait(150);
MMouse(0, 0, MSX2, MSY2);
if RMDebug then writeln('counted bitmaps');
end except
logs := 27;
if RMDebug then writeln('added default 27 logs');
end;
if RMDebug then writeln('logs: '+IntToStr(logs));
case lowercase(Players[CurrentPlayer].Strings[0]) of
'tree', 'normal': IncEx(ReportVars[1], logs);
'oak': IncEx(ReportVars[2], logs);
'willow': IncEx(ReportVars[3], logs);
'yew': IncEx(ReportVars[4], logs);
end;
IncEx(Players[CurrentPlayer].Integers[0], logs)
tries:= 0;
repeat
NoRandoms;
if not LoggedIn then exit;
for i:=2 to 28 do
begin
if (i mod 5) = 0 then
begin
NoRandoms;
wait(150);
end;
if ExistsItem(i) then
begin
MMouseItem(i);
for k:= 0 to 4 do
begin
wait(200);
if IsUpText('log') then break;
if lowercase(Players[CurrentPlayer].Strings[0]) = 'tree' then
if IsUpText('Logs') then break;
end;
if not IsUpText('axe') then
begin
GetMousePos(x, y);
Mouse(x, y, 1, 1, False);
Wait(170 + Random(50));
if (ChooseOption('rop')) then
Wait(RandomRange(50, 200));
end else
DragItem(i, 1);
wait(Random(150));
end;
end;
t:= 0;
for i:=2 to 28 do
if ExistsItem(i) then
begin
Inc(t);
break;
end;
Inc(Tries);
ArrangeInv;
if tries >= 3 then break; //failsafe not to drop axe in case it's in middle of inv
until(t = 0);
Proggy;
end;
// By Frozen Soul
Function PosArray(SubStr : Array of String; S : String) : Boolean;
var i:integer;
Begin
for i := 0 to GetArrayLength(SubStr) - 1 do
Begin
Result := Pos(SubStr[i], Lowercase(S)) > 0;
if Result then exit;
end;
end;
procedure InactiveMove;
var x, y, i, h:integer;
begin
GetMousePos(x, y);
IncEx(MouseSpeed, 10);
i := GetCurrentTab;
repeat
h := 1+Random(12);
until(h <> i)
GameTab(h);
wait(500+Random(500));
GameTab(i);
MMouse(x, y, 3, 3);
DecEx(MouseSpeed, 10);
end;
procedure AntiBan;
var i, p:integer;
begin
if not LoggedIn then exit;
p:=Random(100);
if p < 2 then
begin
if RMDebug then writeln('Anti-Ban');
i := Random(16);
case i of
0, 1: HoverSkill('woodcutting', False);
2, 3: HoverSkill('firemaking', False);
4, 5: HoverSkill('fletching', False);
6, 7: MMouse(0, 0, 700, 700);
8, 9: GameTab(1+Random(14));
10, 11: AlmostLogout;
12, 13: PickUpMouse;
14, 15: HoverSkill('random', False);
end;
GameTab(4);
end;
end;
Function CheckAndClick(var x, y:integer; text:TStringArray): boolean;
var
m:integer;
FoundIt:boolean;
begin
if not LoggedIn then exit;
wait(100);
MMouse(x, y, 3, 3);
wait(100);
for m:=0 to high(text) do
begin
if IsUpText(text[m]) then
begin
if RMDebug then writeln('text is up, '+text[m]);
FoundIt:=True;
break;
end;
end;
if FoundIt then
begin
GetMousePos(x, y);
if FindEnt(x, y, False) then
begin
Result := False;
Inc(EntsAvoided);
wait(1000);
if RMDebug then writeln('exiting');
exit;
if RMDebug then writeln('exited');
end;
if RMDebug then writeln('moving mouse to tree');
Mouse(x, y, 0, 0, True);
Result := True;
end else
Result := False;
end;
//Smart Colors By Tarajunky, Custom by Rasta Magician
Function SmartColorsCustom(name:string; UpText:TStringArray; colors:TIntegerArray):boolean;
var
j, k:integer;
b, Found:boolean;
var RMInt, RMx, RMy:integer;
var x,y,TestColor,a,l,m,i,red,green,blue, ClickColor:integer;
var p: array of Tpoint;
begin
if not LoggedIn then exit;
for i:=0 to High(Find) do
begin
if lowercase(name) = Find[i].Name then
begin
b := True;
k := i;
end;
end;
if not b then //we have to add it.
begin
k:=GetArrayLength(Find);
SetArrayLength(Find, k+1);
Find[k].Name:= lowercase(name);
Find[k].UpText := UpText;
Find[k].Colors := colors;
end;
{autocoloring}
if not Find[k].AutoColor then
begin
for i:=0 to High(Find[k].Colors) do
begin
ColorToRGB(Find[k].Colors[i], j, l, m)
IncEx(Find[k].RG, (j-l));
IncEx(Find[k].RB, (j-m));
IncEx(Find[k].GB, (l-m));
end;
Find[k].RG := (Find[k].RG/Length(Find[k].Colors))
Find[k].RB := (Find[k].RB/Length(Find[k].Colors))
Find[k].GB := (Find[k].GB/Length(Find[k].Colors))
Find[k].Autocolor := True;
end;
FFlag(0);
Wait(50);
if RMDebug then writeln('Finding '+name);
l:=GetArrayLength(Find[k].Colors); //Checks known colors first
if l>0 then
begin
for i:= 0 to l-1 do
begin
if RMDebug then writeln('finding color: '+IntToStr(Find[k].Colors[i]));
FindColorsSpiralTolerance(MSCX,MSCY,p,Find[k].Colors[i],MSX1,MSY1,MSX2,MSY2,0);
m:=GetArrayLength(p);
if m>0 then
begin
if m > 30 then exit;
for a:= 0 to m-1 do
begin
if CheckAndClick(p[a].x,p[a].y, Find[k].UpText) then //Moves mouse to position, checks uptext and clicks if correct.
begin
result:=true;
if i>0 then //if the color is not in the first position of the array...
Swap(Find[k].Colors[i], Find[k].Colors[i-1]);
// Swap found color with the one ahead of it in the array
exit; // We found our color, so we exit the function completely.
end;
end;
end;
end;
end;
//We didn't find any known colors, so continue on to the tolerance search
for j:=0 to High(Find[k].Colors) do
begin
if j >= 3 then break; //only wanna look for 3 colors with tol
if RMDebug then writeln('finding color '+IntToStr(Find[k].Colors[j])+' with tol ');
FindColorsSpiralTolerance(MSCX, MSCY, p, Find[k].Colors[j],MSX1,MSY1,MSX2,MSY2,25);
l:=GetArrayLength(p);
if (l>0)and(not l>30) then
begin
for i:= 0 to l-1 do
begin
TestColor:=GetColor(p[i].x,p[i].y); //Additional autocoloring to reduce wrong points. (Optional)
{turning it to RGB}
red:=(TestColor mod 256);
green:=((TestColor/256) mod 256);
blue:=((TestColor/256) / 256);
{comparing colors}
if ((green-blue)<=(Find[k].GB+20)) then if ((green-blue)>=(Find[k].GB-20)) then
if ((red-green)>=(Find[k].RG-20)) then if ((red-green)<=(Find[k].RG+20)) then
if ((red-blue)>=(Find[k].RB-20)) then if ((red-blue)<=(Find[k].RB+20)) then
begin
Wait(20);
ClickColor:=GetColor(p[i].x,p[i].y);
for RMInt:=0 to High(Find[k].Colors) do
begin
if RMInt <> j then
if FindColorSpiralTolerance(RMx, RMy, Find[k].Colors[RMInt],x-5,y-5,x+5,y+5, 20) then
begin
Found:=True;
break;
end;
end;
If Found then
if CheckAndClick(p[a].x,p[a].y, Find[k].UpText) then //Move mouse, check uptext and click
begin
result:=true;
FindColorsSpiralTolerance(x,y,p,ClickColor,MSX1,MSY1,MSX2,MSY2,0);
if GetArrayLength(p)<20 then //Make sure that the color is somewhat rare, and doesn't take up half the screen
begin
a:=GetArrayLength(Find[k].Colors);
for i:= 0 to a-1 do
begin
if ClickColor=Find[k].Colors[i] then //If color is already in the array...
begin
if i>0 then
begin // Move it up one spot in the array search priority
Swap(Find[k].Colors[i], Find[k].Colors[i-1]);
end;
exit;
end;
end;
// if it's not in the array yet, then add it to the end of the array
SetArrayLength(Find[k].Colors,a+1);
Find[k].Colors[a]:=ClickColor;
if RMDebug then Writeln(IntToStr(ClickColor)+' added to '+name+' array');
end;
exit;
end;
end;
end;
end;
end;
end;
Function ScanColors: TIntegerArray;
var
x, y, i, h, j, k:integer;
RMColors, GoodColors:TIntegerArray;
p: TPointArray;
begin
if not LoggedIn then exit;
j := 0;
GetMousePos(x, y);
SetArrayLength(RMColors, 441);
for i:=x-10 to x+10 do //getting all the colors
begin
for h:=y-10 to y+10 do
begin
RMColors[j] := GetColor(i, h);
Inc(j);
end;
end;
ClearSameIntegers(RMColors);
h := High(RMColors)
k:=0;
SetArrayLength(GoodColors, h);
for i:= 0 to h do //checking out which colors are good;
begin
if k > 7 then break;
FindColorsSpiralTolerance(x, y, p, RMColors[i], MSX1, MSY1, MSX2, MSY2, 0);
j := Length(p);
if (j > 0)and(j < 30) then
begin
GoodColors[k]:= RMColors[i];
Inc(k);
end;
end;
//now we still need to sort them to see which ones are the best.
//or is that too much work, seeing that smart colors will end up doing it?
SetArrayLength(GoodColors, 7);
Result:=GoodColors;
end;
procedure CutTrees; forward;
Function CheckAxe(StringArray: TStringArray):boolean;
begin
Result:=True;
if (PosArray(['do not have an axe'], StringArray[7])) or
(PosArray(['do not have an axe'], StringArray[8])) or
(PosArray(['need an axe to chop'], StringArray[7]))or
(PosArray(['need an axe to chop'], StringArray[8]))then
begin //Withdraw Axe
Players[CurrentPlayer].Active := False;
Players[CurrentPlayer].loc := 'No Axe';
if RMDebug then writeln('axe broke');
LogOut;
Result := False;
end;
end;
procedure RunAwayEnt;
var
Rx, Ry, RBoolx, RBooly:integer;
begin
if not LoggedIn then exit;
if RMDebug then writeln('running from ent');
RBoolx := Random(100)+1;
RBooly := Random(100)+1;
if RBoolx < 51 then
Rx := RandomRange(-15, -10)
else
Rx := RandomRange(10, 15);
if RBooly < 51 then
Ry := RandomRange(-15, -10)
else
Ry := RandomRange(10, 15);
Mouse(MMCX+Rx, MMCY+Ry, 0, 0, True);
wait(1000+Random(1000));
Inc(EntsAvoided);
AntiBan;
//returning to place
Mouse(MMCX-Rx, MMCY-Ry, 0, 0, True);
wait(1000+Random(1000));
CutTrees;
end;
procedure WaitUntilCut(name:string); forward;
procedure GetToTree(name:string; WaitForTree:boolean);
var
x, y, x1, x2, y1, y2, i:integer;
ChatMessage: string;
begin
if not LoggedIn then exit;
GetMousePos(x, y);
if FindEnt(x, y, False) then
begin
RunAwayEnt;
Exit;
end;
NoRandoms;
name := lowercase(name);
if RMDebug then writeln('getting to tree '+name);
if (abs(MSCX - x)>30) then
if x > MSCX then //tree is to the right
begin
if RMDebug then writeln('tree is to the right');
x1 := MSCX + 20;
if name='oak' then IncEx(x1, 10);
if name='willow' then IncEx(x1, 5);
if name='yew' then IncEx(x1, 25);
x2 := x1+30;
end else
begin
if RMDebug then writeln('tree is to the left');
x1 := MSCX - 55;
if name='oak' then DecEx(x1, 15);
if name='willow' then DecEx(x1, 10);
if name='yew' then DecEx(x1, 30);
x2 := x1+30;
end
else
begin
if RMDebug then writeln('x: tree is in the middle');
x1 := MSCX-30;
x2 := x1 +60;
end;
//the bigger y the further down it is
if (abs(MSCY - y)>40) then
if y > MSCY then //it's under the player
begin
if RMDebug then writeln('tree is under the player');
y1 := MSCY+25;
if name='oak' then IncEx(y1, 30);
if name='willow' then IncEx(y1, 20);
if name='yew' then IncEx(y1, 35);
y2 := y1+20;
end else
begin
if RMDebug then writeln('tree is over the player');
y1 := MSCY - 50;
if name='oak' then DecEx(y1, 35);
if name='willow' then DecEx(y1, 25);
if name='yew' then DecEx(y1, 40);
y2 := y1 + 20;
end
else
begin
if RMDebug then writeln('y: tree is in the middle');
y1 := MSCY-40;
y2 := y1 +80;
end;
FFlag(0);
wait(500+Random(100));
if RMDebug then writeln('decided where tree should be');
for i:= 0 to 5 do
begin
if RMDebug then writeln('trying to find tree');
wait(100);
ChatMessage:=GetBlackChatMessage;
if PosArray(['Ent'], ChatMessage) then RunAwayEnt;
if (name = 'tree') then
if (ChatMessage = 'You get some logs.') then
exit;
if i = 0 then
MMouse((x1+x2)/2, (y1+y2)/2, 3, 3)
else
MouseBox(x1, y1, x2, y2, 3);
wait(100);
if IsUpText(Capitalize(name)) then
break;
if i >= 5 then exit;
end;
NoRandoms;
wait(300);
if InvFull then DropAllLogs;
if WaitForTree then WaitUntilCut(name);
end;
Function ChooseAnyTree:boolean;
var x, y:integer;
begin
if RMDebug then writeln('Choosing Any Tree');
if FindObjTPA(x, y, 2772296, 11, -1, 7, 7, 15, ['hop']) then
begin
Result := True;
if IsUpText('Tree') then Players[CurrentPlayer].Strings[0] := 'Tree' else
if IsUpText('Oak') then Players[CurrentPlayer].Strings[0] := 'Oak' else
if IsUpText('Willow') then Players[CurrentPlayer].Strings[0] := 'Willow' else
if IsUpText('Yew') then Players[CurrentPlayer].Strings[0] := 'Yew';
end else
Result:=False;
end;
procedure AutoColorTree(name:string);
var
i, x, y:integer;
Found:boolean;
begin
i := 10;
name := Capitalize(name);
case name of
'Tree', 'Normal': i:= 0;
'Oak': i:= 1;
'Willow': i:= 2;
'Yew': i:= 3;
end;
if i = 10 then
begin
writeln('tree name incorrect');
exit;
end;
if (Length(AllTIA[i]) > 0) then
begin
if RMDebug then writeln('already AutoColored');
exit;
end;
if RMDebug then writeln('autocoloring '+name);
repeat
NoRandoms;
if not LoggedIn then break;
if FindObjTPA(x, y, 2772296, 11, -1, 7, 7, 15, [ name ]) then
begin
if IsUpText(name) then
begin
AllTIA[i]:=ScanColors;
if AllTIA[i][0] <> 0 then Found:=True;
end;
end;
until(found)
wait(1000);
if RMDebug then writeln(name+' color: '+IntToStr(AllTIA[i][0]));
end;
Function NextSpot: integer;
var
i:integer;
begin
if not LoggedIn then exit;
Result := 1;
for i:=1 to 28 do
if not ExistsItem(i) then
begin
Result:= i;
exit;
end;
end;
function FindTree(name:string): boolean;
begin
if not LoggedIn then exit;
AutoColorTree(Players[CurrentPlayer].Strings[0]);
case lowercase(name) of
'normal', 'tree':
Result := SmartColorsCustom('normal', ['Tree'], AllTIA[0]);
'oak':
Result:=SmartColorsCustom('oak', ['Oak'], AllTIA[1]);
'willow':
Result:=SmartColorsCustom('willow', ['Willow'], AllTIA[2]);
'yew':
Result:=SmartColorsCustom('yew', ['Yew'], AllTIA[3]);
end;
end;
procedure WaitUntilCut(name:string);
var
x, y, i, j, k, t, CheckSpot, CutMark:integer;
p:TPointArray;
Found : boolean;
TSA:TStringArray;
begin
if not LoggedIn then exit;
if RMDebug then writeln('waiting until cut');
wait(500);
MarkTime(CutMark);
GetMousePos(x, y);
if FindEnt(x, y, False) then
begin
RunAwayEnt;
exit;
end;
wait(250);
NoRandoms;
wait(150);
MarkTime(t);
repeat
NoRandoms;
if not LoggedIn then break;
if InvFull then
begin
wait(10);
DropAllLogs;
MarkTime(CutMark);
end;
TSA:=ChatsBlackText;
if not CheckAxe(TSA) then exit;
wait(300);
NoRandoms;
if (PosArray(['swing your axe'], TSA[7]))or
(PosArray(['swing your axe'], TSA[8]))or
(PosArray(['get some'], TSA[8]))then
begin
if RMDebug then writeln('found TSA');
break;
end;
if name = 'tree' then
if (PosArray(['get some'], TSA[8])) then
exit;
if (TimeFromMark(t) > 3000) then
begin
wait(100);
if RMDebug then writeln('tree took too long');
Exit;
end;
until(false);
if RMDebug then writeln('cutting tree');
GetMousePos(x, y); //let's keep our mouse over the tree now.
wait(100);
MarkTime(SpotMark);
CheckSpot := NextSpot;
repeat
if not LoggedIn then exit;
NoRandoms;
if InvFull then
begin
wait(50);
DropAllLogs;
MarkTime(CutMark);
end;
if ExistsItem(CheckSpot) then
begin
CheckSpot := NextSpot;
wait(50);
MarkTime(SpotMark);
end;
if (TimeFromMark(SpotMark) > 30000) then
begin
wait(100);
if RMDebug then
begin
writeln('i dont think were cutting, but we should be!')
writeln('lets try finding that tree again!');
end;
exit;
end;
if (name='tree') then
if (GetBlackChatMessage = 'You get some logs.') then
exit;
wait(100);
NoRandoms;
wait(100);
Found:=False;
if IsUpText('hop') then
begin
if FindEnt(x, y, False) then
begin
RunAwayEnt;
exit;
end;
Found := True;
wait(200);
end else
begin
if RMDebug then writeln('tree seems to be gone..?');
NoRandoms;
GetMousePos(x, y);
//if looking for one trre then one color if looking for other tree then other color
i := Find[0].Colors[0];
FindColorsSpiralTolerance(x, y, p, i, x-5, y-5, x+5, y+5, 10);
j := High(p);
if j > 0 then
if j > 10 then j := 10;
for k:=0 to j do
begin
if (name='tree')and(GetBlackChatMessage = 'You get some logs.') then exit;
if ((abs(x-p[k].x))>2)or((abs(y-p[k].y))>2) then
MMouse(p[k].x, p[k].y, 0, 0);
wait(150);
Found := IsUpText('hop');
if Found then break;
wait(50);
end;
wait(100);
end;
if not LoggedIn then exit;
NoRandoms;
wait(150);
GetMousePos(x, y);
if FindEnt(x, y, False) then
begin
RunAwayEnt;
break;
end;
wait(150);
if InvFull then
begin
wait(100);
DropAllLogs;
MarkTime(CutMark);
end;
if (TimeFromMark(CutMark) > 45000) then
begin
InactiveMove;
MarkTime(CutMark);
end;
until(not Found);
if RMDebug then writeln('tree gone');
end;
procedure PlayerSetup;
var AllGood:boolean;
begin
//check for axe, wc lvl etc
if not LoggedIn then exit;
repeat
if NoRandoms then
begin
Players[CurrentPlayer].Active := False;
exit;
end;
LoadsDone:=0;
Players[CurrentPlayer].Level[20] := GetSkillLevel('woodcutting');
if FindAxe then
begin
if RMDebug then writeln('Axe found');
wait(500+Random(1000));
SetAngle(True);
AllGood := True;
end else
NextPlayer(False);
until(AllGood);
GameTab(4);
end;
procedure ScriptSetup;
begin
SetupSRL;
writeln('setting up script');
DeclarePlayers;
ScriptID := '709';
SRLID := YourSRLID;
SRLPassword := YourSRLPass;
ActivateClient;
wait(2500);
LoginPlayer;
if not LoggedIn then LoginPlayer;
wait(3000);
PlayerSetup;
MMouse(MSCX, MSCY, 3, 3);
end;
procedure CutTrees;
var i:integer;
begin
NoRandoms;
if not (LoadsDone >= LoadsWanted) then
begin
if RMDebug then writeln('not loadsDone >= loadswanted');
repeat
if LoadsDone >= LoadsWanted then break;
if Not LoggedIn then Exit;
NoRandoms;
wait(Random(1000));
if InvFull then DropAllLogs;
if LoadsDone >= LoadsWanted then break;
if FindTree(Players[CurrentPlayer].Strings[0]) then
begin
wait(500);
Players[CurrentPlayer].Integers[1] := 0;
i:=0;
NoRandoms;
wait(300);
GetToTree(Players[CurrentPlayer].Strings[0], True);
end else
begin
writeln('couldnt find tree');
NoRandoms;
wait(3000);
InactiveMove;
inc(i);
end;
if i >= 5 then
begin
NoRandoms;
writeln('pretty sure there are no damn trees around.');
LoadsDone := LoadsWanted + 1;
Inc(Players[CurrentPlayer].Integers[1]);
if Players[CurrentPlayer].Integers[1] >= 2 then
begin
if not ChooseAnyTree then
Players[CurrentPlayer].Active := False
else
CutTrees;
end;
exit;
end;
NoRandoms;
until(False);
end;
end;
procedure ScriptTerminate;
begin
srl_FreeBitmaps;
end;
begin
ClearDebug;
SetupSRL;
Intro;
ActivateClient;
ScriptSetup;
repeat
ActivateClient;
if (not loggedIn) then break;
writeln('cut trees');
CutTrees;
if LoggedIn then
writeln(Players[CurrentPlayer].Name+' logged in, Switching player')
else
writeln(Players[CurrentPlayer].Name+' not logged in, Switching Player');
NextPlayer(Players[CurrentPlayer].Active);
if HowManyActive = 0 then break;
PlayerSetup;
until(false);
writeln('Script Stopping. Thank you for using RM Cutter! Please Post Proggie!');
DisGuise('Done.');
end.


