All the comments i read say open in a form but when i go to use it i dont know how to open in a form...scar just pops-up and looks nothing like the screenies others have im really confused and need alot of help im new lol![]()
All the comments i read say open in a form but when i go to use it i dont know how to open in a form...scar just pops-up and looks nothing like the screenies others have im really confused and need alot of help im new lol![]()
Please do not open two threads on the same topic and I do not understand what you are asking.
Don't be a postwhore ![]()
Current Project: Catching up on what I missed, re-writing some old includes I done in the past.
Upcoming Project: Open For Suggestions
why would you reply if u cant help?
He's just telling you not to do that. It doesn't help your chances of getting help.
What script are you using? I don't understand what you mean by "Form" and such. Paste the script here surrounded in SCAR tags.
maybe you downloaded the wrong scar? and scar isn't an rs server its a program with writing in it you have to dl the script to use it
so where do i enter stuff and can i plz have step by step instructions? Plz give me lines where i enter stuff? i have scar divi 3.15 is that right? im a noob btw...SCAR Code:program RMPowerCutter;
//{.include SRL/SRL/Misc/Smart.scar}
{.include srl/srl.scar}
{.include srl/srl/misc/Users.scar}
{.include srl/srl/misc/Path.scar}
{.include srl/srl/skill/WoodCutting.scar}
////////////////////////////////// READ ME /////////////////////////////////////
// Setup The Consts and Declare players if not using form. //
// if using form setup the consts and press play //
// Press Save And Start in the form to start the script //
// //
// START ALL PLAYERS IN BANK; START ALL PLAYERS IN BANK; //
// for power choppers start them anywhere near the tree you want. //
/////////////////////////////////////////////////////////////////////////////////////
// Cutting Options! //
// Fally -> Tree, Oak //
// Draynor -> Willows //
// Power -> Tree, Oak, Willow, Yew //
////////////////////////////////////////////////////////////////////////////////////
Const
LoadsWanted = 2;
{
SmartWorld = 134;
Signed = True;
}
UseResponder = True;
UseSrlPlayerForm = False;
SaveProggyToFile = True;
UseDebug = True;
SaveDebugToFile = False;
YourSRLId = '4066'; //your srl stats ID
YourSRLPass = 'helloworld'; // your srl stats pass
ScriptName = 'RM Power Cutter'; //don't touch these
ScriptVersion = '2.00'; //don't touch these
{
everything should be ready to roll?
}
//ignore this if your going to use the form
Procedure DeclarePlayers;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
{
Strings[0] Options:
if Fally -> Tree, Oak, (Yew -> in the future)
if Draynor -> Willows, (Tree, Oak, Yew -> in the Future)
if Power -> Tree, Oak, Willow, Yew
}
// START ALL PLAYERS IN BANK; START ALL PLAYERS IN BANK;
// for power choppers start them anywhere near the tree you want.
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active := True;
Players[0].Strings[0] := 'Willow'; //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;
Procedure RMDebug(s:string); //sort of useless but looks better through the rest of the script
var name:string;
begin
try name := Players[CurrentPlayer].Name; except name:= '' end;
if UseDebug then writeln(name+' : '+s);
end;
Function LocToBank:string;
begin
RMDebug('LocToBank');
case lowercase(Players[CurrentPlayer].Loc) of
'draynor': Result:='db';
'fally': Result:='feb';
end;
end;
{
procedure SetupSmart;
begin
SmartSetupEx(SmartWorld, false, Signed);
ClearDebug;
WriteLn('Setting up Smart... Please Hold...');
Wait(10000 + random(5000));
SetTargetDC(SmartGetDC);
While not(SmartReady) do Wait(100);
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;
type //autocolor just from the best color... and if the color has
Monster = record //changed then reautocolor
Name: string;
UpText: TStringArray;
Colors: TIntegerArray;
AutoColor: boolean;
RG, RB, GB: integer;
end;
type
MyChat = record
Chatter: TStringArray;
Said: TStringArray;
LastResponded: integer;
end;
var
Find: Array of Monster;
AllTIA: Array[0..3] of TIntegerArray;
LoadsDone, TotalLoads, SpotMark, DraynorRoad, MyWaterColor:integer;
Trigger: Array of Array[0..1] of TStringArray; //questions, could make more triggers... if i
Answers: Array of TStringArray; //find i need them
RMTalks: MyChat;
ProggyStr: string;
//by RM
procedure SetupRespond;
begin
SetLength(RMTalks.Chatter, 8);
SetLength(RMTalks.Said, 8);
SetLength(Trigger, 5); //how many questions
SetLength(Answers, Length(Trigger));
//you can have as many trigger words and rows as you want
//you can have as many answers as you want
Trigger[0][0]:= ['wc', 'woodcutting']; // trigger words 1
Trigger[0][1]:= ['lvl', 'level']; // trigger words 2
//Trigger[0][2]:= ['','','','','','']; // trigger words 3
Answers[0]:= [
'My Woodcutting Level is: '+IntToStr(Players[CurrentPlayer].Level[20]), //answer 1
'Wc: '+IntToStr(Players[CurrentPlayer].Level[20]), //answer 2
IntToStr(Players[CurrentPlayer].Level[20])+' wc lvl', //answer 3
'my wcing lvl is '+IntToStr(Players[CurrentPlayer].Level[20]) //answer 4
]
Trigger[1][0] := ['axe'];
Trigger[1][1] := ['which', 'what'];
Answers[1] := [
'I''m using a '+Players[CurrentPlayer].Strings[2]+' axe',
Players[CurrentPlayer].Strings[2],
'my axe is made out of '+Players[CurrentPlayer].Strings[2]
]
Trigger[2][0]:= ['good place', 'train'];
Trigger[2][1]:= ['woodcutting', 'wc'];
Answers[2] := [
'Try Training Woodcutting at Draynor',
'Draynor', 'Varrock', 'Edgy', 'Fally',
'Try Training Woodcutting at Edgeville',
'Try Training Woodcutting at Varrock Palace',
'Try Training Woodcutting at South of Falador'
]
end;
//from srl, modded ofr any line
function GetChatTextLine(var chat: string; line:integer): Boolean;
var
x, y: Integer;
textP: TPoint;
begin
textP := TextCoords(line);
if findcolor(x, y, 16711680, textp.x, textp.y, textp.x + 200, textp.y + 14) then
begin
chat := LowerCase(Trim(GetTextAtEx(x - 3, textp.y - 2, 0, SmallChars, False,
False, -1, 1, 16711680, 60, False, tr_allChars)));
Result := True;
end;
end;
//from srl, modded for any line
function GetChatterLine(var name: string; line:integer): Boolean;
var
i: Integer;
textP: TPoint;
begin
textP := TextCoords(line);
name := LowerCase(Trim(GetTextAtEx(textP.x - 2, textP.y - 2, 0, SmallChars, False, False, 0, 1,
0, 60, False, tr_allChars)))
i := Pos(':', name)
if (i <> 0) then
begin
Delete(name, i, i);
Result := True;
end;
end;
procedure RMRespond;
var
str: string;
i, h, t, k, Triggered:integer;
TSA:TStringArray;
begin
if TimeFromMark(RMTalks.LastResponded) < 60000 then exit;
SetLength(TSA, 8)
for i:=8 DownTo 1 do
begin
GetChatterLine(RMTalks.Chatter[i-1], i);
if RMTalks.Chatter[i-1] = Lowercase(Players[CurrentPlayer].Name) then
break; //if we already answered, it means we already checked further up.
GetChatTextLine(RMTalks.said[i-1], i);
TSA[i-1] := RMTalks.Chatter[i-1]+': '+RMTalks.said[i-1];
end;
for i:=High(TSA) DownTo 0 do
for h:= 0 to High(Trigger) do //questions
begin
Triggered:= 0;
for t:=0 to High(Trigger[h]) do //How many triggers
for k:=0 to High(Trigger[h][t]) do //specific trigger
if Pos(Trigger[h][t][k], TSA[i]) > 0 then
begin
Inc(triggered);
if triggered >= 2 then
begin
str:=(Answers[h][Random(Length(Answers[h]))]);
exit;
end; //end if
end; //end if
end; //end h loop
//end of i loop
if str <> '' then
begin
TypeSend(str);
MarkTime(RMTalks.LastResponded);
end;
end;
Function NoRandoms: boolean;
var
x, y, i, h:integer;
s:string;
begin
if not LoggedIn then exit;
GetMousePos(x, y);
if UseResponder then
RMRespond;
if FindNormalRandoms then Result:=true;
if ClickToContinue then MMouse(x, y, 2, 2);
if FindFight then
begin
//none of the run aways check for randoms....
case random(4) of
0: s:= 'N';
1: s:= 'E';
2: s:= 'S';
3: s:= 'W';
end;
RunTo(s, True);
Result:=True;
wait(1000);
NoRandoms;
end;
end;
// Function in Bank.scar, but just using the DTMs part
function FindBankDTM(TheBank: string): Boolean;
var
bx, by, TheDTM: Integer;
WhichAngle: Extended;
begin
case TheBank of
'feb': TheDTM := DTMFromString('78DA63AC67626088634001FFFFFD63F80FA41' +
'9416C2060AC01AA4987C83141D5FCF9C3C4C0055503028CAD44A8' +
'E924AC0600131E11B5');
// 'fwb': TheDTM := DTMFromString('78DA636C676260086540038C0CFFC12403C37' +
// 'F206004A98986C8304155FCF9C3C4C0055503D6D14C849A6EC26A' +
// '009F5A0EA1');
'db': TheDTM := DTMFromString('78DA636C67626008644001FFFFFD63F80FA41' +
'9416C2060AC01AAF182C8B140D5FCF9C304A619A17CB09A204C35' +
'22E86AC2F09B0300F8811153');
'db2': TheDTM := DTMFromString('78DA63EC60626008614001FFFFFF676060042' +
'310FB3F6303508D37448E09AAE6ED5B08CD08E583D50413A1269C' +
'809A0AC26A00E665129F');
// 'veb': TheDTM := DTMFromString('78DA63EC61626008624001FFFFFD63F80FA41' +
// '9416C2060EC00AA8982C83141D5FCF9C3C4C0055503028C138850' +
// 'D343580D00122211A9');
// 'vwb': TheDTM := DTMFromString('78DA63EC606260B066C000FF819811440301E' +
// '354A01A3B88381354FECF1F260611A81A1000AB3125428D2E7E35' +
// '0087F80E5E');
// 'akb': TheDTM := DTMFromString('78DA636C606260F06140019D9D710CFF81342' +
// '310FF0702C652A01A37881C1354CD9F3F4C0C5C5035200056E345' +
// '841A3FFC6A002A3B0F97');
end;
if FindDtmRotated(TheDTM, bx, by, MMX1, MMY1, MMX2, MMY2, Radians(-30), Radians(30), 0.05,
WhichAngle) then
begin
Mouse(bx, by, 0, 0, True);
// FTWait(8);
FFlag(0);
Result := True;
end else Result := False;
FreeDTM(TheDTM);
end;
procedure DeclarePaths; //for Fally
begin
{
RoadColor:=FindFallyRoadColor;
if RoadColor = 0 then RoadColor := FindRoadColor;
}
RMDebug('Declaring Paths');
//bank to oak
Path[0].Mainpoint.x:=582;
Path[0].Mainpoint.y:=58;
Path[0].Subpoints[0].x:=600;
Path[0].Subpoints[0].y:=93;
Path[0].Subpoints[1].x:=594;
Path[0].Subpoints[1].y:=62;
Path[0].Subpoints[2].x:=623;
Path[0].Subpoints[2].y:=53;
Path[0].Subpoints[3].x:=625;
Path[0].Subpoints[3].y:=65;
//bank to tree
Path[1].Mainpoint.x:=599;
Path[1].Mainpoint.y:=83;
Path[1].Subpoints[0].x:=598;
Path[1].Subpoints[0].y:=62;
Path[1].Subpoints[1].x:=602;
Path[1].Subpoints[1].y:=97;
Path[1].Subpoints[2].x:=624;
Path[1].Subpoints[2].y:=58;
//oak to tree
Path[2].Mainpoint.x:=645;
Path[2].Mainpoint.y:=115;
Path[2].Subpoints[0].x:=671;
Path[2].Subpoints[0].y:=82;
Path[2].Subpoints[1].x:=640;
Path[2].Subpoints[1].y:=88;
Path[2].Subpoints[2].x:=655;
Path[2].Subpoints[2].y:=132;
//tree to oak
Path[3].Mainpoint.x:=612;
Path[3].Mainpoint.y:=55;
Path[3].Subpoints[0].x:=629;
Path[3].Subpoints[0].y:=75;
Path[3].Subpoints[1].x:=590;
Path[3].Subpoints[1].y:=61;
Path[3].Subpoints[2].x:=652;
Path[3].Subpoints[2].y:=57;
Path[3].Subpoints[3].x:=636;
Path[3].Subpoints[3].y:=55;
SetPath(0);SetPath(1);SetPath(2);SetPath(3);
end;
Function Relocate(Place:string):boolean;
begin
wait(1);
end;
//Thanks to EvilChicken! and Bullzeye95 for help with saving proggy to text :)
procedure Proggy;
var
i, JX2:integer;
begin
ClearReport;
SrlRandomsReport;
AddToReport('[[[[[[ '+ScriptName+' '+ScriptVersion+' ]]]]]]');
AddToReport('[ Players: '+IntToStr(Length(Players)));
AddToReport('[ Current Player: '+Players[CurrentPlayer].Nick);
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, Loc, Level, Tree, Logs, Active');
ProggyStr:='';
ProggyStr:= ProggyStr + chr(13) + ('[[[[[[ '+ScriptName+' '+ScriptVersion+' ]]]]]]');
ProggyStr:= ProggyStr + chr(13) + ('[ Players: '+IntToStr(Length(Players)));
ProggyStr:= ProggyStr + chr(13) + ('[ Current Player: '+Players[CurrentPlayer].Nick);
ProggyStr:= ProggyStr + chr(13) + ('[ Total Loads: '+IntToStr(TotalLoads));
ProggyStr:= ProggyStr + chr(13) + ('[ Total Logs: '+IntToStr(TotalLoads*27));
ProggyStr:= ProggyStr + chr(13) + ('[ Time Running: '+TimeRunning);
ProggyStr:= ProggyStr + chr(13) + ('[[[[[[ '+ScriptName+' '+ScriptVersion+' ]]]]]]');
ProggyStr:= ProggyStr + chr(13) + ('[ By: Rasta Magician ]');
ProggyStr:= ProggyStr + chr(13) + ('[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]');
if SaveProggyToFile then
begin
JX2 := ReWriteFile(ScriptPath + 'RM Cutter Proggy.txt', True);
WriteFileString(JX2, ProggyStr);
CloseFile(JX2);
WriteLn('Progress report saved to: '+ScriptPath+'RM Cutter Proggy.txt');
end;
NoRandoms;
for i:=0 to High(Players) do
begin
AddToReport(Players[i].Nick+', '+Players[i].Loc+', '+
IntToStr(Players[i].Level[20])+', '+Players[i].Strings[0]+', '+
IntToStr(Players[i].Integers[0])+', '+
BoolToStr(Players[i].Active));
end;
Disguise(' A: '+IntToStr(HowManyActive)+'/'+IntToStr(Length(Players))+' Logs: '+IntToStr(TotalLoads*27));
end;
function BestAxeToUse: string;
var i:integer;
begin
i:= 1;
Result:='bronze';
if Players[CurrentPlayer].Level[20] > 0 then
begin
if Players[CurrentPlayer].Level[20] > 40 then i:= 5 else
if Players[CurrentPlayer].Level[20] > 30 then i:= 4 else
if Players[CurrentPlayer].Level[20] > 20 then i:= 3 else
if Players[CurrentPlayer].Level[20] > 5 then i:= 2;
case i of
5: Result:='rune';
4: Result:='addy';
3: Result:='mith';
2: Result:='steel';
1: Result:='iron';
end;
end;
RMDebug('Best axe to use: '+Result);
end;
Function WithdrawAxe(AxeName:string): boolean;
var
i, h, bx, by:integer;
begin
if not LoggedIn then exit;
if not BankScreen then exit;
writeln('getting ready to get axe '+AxeName);
Result:=False;
AxeName:=Lowercase(AxeName);
//try wait(1);
if AxeName <> 'best' then
begin
case AxeName of
'bronze': i:= 0;
'iron' : i:= 1;
'steel' : i:= 2;
'black' : i:= 3;
'mith' : i:= 4;
'addy' : i:= 5;
'rune' : i:= 6;
'dragon': i:= 7;
end;
if FindBitmapToleranceIn(srl_GetBitmap(47+i),bx, by, 60, 60, 454, 292, 10) then
begin
MMouse(bx, by, 2, 2);
wait(250);
if IsUpText('axe') then
begin
GetMousePos(bx, by);
Mouse(bx, by, 0, 0, True);
Result := True;
writeln('withdrawn '+AxeName+' axe succesfully.');
end;
end else begin
writeln('could not withdraw the desired axe.');
Result:= False;
end;
end else begin //if they choose best possible
if Players[CurrentPlayer].Level[20] > 0 then
begin
if Players[CurrentPlayer].Level[20] > 40 then i:= 6 else
if Players[CurrentPlayer].Level[20] > 30 then i:= 5 else
if Players[CurrentPlayer].Level[20] > 20 then i:= 4 else
if Players[CurrentPlayer].Level[20] > 5 then i:= 3
end else
i:= 6;
IncEx(i, 47);
for h:= i DownTo 47 do //not including dragon axe because a member might be in f2p
//begin
if not FindBitmapToleranceIn(srl_GetBitmap(h),bx, by, 60, 60, 454, 292, 10) then
Continue
else begin
MMouse(bx, by, 2, 2);
wait(250);
if IsUpText('axe') then
begin
GetMousePos(bx, by);
Mouse(bx, by, 0, 0, True);
Result := True;
writeln('withdrawn '+AxeName+' axe succesfully.');
exit;
end;
end;
//end;
end;
//finally
//try srl_FreeBitmaps; except end;
//end;
end;
Procedure BankIt;
var
x, y, logs, i, t, k, tries:integer;
s, where:string;
begin
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;
NoRandoms;
logs := CountItems(srl_GetBitmap(i), 'bmp', [10]);
if logs = 0 then logs := 27;
wait(150);
RMDebug('counted bitmaps');
end except
logs := 27;
RMDebug('added default 27 logs');
end;
RMDebug('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)
where:= Players[CurrentPlayer].Strings[1];
Relocate('bank');
RMDebug('deciding to drop or store');
if lowercase(Players[CurrentPlayer].Loc) <> 'power' then
begin
for tries:=0 to 9 do
if BankScreen then break else wait(1000);
if BankScreen then s :='tore All'
else writeln('no BankScreen');
end else
s:='rop';
if s = '' then exit;
tries:= 0;
repeat
if (s = 'tore All')and(not BankScreen) then break;
NoRandoms;
if not LoggedIn then exit;
for i:=2 to 28 do
begin
if (s = 'tore All')and(not BankScreen) then break;
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('og') then break;
end;
if not IsUpText('axe') then
begin
GetMousePos(x, y);
Mouse(x, y, 1, 1, False);
Wait(170 + Random(50));
if (ChooseOption(s)) then //here is what were goona change to either bank or drop
Wait(RandomRange(50, 200));
end else //store broken axe, no need to drag, ArrangeInv will take care of it
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;
RMDebug('in drop/store, t: '+IntToStr(t));
RMDebug('in drop/store, tries: '+IntToStr(tries));
if tries >= 3 then break; //failsafe not to drop/bank axe in case it's in middle of inv
until(t = 0);
RMDebug('deciding to get axe');
if lowercase(Players[CurrentPlayer].Loc) <> 'power' then
if Players[CurrentPlayer].Strings[2] <> BestAxeToUse then
begin
RMDebug('withdrawing best axe, Current Axe: '+Players[CurrentPlayer].Strings[2]+' , withdrawing: '+BestAxeToUse)
if WithdrawAxe(BestAxeToUse) then
begin //need to store the other axe
if not Players[CurrentPlayer].Booleans[0] then
begin
case Players[CurrentPlayer].Strings[2] of
'addy' : i:= 51;
'mith' : i:= 50;
'steel' : i:= 49;
'iron' : i:= 48;
'bronze': i:= 47;
end;
if FindBitmapToleranceIn(srl_GetBitmap(i), x, y, MIX1, MIY1, MIX2, MIY2, 10) then
Mouse(x, y, 2, 2, True);
end;
Players[CurrentPlayer].Strings[2] := BestAxeToUse; //although it might not
//be true because you don't have it, you are still using the best axe you can.
end;
end;
for t:= 0 to 3 do
if BankScreen then
CloseBank;
Proggy;
if s ='tore All' then Inc(Banks);
if not (LoadsDone >= LoadsWanted) then
Relocate(where);
end;
procedure InactiveMove;
var x, y, i, h:integer;
begin
RMDebug('Inactive Move');
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
RMDebug('Anti-Ban');
i := Random(14);
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: HoverSkill('random', False);
12, 13: PickUpMouse;
end;
GameTab(4);
end;
end;
Function ScanColors: TIntegerArray;
var
x, y, i, h, j, k:integer;
r, g, b:integer;
RMColors, GoodColors:TIntegerArray;
p: TPointArray;
begin
j := 0;
GetMousePos(x, y);
SetArrayLength(RMColors, 441);
for i:=x-10 to x+10 do //getting all the colors
begin
wait(10);
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, 1);
for i:= 0 to h do //checking out which colors are good;
begin
if k > 7 then break;
wait(10);
ColorToRGB(RMColors[i], r, g, b);
if SimilarColors(RMColors[i], 2772296, 13) then
if InRange((r-g), -30, 20) then
if InRange((r-b), 5, 55) then
if InRange((g-b), 10, 60) then
begin
FindColorsSpiralTolerance(x, y, p, RMColors[i], MSX1, MSY1, MSX2, MSY2, 0);
j := Length(p);
wait(50);
if (j > 0)and(j < 30) then
begin
GoodColors[k]:= RMColors[i];
Inc(k);
SetArrayLength(GoodColors, k+1);
end;
end;
end;
if Length(GoodColors) > 7 then SetArrayLength(GoodColors, 7);
Result:=GoodColors;
end;
Function ChooseAnyTree:boolean;
var x, y:integer;
begin
RMDebug('Choosing Any Tree');
RMDebug('Current tree: '+Players[CurrentPlayer].Strings[0]);
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';
RMDebug(' chose: '+ Players[CurrentPlayer].Strings[0]);
end else
Result:=False;
end;
procedure AutoColorTree(name:string);
var
i, x, y, t: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
if AllTIA[i][0] <> 0 then
begin
RMDebug('already AutoColored');
exit;
end;
Found:= False;
RMDebug('autocoloring '+name);
for t:= 0 to 2 do
begin
NoRandoms;
if not LoggedIn then break;
if FindObjTPA(x, y, 2772296, 10, -1, 7, 7, 15, [ name ]) then
begin
wait(750);
if IsUpText(name) then
begin
AllTIA[i]:=ScanColors;
if AllTIA[i][0] <> 0 then Found:=True;
end;
end;
end;
if not Found then
if not ChooseAnyTree then
begin
Logout;
RMDebug('could not find any tree at all!');
Inc(Players[CurrentPlayer].Integers[1]);
exit;
end;
wait(1000);
if UseDebug then
try
writeln(name+' color: '+IntToStr(AllTIA[i][0]));
except 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
RMDebug('text is up, '+text[m]);
FoundIt:=True;
break;
end;
end;
if FoundIt then
begin
GetMousePos(x, y);
wait(350);
if FindEnt(x, y, False) then
begin
Result := False;
Inc(EntsAvoided);
wait(1000);
MMouse(0, 0, MSX2, MSY2);
RMDebug('Didn''t click ent at: '+IntToStr(x)+', '+IntToStr(y));
exit;
RMDebug('exited');
end;
RMDebug('Clicking tree at: '+IntToStr(x)+', '+IntToStr(y));
Mouse(x, y, 1, 1, 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;
wait(25);
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;
if Length(Find[k].Colors) < 1 then
begin
writeln(' not possible to use 0 colors for SmartColorCustom');
AutoColorTree(name);
Result:=False;
exit;
end;
wait(25);
{autocoloring} //i think that here i'll just use the best color in the array
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;
wait(25);
end;
FFlag(0);
Wait(50);
RMDebug('Finding '+name);
l:=GetArrayLength(Find[k].Colors); //Checks known colors first
if l>0 then
begin
for i:= 0 to l-1 do
begin
RMDebug('finding color: '+IntToStr(Find[k].Colors[i]));
FindColorsSpiralTolerance(MSCX,MSCY,p,Find[k].Colors[i],MSX1,MSY1,MSX2,MSY2,0);
m:=GetArrayLength(p);
wait(75);
if m>0 then
begin
if m > 30 then Continue;
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
wait(75);
if j >= 3 then break; //only wanna look for 3 colors with tol
RMDebug('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
wait(25);
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
wait(20);
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
wait(10);
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;
RMDebug(IntToStr(ClickColor)+' added to '+name+' array');
end;
exit;
end;
end;
end;
end;
end;
end;
procedure CutTrees; forward;
Function CheckAxe(StringArray: TStringArray):boolean;
var s:string;
begin
Result:=True;
if (Pos('do not have an axe', StringArray[7]) > 0) or
(Pos('do not have an axe', StringArray[8]) > 0) or
(Pos('need an axe to chop', StringArray[7]) > 0)or
(Pos('need an axe to chop', StringArray[8]) > 0)then
begin //Withdraw Axe
RMDebug('axe broke');
if lowercase(Players[CurrentPlayer].loc) <> 'power' then
begin
RMDebug('trying to get new axe');
try s:= Players[CurrentPlayer].Strings[1];
Relocate('bank');
Deposit(1, 28, True);
if WithdrawAxe('best') then exit;
finally Relocate(s) end;
end;
RMDebug('didn''t get axe, goin to false');
Players[CurrentPlayer].Active := False;
Players[CurrentPlayer].loc := 'No Axe';
LogOut;
Result := False;
end;
end;
procedure RunAwayEnt;
var
Rx, Ry, RBoolx, RBooly:integer;
begin
if not LoggedIn then exit;
RMDebug('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);
FFlag(0);
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);
var
x, y, x1, x2, x3, y1, y2, y3, i:integer;
TPA: TPointArray;
TP:TPoint;
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);
RMDebug('getting to tree '+name);
if (abs(MSCX - x)>30) then
if x > MSCX then //tree is to the right
begin
RMDebug('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
RMDebug('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
RMDebug('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
RMDebug('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
RMDebug('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
RMDebug('y: tree is in the middle');
y1 := MSCY-40;
y2 := y1 +80;
end;
FFlag(0);
wait(500+Random(100));
RMDebug('decided where tree should be');
if FindColorsTolerance(TPA, 2772296, x1, y1, x2, y2, 11) then
begin
TP := MiddleTPA(TPA);
MMouse(TP.x, TP.y, 0, 0);
wait(500);
if not IsUpText(Capitalize(name)) then exit;
end else exit;
wait(100);
if InvFull then BankIt;
WaitUntilCut(name);
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;
name := lowercase(name)
AutoColorTree(name);
case 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, j, k, t, CheckSpot, CutMark:integer;
p:TPointArray;
TP: TPoint;
Found : boolean;
TSA:TStringArray;
begin
if not LoggedIn then exit;
RMDebug('waiting until cut');
wait(500);
MarkTime(CutMark);
GetMousePos(x, y);
if FindEnt(x, y, False) then
begin
RunAwayEnt;
exit;
end;
if (Pos('Ent', GetBlackChatMessage) > 0) then
begin
RunAwayEnt;
exit;
end;
wait(350);
MarkTime(t);
repeat
NoRandoms;
wait(250);
if not LoggedIn then break;
if InvFull then
begin
wait(110);
BankIt;
MarkTime(CutMark);
exit;
end;
TSA:=ChatsBlackText;
if not CheckAxe(TSA) then exit;
wait(600);
NoRandoms;
if (Pos('Ent', TSA[8]) > 0) then
begin
RunAwayEnt;
exit;
end;
if (Pos('swing your axe', TSA[7]) > 0)or
(Pos('swing your axe', TSA[8]) > 0)or
(Pos('get some', TSA[8]) > 0)then
begin
RMDebug('found TSA');
break;
end;
if name = 'tree' then
if (Pos('get some', TSA[8]) > 0) then
exit;
if (TimeFromMark(t) > 3000) then
begin
wait(100);
RMDebug('tree took too long');
Exit;
end;
until(false);
RMDebug('cutting tree');
GetMousePos(x, y); //let's keep our mouse over the tree now.
wait(400);
MarkTime(SpotMark);
CheckSpot := NextSpot;
repeat
if not LoggedIn then exit;
wait(300);
Found:=False;
if IsUpText('hop') then
begin
Found := True;
RMDebug('Found, checking Ent');
if FindEnt(x, y, False) then
begin
RunAwayEnt;
exit;
end;
wait(400);
end else
begin
RMDebug('tree seems to be gone..?');
wait(350);
GetMousePos(x, y);
FindColorsSpiralTolerance(x, y, p, 2772296, x-5, y-5, x+5, y+5, 10);
j := High(p);
if j > 0 then
if j > 10 then
begin
if (name='tree') then
if (GetBlackChatMessage = 'You get some logs.') then
exit;
Found := IsUpText('hop');
if Found then break;
TP := MiddleTPA(p)
MMouse(TP.x, TP.y, 0, 0);
wait(250);
Found := IsUpText('hop');
if Found then break;
wait(250);
end;
if not Found then exit;
RMDebug('found it');
end;
NoRandoms;
wait(350);
if InvFull then
begin
wait(250);
BankIt;
MarkTime(CutMark);
exit;
end;
wait(300);
if (name='tree') then
if (GetBlackChatMessage = 'You get some logs.') then
exit;
wait(250);
if ExistsItem(CheckSpot) then
begin
CheckSpot := NextSpot;
wait(50);
MarkTime(SpotMark);
end;
wait(450);
if (TimeFromMark(SpotMark) > 30000) then
begin
wait(300);
RMDebug('Not Cutting...');
if IsUpText(Capitalize(name)) then
begin
GetMousePos(x, y);
if FindEnt(x, y, False) then
begin
RunAwayEnt;
exit;
end else begin
Mouse(x, y, 0, 0, True);
MarkTime(CutMark);
end;
end else
exit;
end;
wait(600);
GetMousePos(x, y);
if FindEnt(x, y, False) then
begin
RunAwayEnt;
exit;
end;
wait(350);
if (TimeFromMark(CutMark) > 45000) then
begin
InactiveMove;
MarkTime(CutMark);
end;
wait(200);
until(not Found);
RMDebug('tree gone');
end;
procedure PlayerSetup;
var
AllGood:boolean;
s1, s2:string;
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;
if (GetSkillLevel('woodcutting') > Players[CurrentPlayer].Level[20]) then
Players[CurrentPlayer].Level[20] := GetSkillLevel('woodcutting');
Players[CurrentPlayer].Level[8] := GetSkillLevel('hp');
Players[CurrentPlayer].Level[1] := GetSkillLevel('attack');
RMDebug('adjusting brightness');
SetBar('brightness', 4);
if FindAxe then
begin
//find out what axe we're usign through the debug
s2:=GetDebugLine(GetDebugLineCount-1);
s2:= lowercase(s2);
s1 := Between('using ', ' axe', s2)
Players[CurrentPlayer].Booleans[0] := EquipAxe;
Players[CurrentPlayer].Strings[2] := s1;
RMDebug('got axe from debug: '+Players[CurrentPlayer].Strings[2]);
wait(500+Random(1000));
SetAngle(True);
AllGood := True;
end else
if lowercase(Players[CurrentPlayer].Loc) <> 'power' then
begin
if OpenBankFast(LocToBank) then
begin
repeat
FixBank;
until(not (GetColor(475, 75) = 1777699))
if not WithdrawAxe('best') then
begin
CloseBank;
LogOut;
NextPlayer(False);
end else
CloseBank;
end else NextPlayer(False);
end else // need to open bank
NextPlayer(False);
until(AllGood);
GameTab(4);
end;
procedure ScriptSetup;
var i:integer;
begin
SetupSRL;
writeln('setting up script');
if UseSrlPlayerForm then
begin
SRLPlayerForm(True, [], [], ['Tree Type - Tree, Oak, Willow, Yew'], [])
end else
DeclarePlayers;
if UseResponder then SetupRespond;
for i:=0 to High(Players) do
begin
Players[i].Strings[1] := 'bank';
Players[i].Loc := 'Power';
end;
ScriptID := '709';
SRLID := YourSRLID;
SRLPassword := YourSRLPass;
SetupPath;
DeclarePaths;
ActivateClient;
wait(2500);
LoginPlayer;
if not LoggedIn then LoginPlayer;
wait(3000);
PlayerSetup;
end;
procedure CutTrees;
var i:integer;
begin
NoRandoms;
if not (LoadsDone >= LoadsWanted) then
begin
Relocate(Players[CurrentPlayer].Strings[0]);
repeat
if Not LoggedIn then Exit;
NoRandoms;
wait(Random(1000));
if InvFull then BankIt;
if LoadsDone >= LoadsWanted then break;
if FindTree(Players[CurrentPlayer].Strings[0]) then
begin
wait(500);
Players[CurrentPlayer].Integers[1] := 0;
i:=0;
wait(300);
GetToTree(Players[CurrentPlayer].Strings[0]);
if lowercase(Players[CurrentPlayer].Loc) = 'fally' then
if lowercase(Players[CurrentPlayer].Strings[0]) = 'oak' then
begin
FindTree('tree');
wait(500);
GetToTree(Players[CurrentPlayer].Strings[0]);
Relocate('oak');
end;
end else
begin
writeln('couldnt find tree');
NoRandoms;
wait(3000);
if (i mod 2) = 0 then InactiveMove;
inc(i);
if i > 1 then
if lowercase(Players[CurrentPlayer].Loc) = 'fally' then
if lowercase(Players[CurrentPlayer].Strings[0]) = 'tree' then
if lowercase(Players[CurrentPlayer].Strings[1]) = 'oak' then
Relocate('tree') else Relocate('oak')
end;
if i >= 5 then //this could go inside the previous if
begin
NoRandoms;
writeln('pretty sure there are no damn trees around.');
LoadsDone := LoadsWanted + 1;
Inc(Players[CurrentPlayer].Integers[1]);
if not Relocate('bank') then
if not ChooseAnyTree then
Players[CurrentPlayer].Active := False
else
CutTrees;
if Players[CurrentPlayer].Integers[1] >= 2 then
begin
if not ChooseAnyTree then
Players[CurrentPlayer].Active := False
else
CutTrees;
end;
exit;
end;
until(False);
end;
end;
procedure ScriptTerminate;
var RMI: integer;
begin
writeln('Script Terminate');
srl_FreeBitmaps;
Proggy;
if SaveDebugToFile then
begin
writeln(ProggyStr);
RMI := ReWriteFile(ScriptPath + 'RM Cutter Debug.txt', True);
WriteFileString(RMI, GetDebugText);
CloseFile(RMI);
end;
end;
var i:integer;
begin
ClearDebug;
SetupSRL;
Intro;
//SetupSmart;
ScriptSetup;
repeat
ActivateClient;
if (not loggedIn) then break;
writeln('cut trees');
CutTrees;
if LoggedIn then Relocate('bank');
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);
PlayerSetup;
until(false);
writeln('Script Stopping. Thank you for using RM Cutter! Please Post Proggie!');
DisGuise('Done.');
end.
There are currently 1 users browsing this thread. (0 members and 1 guests)