SCAR Code:
procedure BankLogs;
begin
if(not(LoggedIn))then
Exit;
if ((InvFull) or (BrokenAxe)) then
begin
MakeCompass('W')
Wait(200+random(200))
LowestAngle;
Attempts:= 0;
GameTab(4)
if (BrokenAxe) then
begin
if(Players[CurrentPlayer].Boolean1)then //Switches to Equip Tab if Boolean1
GameTab(5) //Is True, Looks for Broken Axe, If
if(not(FindDTM(BrokenAxeDTM,x,y, MIX1, MIY1, MIX2, MIY2))) then //Not found then stops replacing axe
begin
BrokenAxe:=False;
Exit;
if (TabExists(5) and (FindDTM(BrokenAxeDTM,x,y, MIX1, MIY1, MIX2, MIY2))) then
begin
MMouse(x,y,3,3) //Just Removes The Axe If is still equiped
if IsUpText('emove') then
Mouse(x,y,3,3,True)
end
end;
repeat
OpenBankQuiet('db') //Tries Opening the bank 10
Wait(300+random(300)) //Time, If it Fails, It will
Randomz; //Switch Players
Attempts:=Attempts + 1;
until (BankScreen) or (Attempts >= 10)
if (Attempts >= 10) then
begin
writeln('Took too many tries in finding bank.')
writeln('Switching Players.')
NextPlayer(False)
end;
if (BankScreen) then
begin
if FindDTM(WillowInv,x,y,MIX1,MIY1,MIX2,MIY2)then
begin
Writeln('Storing All Willows') // Stores All Willows
Mouse(x,y,3,3,False)
wait(200+random(200))
ChooseOption(x, y, 'All')
wait(300+random(300))
end;
if ((BrokenAxe) and (Bankscreen)
and (FindDTM(BrokenAxeDTM,x,y,MIX1,MIY1,MIX2,MIY2))) then
begin
Writeln('Storing the broken axe') //Stores the Broken Axe
Mouse(x,y,3,3,False)
wait(300+random(300))
ChooseOption(x,y,'ore 1')
wait(400+random(100))
FixBank;
if (FindDTM(AxeDTM,x,y,MSX1,MSY1,MSX2,MSY2)) then
begin
Writeln('Found a new axe, going to withdraw') //Withdraws a new axe
Mouse(x,y,3,3,False)
wait(200+random(200))
ChooseOption(x,y,'ithdraw 1')
wait(200+random(100))
end else
begin
Writeln('Could not find another axe, Switching Players')
NextPlayer(False)
end;
end;
CloseBank;
if (BrokenAxe) then
begin
if(Players[CurrentPlayer].Boolean1)then
begin //This Will Wield the axe if
Writeln('You chose to wield axe, will do') //Boolean1 is set to True
FindDTM(AxeDTM,x,y,MIX1,MIY1,MIX2,MIY2) //Also Sets Broken Axe to False
Mouse(x,y,3,3,False) //Since we have finished
wait(300+random(200)) //Replacing The Axe
ChooseOption(x,y,'ield')
Wait(300+random(200))
end
WAxes:= WAxes + 1;
BrokenAxe:=False;
end;
wait(300+random(300))
MakeCompass('N')
wait(500+random(300))
HighestAngle;
wait(300+random(300))
Randomz;
LoadsA:= LoadsA + 1;
LoadsB:= LoadsB + 1;
end;
end;
end;
///////////////////////////////////////////////////////////////////////////////
///////////////Main Loop///////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
begin
SetupSrl;
DeclarePlayers;
LoadsA := 0;
LoadsB := 0;
Ents := 0;
WAxes:= 0;
ActivateClient;
LoginPlayer;
repeat
ToWillows;
CutWillows;
ToBank;
BankLogs;
AntiBanning;
Progress;
SRLRandomsReport;
if(LoadsB=Loads)then
begin
NextPlayer(True);
Wait(300+random(100))
LoadsB:=0;
HighestAngle;
MakeCompass('N');
end;
until (false)
end.
SCAR Code:
program KryptsWilloKiller;
{.include SRL/SRL.scar}
{.include SRL/SRL/Skill/WoodCutting.scar}
{.include SRL/SRL/extended/xAutoTalk.scar}
{.include SRL/SRL/extended/xAntiBan.scar}
var
LoadsA, LoadsB, Attempts, WillowBMP, WillowInv, Ents, WAxes,
WillowColor, AxeDTM, BrokenAxeDTM, Time: Integer;
BrokenAxe: Boolean;
const
Loads = 10; // Amount of loads to do per person
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// A Nick is 3-4 letters of the Username //
procedure DeclarePlayers;
begin
HowManyPlayers := 8;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := 'Username';
Players[0].Pass := 'Password';
Players[0].Nick := 'Nick';
Players[0].Active := True;
Players[0].Boolean1 := True; // True if axe is wielded, false if not.
Players[1].Name := 'UserName';
Players[1].Pass := 'Password';
Players[1].Nick := 'Nick';
Players[1].Active := True;
Players[1].Boolean1 := True;
Players[2].Name := 'UserName';
Players[2].Pass := 'Password';
Players[2].Nick := 'Nick';
Players[2].Active := True;
Players[2].Boolean1 := True;
Players[3].Name := 'UserName';
Players[3].Pass := 'Password';
Players[3].Nick := 'Nick';
Players[3].Active := True;
Players[3].Boolean1 := True;
Players[4].Name := 'UserName';
Players[4].Pass := 'Password';
Players[4].Nick := 'Nick';
Players[4].Active := True;
Players[4].Boolean1 := True;
Players[5].Name := 'UserName';
Players[5].Pass := 'Password';
Players[5].Nick := 'Nick';
Players[5].Active := True;
Players[5].Boolean1 := True;
Players[6].Name := 'UserName';
Players[6].Pass := 'Password';
Players[6].Nick := 'Nick';
Players[6].Active := True;
Players[6].Boolean1 := True;
Players[7].Name := 'UserName';
Players[7].Pass := 'Password';
Players[7].Nick := 'Nick';
Players[7].Active := True;
Players[7].Boolean1 := True;
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
end;
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
procedure loadBMPandDTM;
begin
WillowBMP := BitmapFromString(2, 6, '78902768702368705B6878234' +
'8504070784D80785B80785B98A86070802A70882A70802A');
WillowInv := DTMFromString('78DA63CC626260B8C38006189148209D0A54F' +
'398809A64A09AD704D480EC7A4F404D2950CD3B026AEA806ADE10' +
'50530F54F384809A1AA09ADBF8D50000A4160AE5');
AxeDTM := DTMFromString('78DA633CCEC4C0D0CBC800021012C2E247E23' +
'39E02AA994840CD11A09A7904D45C07AAE926A0E602504D2B0135' +
'97F1ABF90F04002C1A0CA1');
BrokenAxeDTM := DTMFromString('78DA637CC7C4C0308F910104202484C58FC46' +
'7FC0854D34340CD0FA09A2E026AFE03D5F41250C3C0CCC0D04E40' +
'CD6FA039AD04D47C05AA69C1ADE63F100000CD040E2F');
end;
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
procedure Progress;
begin
ClearDebug;
Writeln('[]/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\[]');
Writeln('---------------->The Progress<------------------');
Writeln(' Did ' + IntToStr(LoadsA) + ' Loads' + ' ');
Writeln('------------------------------------------------');
Writeln(' Worked for ' + ScriptTime2(2) + ' ');
Writeln('------------------------------------------------');
Writeln(' Avoided ' + IntToStr(Ents) + ' Ents' + ' ');
Writeln('------------------------------------------------');
Writeln(' Withdrawn ' + IntToStr(WAxes) + ' Axes ');
Writeln('-----------Script made by kryptonite------------');
Writeln('[]/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\[]');
end;
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
procedure AntiBanning;
begin
if(not(LoggedIn))then
Exit;
case Random(13) of
1: RandomRClickEvery(2+random(2))
3: PickUpMouseEvery(4+random(2))
5: AlmostLogout;
7: BoredEvery(3+random(2));
9: begin
HoverEvery(4+random(2),'woodcutting')
GameTab(4)
end;
11: LeaveScreenEvery(4+random(3))
13: begin
GameTab(1 + Random(12));
wait(1000+random(1000));
GameTab(4);
end;
end;
end;
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
Function FindFastRandoms: Boolean; // By WT-Fakawi.
var
i: Integer;
begin
for i:=1 to 11 do
begin
case I of
1: If FindDead then
Result := True;
2: If FindMod then
Result := True;
3: If FindMime then
Result := True;
4: If FindMaze then
Result := True;
5: If FindQuiz then
Result := True;
6: If FindDemon then
Result := True;
7: if NoGameTab then
begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
8: If RC Then Result := True;
9: If FindTalk Then Result := True;
10: If FindTrade Then Result := True;
11: ClickToContinue;
End;
Wait(1);
end;
end;
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
procedure Randomz;
begin
FindFastRandoms;
FindNormalRandoms;
if (FindFight) then
begin
MakeCompass('N')
RunAwayDirection('E')
Flag;
Wait(6000 + random(1500));
RunBack;
end;
end;
///////////////////////////////////////////////////////////////////////////////
//////////////////The Folowing 2 functions are made by JAD/////////////////////
/////////////////////////All credits go to him/////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
{********************************************************
function JadSymbol(WhatSymbol: String; Click, Switch: Boolean): Boolean;
By: JAD
Description: My symbol finding. Repeats waiting and
looking for symbol until found or took too long. Clicks
the symbol if told to. Will switch players if it doesn't
find the symbol if told to.
********************************************************}
function JadSymbol(Ax,Ay: Integer; WhatSymbol: String; Click, Switch: Boolean): Boolean;
var I: Integer;
begin
for I := 1 to 21 do
begin
if(not(LoggedIn))then
Exit;
if(FindSymbol(Ax,Ay,(WhatSymbol)))then
begin
if(Click)then
Mouse(Ax,Ay,2,2,true);
Result := True;
Exit;
end;
wait(750+random(500));
end;
Writeln('Could NOT find symbol.');
Result := False;
if(Switch)then
LogOut;
end;
/////////////////////////////////////////////////
///// JAD's Ent checker/handler //////
/////////////////////////////////////////////////
function CheckForEnt: Boolean;
var TPA: TPointArray;
begin
if(not(LoggedIn))then
Exit;
if(FindColorTolerance(x,y,55255,6,6,117,27,10))or
(FindColorTolerance(x,y,976101,6,6,117,27,10))then
begin
if(not(IsUpText('op'))) and (not(IsUpText('own')))then
Exit;
wait(1);
FindColorsSpiralTolerance(x,y,TPA,55255,6,6,117,27,10);
if(GetArrayLength(TPA) - 1 > 4)then
begin
Result := True;
Writeln('We found an ent!! Trying to avoid now..');
Mouse(648,84,3,3,true);
Flag;
FTWait(60+random(5));
if(Players[CurrentPlayer].Boolean1)then
GameTab(5) else
GameTab(4);
Result := FindDTM(AxeDTM,x,y,MIX1,MIY1,MIX2,MIY2);
if(Result)then
begin
Writeln('Whew! We avoided the ent.. Carrying on with chopping');
Ents := Ents + 1;
Exit;
end else
begin
if(FindDTM(BrokenAxeDTM,x,y,MIX1,MIY1,MIX2,MIY2))then
begin
Writeln('Oh darn.. We broke an axe :( going to check if you have extras in the bank');
BrokenAxe := True;
Exit;
end;
end;
end;
Result := False;
end;
end;
////////////////////////////////////////////////////////////////////////////////
//////////Wait2 made by Krazy_Meerkat and is available in SRL///////////////////
//////////////////I modified it too look for more randoms///////////////////////
////////////////////////////////////////////////////////////////////////////////
procedure Wait3(timetowait: Integer; Randoms: Boolean);// i changed to wait3
var
starttime: Integer;
randcounter: Integer;
randamount: Integer;
idlecounter: Integer;
idleamount: Integer;
begin
starttime := GetSystemTime;
if (timetowait < 8000) then
if (Random(100) < 5) then
timetowait := ((timetowait * 2) + Random(timetowait div 2));
randamount := Random(20);
case (Random(2) + 1) of
1: idleamount := 333;
2: idleamount := 2222;
end;
repeat
Wait(1);
randcounter := randcounter + 1;
idlecounter := idlecounter + 1;
if ((randcounter > (90 + randamount)) and (Randoms)) then
begin
randcounter := 0;
randamount := Random(20);
Randomz;
CheckForEnt;
if (BrokenAxe) then
exit;
randcounter := randcounter + 13;
idlecounter := idlecounter + 13;
end;
if (idlecounter > (1500 + idleamount + Random(300))) then
begin
idlecounter := 0;
if (Random(100) > 5) then
begin
case (Random(3) + 1) of
1: idleamount := 333;
2: idleamount := 1111;
3: idleamount := 2222;
end;
end else
case (Random(3) + 1) of
1: idleamount := 1111;
2: idleamount := 2222;
3: idleamount := 5555;
end;
RandomMovement;
end;
until ((GetSystemTime - starttime) > timetowait);
end;
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
procedure ToWillows;
begin
if(not(LoggedIn))then
Exit;
begin
MakeCompass('N')
Wait(300+random(500))
Attempts := 0
repeat
if (not(JadSymbol(x,y,'fishing spot',False,False))) then
begin
RadialRoadWalk(FindWaterColor, 220, 207, 58, 1, 1);
Wait(500+random(300))
Flag;
end;
JadSymbol(x,y,'fishing spot',True,False)
Randomz;
Wait(500+random(300))
Flag;
wait(300 + random(150));
Attempts := Attempts + 1;
if(Attempts = 10)then
begin
Writeln('Did not find willows, Guess we are lost :(');
Writeln('Switching Player')
NextPlayer(False);
end;
until (FindObjectDeformed(x,y,'illow','op dow',WillowBMP,MSX1,MSY1,MSX2,MSY2))
end;
end;
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
procedure CutWillows;
begin
MarkTime(Time)
if(not(LoggedIn))then
Exit;
repeat
if (FindObjectDeformed(x, y, 'illow', 'op dow', WillowBMP, MSX1, MSY1, MSX2, MSY2)) then
begin
Randomz;
Wait(300+random(100)) //
MMouse(x,y,3,3)
IsUpTextMulti('Chop down Willow','illow','op down')
wait(200+random(100))
Mouse(x,y,3,3,False)
wait(200+random(100))
ChooseOption(x,y,'Chop')
Wait3(5000+random(5000),True)
if (BrokenAxe) then
exit;
if (TimeFromMark(time) > Minutes(20)) then
begin
Writeln('Taking too long to cut a full load, going to bank.');
Exit;
end;
end;
until (InvFull)
end;
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
procedure ToBank;
begin
if(not(LoggedIn))then
Exit;
begin
MakeCompass('N')
Wait(300+random(500))
Attempts := 0;
repeat
if (not(JadSymbol(x,y,'bank',False,False))) then
begin
Mouse(667,64,7,7,True) //If it doesnt find the bank then
wait(700+random(300)) //it clicks the MiniMap to get Closer
Randomz;
Flag;
end;
JadSymbol(x,y,'bank',True,False)
Wait(500+random(300)) //Clicks Bank Symbol to get inside bank
Randomz; //If it takes more than 20 tries then
Flag; //It switches Players
wait(300+random(200))
if(Attempts = 20)then
begin
Writeln('Did not find bank, Guess we are lost :(');
Writeln('Switching Player')
NextPlayer(False);
end;
wait(300 + random(150));
Attempts := Attempts + 1;
until (FindSymbolIn(x,y,'bank',603,64,684,105))
end;
end;
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
procedure BankLogs;
begin
if(not(LoggedIn))then
Exit;
if ((InvFull) or (BrokenAxe)) then
begin
MakeCompass('W')
Wait(200+random(200))
LowestAngle;
Attempts:= 0;
GameTab(4)
if (BrokenAxe) then
begin
if(Players[CurrentPlayer].Boolean1)then //Switches to Equip Tab if Boolean1
GameTab(5) //Is True, Looks for Broken Axe, If
if(not(FindDTM(BrokenAxeDTM,x,y, MIX1, MIY1, MIX2, MIY2))) then //Not found then stops replacing axe
begin
BrokenAxe:=False;
Exit;
if (TabExists(5) and (FindDTM(BrokenAxeDTM,x,y, MIX1, MIY1, MIX2, MIY2))) then
begin
MMouse(x,y,3,3) //Just Removes The Axe If is still equiped
if IsUpText('emove') then
Mouse(x,y,3,3,True)
end
end;
repeat
OpenBankQuiet('db') //Tries Opening the bank 10
Wait(300+random(300)) //Time, If it Fails, It will
Randomz; //Switch Players
Attempts:=Attempts + 1;
until (BankScreen) or (Attempts >= 10)
if (Attempts >= 10) then
begin
writeln('Took too many tries in finding bank.')
writeln('Switching Players.')
NextPlayer(False)
end;
if (BankScreen) then
begin
if FindDTM(WillowInv,x,y,MIX1,MIY1,MIX2,MIY2)then
begin
Writeln('Storing All Willows') // Stores All Willows
Mouse(x,y,3,3,False)
wait(200+random(200))
ChooseOption(x, y, 'All')
wait(300+random(300))
end;
if ((BrokenAxe) and (Bankscreen)
and (FindDTM(BrokenAxeDTM,x,y,MIX1,MIY1,MIX2,MIY2))) then
begin
Writeln('Storing the broken axe') //Stores the Broken Axe
Mouse(x,y,3,3,False)
wait(300+random(300))
ChooseOption(x,y,'ore 1')
wait(400+random(100))
FixBank;
if (FindDTM(AxeDTM,x,y,MSX1,MSY1,MSX2,MSY2)) then
begin
Writeln('Found a new axe, going to withdraw') //Withdraws a new axe
Mouse(x,y,3,3,False)
wait(200+random(200))
ChooseOption(x,y,'ithdraw 1')
wait(200+random(100))
end else
begin
Writeln('Could not find another axe, Switching Players')
NextPlayer(False)
end;
end;
CloseBank;
if (BrokenAxe) then
begin
if(Players[CurrentPlayer].Boolean1)then
begin //This Will Wield the axe if
Writeln('You chose to wield axe, will do') //Boolean1 is set to True
FindDTM(AxeDTM,x,y,MIX1,MIY1,MIX2,MIY2) //Also Sets Broken Axe to False
Mouse(x,y,3,3,False) //Since we have finished
wait(300+random(200)) //Replacing The Axe
ChooseOption(x,y,'ield')
Wait(300+random(200))
end
WAxes:= WAxes + 1;
BrokenAxe:=False;
end;
wait(300+random(300))
MakeCompass('N')
wait(500+random(300))
HighestAngle;
wait(300+random(300))
Randomz;
LoadsA:= LoadsA + 1;
LoadsB:= LoadsB + 1;
end;
end;
end;
///////////////////////////////////////////////////////////////////////////////
///////////////Main Loop///////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
begin
SetupSrl;
DeclarePlayers;
LoadsA := 0;
LoadsB := 0;
Ents := 0;
WAxes:= 0;
ActivateClient;
LoginPlayer;
//if ((GetCombatLevel) < (7)) then
//TerminateScript;
repeat
ToWillows;
CutWillows;
ToBank;
BankLogs;
AntiBanning;
Progress;
SRLRandomsReport;
if(LoadsB=Loads)then
begin
NextPlayer(True);
Wait(300+random(100))
//if ((GetCombatLevel) < (7)) then
//TerminateScript;
LoadsB:=0;
HighestAngle;
MakeCompass('N');
end;
until (false)
end.