SCAR Code:
program Fletcher;
{.include SRL\SRL.scar}
//SIMPLE FLETCHER
//Start near bank slot (Varrock West Recommended)
//Logs in first few bank slots
//Knife first inv
//Make sure you have knife idiot!
Const
{******************* Overall Maximum Values (Not per player) *******************
************** Script finishes when any max limit has been reached. ************
***************************** enter 0 for infinite ****************************}
TCut = 0; //Total number of bows to be cut
TTime = 0; //Total time wanted on script
{***************************** Change Player after *****************************
********** Player will bank and change when any value has been reached. ********
**************************** default value are best ****************************
***************************** enter 0 for infinite ****************************}
SCut = 0; //Total number of bows to be cut
STime = 0; //Total time wanted on script
{ ******************************************
**************** SRL STATS ****************
*******************************************}
UseSRL = False; //Do you want to record your stats?
YourID = '';
YourPass = '';
{******************************************
**************** Colors *******************
*******************************************}
MBank = 1365734; //The bank icon in minimap if lost (probably wont happen)
Bank1 = 5534076;
Bank2 = 2635324;
Bank3 = 8162716;
//If all else fails...
BlindX = 274;
BlindY = 114;
var BankX, BankY, Log, x, y, MyBanks, antis, TotalTime, lvls, Loads: Integer;
var Banker, Booth, StoreAll, WithdrawAll, Examine, MakeX: Integer;
Procedure DeclarePlayers;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Integers[0] := 0; // 0 = AUTO, 1 = ShortBow, 2= LongBow
Players[0].Active := True;
end;
procedure Ln(Text:String);
begin
WriteLn(Players[CurrentPlayer].Name + ': ' + Text);
end;
function TotalCut: Integer;
var i, x: integer;
begin
for i := 0 to HowManyPlayers - 1 do
begin
x := x + Players[i].Integers[1];
end;
result := x;
end;
procedure SRLRep;
begin
SRLRandomsReport;
end;
procedure Report;
begin
ClearReport;
if(UseSRL) then SRLRandomsReport;
//Ln('Gathering Report');
AddToReport('#########################');
AddToReport('# Pro Fletcher #');
AddToReport('# v 1.5 #');
AddToReport('# Players: ' + intToStr(HowManyPlayers));
AddToReport('# Current: ' + Players[CurrentPlayer].Name);
AddToReport('# Running: ' + TimeRunning);
AddToReport('# Cut: ' + intToStr(Players[CurrentPlayer].Integers[1]));
AddToReport('# Total: ' + intToStr(TotalCut));
AddToReport('# Loads: ' + intToStr(Loads));
AddToReport('# Banks: ' + intToStr(MyBanks));
AddToReport('# AntiBans: ' + intToStr(antis));
AddToReport('# Gained: ' + intToStr(lvls));
AddToReport('# Level: ' + intToStr(Players[CurrentPlayer].level[13]));
AddToReport('#########################');
if(TCut > 0) and (TotalCut >= TCut) then TerminateScript;
if(SCut > 0) and (Players[CurrentPlayer].Integers[1] >= SCut) then Logout;
end;
function FindFastRandoms: Boolean; //By WT-Fakawi.
var
i: Integer;
begin
for i := 1 to 6 do
begin
case I of
1: if FindDead then
Result := True;
2: if FindMod then
Result := True;
3: if FindQuiz then
Result := True;
4: begin
if InBlack then
begin
Result := True;
ln('In Black');
Players[CurrentPlayer].loc := 'InBlack';
Logout;
Exit;
end;
end;
5: RC;
end;
end;
end;
///////////////////////////////////////////////////////////////////////////
procedure FindRandoms;
begin
ln('Findind Fast Randoms...');
FindFastRandoms;
ln('Finding Normal Randoms...');
FindNormalRandoms;
end;
procedure NoRandoms;
begin
{ln('Searching for randoms');
FindNormalRandoms;
FTWait(4);
If FindFight Then
Begin
ln('Found fight, running');
RunAway('N', True, 1, 5000 + Random(5000));
End;
If ClickToContinue Then ClickContinue(True, True);
If FindMod Then
Begin
Ln('Found a Moderator... Do nothing, he wont realise!');
End;
FindNormalRandoms;}
end;
procedure ActHuman(MS: Integer);
var Started, MoS, q: Integer;
begin
IncEx(antis, 1);
IncEx(ReportVars[4], 1);
Report;
q := 0;
ln('Acting human #' + intToStr(antis) + ' for ' + intToStr(MS) + ' ms');
MoS := MouseSpeed;
MouseSpeed := 10;
MarkTime(Started);
repeat
q := q + 1; if(q = 2) then q := 0;
if(q = 0) then NoRandoms;
MouseSpeed := 10 + random(15);
if(random(3) = 0) then MMouse(random(1000), random(900), 1, 1);
Case random(14) of
0: Mouse(random(772), random(490), 1, 1, false);
1: SleepAndMoveMouse(500 + random(750));
3: MouseItem(random(InvCount) + 1, false);
4: begin
ln('Examine random');
MouseItem(random(InvCount) + 1, false);
Wait(100);
if(FindBitmap(Examine, x, y)) then Mouse(x, y, 1, 1, True);
if(random(10) = 1) then
begin
ln('Shake over examine text');
MouseSpeed := 28;
MMouse(13, 446, 2, 2);
MMouse(178, 450, random(2), random(2));
MMouse(13, 446, random(2), random(2));
MMouse(178, 450, random(2), random(2));
MMouse(13, 446, random(2), random(2));
MMouse(178, 450, random(2), random(2));
MMouse(13, 446, random(2), random(2));
MMouse(178, 450, random(2), random(2));
MouseSpeed := 10;
end;
end;
5,11,12: begin
ln('Random Gametab');
GameTab(1 + random(11));
Wait(500 + random(1200));
GameTab(4);
end;
6, 7, 13: HoverSkill('fletching', false);
8: RandomRClick;
9,10: HoverSkill('random', false);
end;
until(TimeFromMark(Started) >= MS)
ln('ActHuman expired');
MouseSpeed := MoS;
end;
procedure GetLevels;
var lvl: integer;
begin
ln('Finding stat');
lvl := GetSkillInfo('fletching',False);
if(lvl > Players[CurrentPlayer].level[13]) then
begin
if(Players[CurrentPlayer].level[13] > 0) then
begin
ln('Leveled from ' + intToStr(Players[CurrentPlayer].level[13]) + ' to ' + intToStr(lvl) + '!');
IncEx(lvls, 1);
IncEx(ReportVars[5], 1);
end;
Players[CurrentPlayer].level[13] := lvl;
end;
Ln('Player has fletching: ' + intToStr(Players[CurrentPlayer].level[13]));
end;
procedure ReLocate;
var mX, mY: integer;
begin
ln('Relocating to bank..');
ln('Finding bank sumbol');
if(FindColor(mX, mY, MBank, MMX1, MMY1, MMX2, MMY2)) then Mouse(mX,mY, 5, 3,True);
Flag;
end;
procedure GetBankPos;
begin
ln('Finding bank position');
if(not FindObj(BankX, BankY, 'ank', Bank1, 2)) then
begin
Ln('Bank1 not found; Try Bank2');
if(not FindObj(BankX, BankY, 'ank', Bank2, 5)) then
begin
Ln('Bank2 not found; Try Bank3');
if not(FindObj(BankX, BankY, 'ank', Bank3, 15) = False) then
begin
Ln('Bank3 not found; Blind Mouse!');
BankX:= BlindX;
BankY:= BlindY;
end else ln('Bank found at ' + intToStr(BankX) + ',' + intToStr(BankY));
end else ln('Bank found at ' + intToStr(BankX) + ',' + intToStr(BankY));
end else ln('Bank found at ' + intToStr(BankX) + ',' + intToStr(BankY));
end;
procedure SetupPlayer;
begin
Ln('Setting up player consts');
If(Players[CurrentPlayer].Integers[0] = 0) then getLevels;
SetAngle(True);
GetBankPos;
end;
function GetLog(UpText: String): LongInt;
begin
if(Pos('ak', UpText) > 0) then result := 1;
if(Pos('illow', UpText) > 0) then result := 2;
if(Pos('aple', UpText) > 0) then result := 3;
if(Pos('ew', UpText) > 0) then result := 4;
if(Pos('agic', UpText) > 0) then result := 5;
if not(result > 0) then result := 0;
end;
procedure FletchWait;
var i, q, item: integer;
cancelIt: boolean;
up: string;
begin
q := 0;
for i:=2 to 28 do
begin
q := q + 1; if(q = 3) then
begin
q := 0;
end;
if not(cancelIt) then
begin
if(q = 0) then NoRandoms;
if not(ExistsItem(i)) then Break;
MarkTime(item);
MMouseItem(i);
wait(150);
if(IsUpText('ogs')) then
begin
up := rs_getuptext;
repeat
wait(100);
if(random(5) = 0) then ActHuman(5000);
MMouseItem(i)
if (IsUpText('ogs')) and(TimeFromMark(item) > 10000) then cancelIt := True;
if(cancelIt) then Ln('Fletching canceled; 10 Seconds exceeded');
until(isUpText('ogs')=false) or (cancelIt);
if not(isUpText('ogs')) then
begin
IncEx(Players[CurrentPlayer].Integers[1], 1);
IncEx(ReportVars[2], 1);
end;
end else
begin
IncEx(Players[CurrentPlayer].Integers[1], 1);
IncEx(ReportVars[2], 1);
end;
end;
end;
IncEx(loads, 1);
IncEx(ReportVars[1], 1);
end;
procedure AutoFType;
var EndType: LongInt;
begin
EndType := 0;
Ln('Determining best bow to cut..');
Ln('Level: ' + IntToStr(Players[CurrentPlayer].level[13]));
Case log of
0: begin
Ln('Log: Tree');
if(Players[CurrentPlayer].level[13] > 9) then EndType := 2;
if(Players[CurrentPlayer].level[13] < 10) then EndType := 1;
end;
1: begin
Ln('Log: Oak');
if(Players[CurrentPlayer].level[13] > 24) then EndType := 2;
if(Players[CurrentPlayer].level[13] < 25) then EndType := 1;
end;
2: begin
Ln('Log: Willow');
if(Players[CurrentPlayer].level[13] > 39) then EndType := 2;
if(Players[CurrentPlayer].level[13] < 40) then EndType := 1;
end;
3: begin
Ln('Log: Maple');
if(Players[CurrentPlayer].level[13] > 54) then EndType := 2;
if(Players[CurrentPlayer].level[13] < 55) then EndType := 1;
end;
4: begin
Ln('Log: Yew');
if(Players[CurrentPlayer].level[13] > 69) then EndType := 2;
if(Players[CurrentPlayer].level[13] < 70) then EndType := 1;
end;
5: begin
Ln('Log: Magic');
if(Players[CurrentPlayer].level[13] > 84) then EndType := 2;
if(Players[CurrentPlayer].level[13] < 85) then EndType := 1;
end;
end;
Case EndType of
1: Mouse(110 + random(5), 417 + random(5), 5, 5, false);
2: Mouse(253 + random(5), 421 + random(5), 5, 5, false);
0: begin
Ln('Level not high enough? NextPlayer;.');
Logout;
end;
end;
end;
function OpenMyBank: Boolean;
begin
IncEx(MyBanks, 1);
IncEx(ReportVars[3], 1);
Mouse(BankX, BankY, 1, 1, False);
if(FindBitmap(Banker, x, y))then //finds the bitmap
begin
Ln('String: Bank Banker'); //sends a message if the bitmap is found
Mouse(x, y + random(5), 1, 1, True); //left clicks the bitmap
result := True;
exit;
end;
if(FindBitmap(Booth, x, y))then //finds the bitmap
begin
Ln('String: Bank Booth'); //sends a message if the bitmap is found
Mouse(x, y, 1, 1, True); //left clicks the bitmap
result := True;
exit;
end else
begin
Ln('Banker or Booth not found!');
Ln('Blind Mouse'); //sends a message if the bitmap is found
Mouse(BlindX, BlindY, 1, 1, False); //blind right click
if(FindBitmap(Banker, x, y))then //finds the bitmap
begin
Ln('String: Bank Banker'); //sends a message if the bitmap is found
Mouse(x + random(100), y, 1, 1, True); //left clicks the bitmap
result := True;
exit;
end;
if(FindBitmap(Booth, x, y))then //finds the bitmap
begin
Ln('String: Bank Booth'); //sends a message if the bitmap is found
Mouse(x, y, 1, 1, True); //left clicks the bitmap
result := True;
exit;
end else result := false;
end;
end;
function TakeLogs: Boolean;
var Z: Integer;
begin
GameTab(4);
ln('Opening Bank..');
if not(OpenMyBank) then
begin
ln('Bank not found.. Relocating to nearest bank symbol');
ReLocate;
GetBankPos;
wait(1000);
OpenMyBank;
end;
MarkTime(Z);
repeat
wait(500);
until(TimeFromMark(Z) > 10000) or (Bankscreen);
ln('Bank took ' + IntToStr(TimeFromMark(Z)) + ' ms');
FixBank;
wait(800);
if(ExistsItem(2)) then
begin
Mouse(620, 231, 3, 3, false);
wait(400);
if(FindBitmap(StoreAll, x, y))then //finds the bitmap
begin
ln('Storing from slot 2');
Mouse(x + random(100), y, 1, 1, True); //left clicks the bitmap
end else Ln('"Store All" not found!');
wait(500);
end else Ln('Nothing to store');
MMouse(91, 78, 1, 1);
wait(500);
if(IsUpText('ogs')) then
begin
ln('Detecting log');
log := GetLog(rs_GetUpText);
Mouse(91, 78, 1, 1, False);
Wait(800);
ln('Withdrawing logs');
if(FindBitmap(WithdrawAll, x, y))then //finds the bitmap
begin
Mouse(x + random(100), y, 1, 1, True); //left clicks the bitmap
end else Ln('"Withdraw All" not found!');
wait(600);
ln('Closing bank');
CloseBank;
result := true;
end else
begin
Ln(rs_getUptext + ' is not a log');
ln('Closing Bank');
CloseBank;
result := false;
end;
CloseBank;
end;
procedure loop;
var Timer, MyTime:Integer;
begin
MarkTime(MyTime);
repeat
if(STime > 0) and (TimeFromMark(MyTime) >= ((STime / 1000) / 60)) then Exit;
if(TTime > 0) and (TimeFromMark(TotalTime) >= ((TTime / 1000) / 60)) then TerminateScript;
ln('Writing report - Please Wait');
Report;
ln('Focusing window');
Mouse(483, -75, 0, 0, True);
if not LoggedIn then Exit;
NoRandoms;
ln('Finding bank');
GetBankPos;
wait(700);
ln('Retreiving logs from bank');
if not(TakeLogs) then exit;
wait(500);
ln('Select Knife');
MouseItem(1, true);
wait(500);
ln('Select Log');
MouseItem(random(InvCount - 1) + 2, true);
MarkTime(Timer);
repeat
wait(100);
until(GetColor(483, 372) = 7238703) or(TimeFromMark(Timer) > 5000);
if(GetColor(483, 372) = 7238703) then
begin
Case Players[CurrentPlayer].Integers[0] of
1: Mouse(110 + random(5), 417 + random(5), 1, 1, false);
2: Mouse(253 + random(5), 421 + random(5), 1, 1, false);
3: Mouse(407 + random(5), 423 + random(5), 1, 1, false);
0: AutoFType;
end;
wait(500);
if(FindBitmap(MakeX, x, y))then //finds the bitmap
begin
Mouse(x + random(100), y, 1, 1, True); //left clicks the bitmap
end else Ln('"Make X" not found!');
Timer := 0;
MarkTime(Timer);
repeat
wait(100);
if(GetColor(2258, 430) = 8388608) then
begin
Break;
Ln('Found color of *');
end else if(TimeFromMark(Timer) > 1000) then Break;
until(GetColor(258, 429) = 8388608);
if(GetColor(258, 429) = 8388608) then
begin
Ln('* Found');
ln('Typing X Ammount');
case random(5) of
0: TypeSend(intToStr(27 + random(500)));
1: TypeSend(intToStr(111));
2: TypeSend(intToStr(100));
3: TypeSend(intToStr(99));
4: TypeSend(intToStr(999));
5: TypeSend(intToStr(50));
end;
ln('Has began fletching');
FletchWait;
Ln('Adding values');
Report;
if(UseSRL) then SRLRep;
end else Ln('"X" Interface lost');
end else Ln('Interface lost, misclick on bank?');
If(Players[CurrentPlayer].Integers[0] = 0) then getLevels;
ln('Repeat');
until(not LoggedIn);
end;
procedure ScriptTerminate;
begin
Ln('Ending script');
WriteLn('####################################');
WriteLn('####################################');
Writeln('# Thankyou for using Pro Fletcher! #');
WriteLn('####################################');
WriteLn('####################################');
if(UseSRL) then SRLRep;
Report;
end;
begin
ClearDebug;
ClearReport;
SetupSRL;
ScriptID := '913';
if(UseSRL) then
begin
SRLID := YourID;
SRLPassword := YourPass;
end;
Writeln('Setting up Bitmaps');
Banker := BitmapFromString(25, 2, 'beNr7/x8ZMIBBbIg7ECGLQ' +
'0TQBLGKQ0xAlsUvDpFCFwcAHVRkOg==');
Booth := BitmapFromString(150, 2, 'beNqlUkEOwCAI6+/2gV33/2c' +
'4NjJEGIiRcKgNQrEC7Q0A13lQNhXMCMk1ph4udA1FdLeCjQDpmav6' +
'7fBIJfLjNe5HybGG17D8KCYflAuoYNNBS/L76pf3trZY+dTxfQcr/' +
'2rVwYlTEVbWrA7ad7DjG3uFo54=');
StoreAll := BitmapFromString(57, 1, 'beNpjYIgNcf8PBnAGAxggc' +
'4FsCEIWwcVGUwkHcCmsphE2HAAUfVYX');
WithdrawAll := BitmapFromString(78, 1, 'beNr7/x8CGBgYMBmxIe4QN' +
'pABZzPAAFwEWRdEJbJiTNPghqCZidUurFxMW5BNQDMZygYADhqE7w' +
'==');
Examine := BitmapFromString(54, 1, 'beNoLcY8Ncf8PBgwMDEA2Go' +
'JLIcv+RwUQKTgbk4FmBbKZBNXEAgDq5Vo2');
MakeX := BitmapFromString(46, 5, 'beNp9UskNACAIYzsX8Ov+Y6iR' +
'hFQKbXyQclPnWHPsBzNj43ojwOEMZyU+kfwiPbogeW13IYMpWB87R' +
'sEuuByDA9IFmNk/sGnaq1xBTyL6dgXLWwlp+PisS6e4nqSzWTIDiB' +
'/y2Qdr83wv');
DeclarePlayers;
WriteLn('####################################');
WriteLn('####################################');
Writeln('# Thankyou for using Pro Fletcher! #');
WriteLn('####################################');
WriteLn('####################################');
if not (LoggedIn) then LoginPlayer;
IncEx(ReportVars[0], 1);
MarkTime(TotalTime);
repeat
if not (LoggedIn) then LoginPlayer;
SetupPlayer;
Ln('Running loop');
Loop;
Ln('Loop stopped, next please..');
Logout;
NextPlayer(True);
until(false);
TerminateScript;
end.