Simba Code:
program YewTreeBanker;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$I SRL-OSR/SRL/Reflection/Reflection.simba}
{$I SRL-OSR/SRL/misc/al_functions.simba}
var
CurTime, ProgTime,worldtime,timesswitched,ents,birdsnest, ProgBank ,died, TreeFail, randoms, Lagg,brokentimes, TreeColor,j: integer;
pin,axetype,version: string;
toTrees,toBank,cathybankspots:TPointArray;
myloc,currentTree:TPoint;
nearbynpc:tnpcarray;
USE_AUTO_CHECKER,skiller:boolean;
Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
SetScreenName(Players[CurrentPlayer].Nick);
skiller:=true; //skiller = axe in inventory
pin:=''; //bankpin if you have one
USE_AUTO_CHECKER:=true; //whether to auto check for script update
AxeType:='Dragon axe'; //axe type ex: "Dragon axe" "Rune axe"
End;
procedure initVars;
begin
R_RunAwayDirection := 'random';
R_Reincarnate := false;
R_CombatRandoms := True;
version:='2';
TreeColor:= 2702653;
MarkTime(ProgTime);
MarkTime(worldtime);
treefail:=0;
timesswitched:=0;
ProgBank := 0;
died:=0;
brokentimes:=0;
randoms:=0;
birdsnest:=0;
toTrees := [Point(2809 + RandomRange(-2, 2), 3441 + RandomRange(-2, 2)), Point(2805 + RandomRange(-2, 2), 3434 + RandomRange(-2, 2)), Point(2793 + RandomRange(-2, 2), 3432 + RandomRange(-2, 2)), Point(2780 + RandomRange(-2, 2), 3431 + RandomRange(-2, 2)), Point(2764 + RandomRange(-2, 2), 3430 + RandomRange(-2, 2)), Point(2758 + RandomRange(-2, 2), 3430 + RandomRange(-2, 2))];
toBank:=[Point(2759 + RandomRange(-2, 2), 3431 + RandomRange(-2, 2)), Point(2768 + RandomRange(-2, 2), 3430 + RandomRange(-2, 2)), Point(2780 + RandomRange(-2, 2), 3429 + RandomRange(-2, 2)), Point(2795 + RandomRange(-2, 2), 3433 + RandomRange(-2, 2)), Point(2807 + RandomRange(-2, 2), 3435 + RandomRange(-2, 2)), Point(2810 + RandomRange(-2, 2), 3441 + RandomRange(-2, 2))];
cathybankspots:=[point(2807,3442),point(2809,3442),point(2810,3442),point(2811,3442)];
end;
procedure ElfMouse(x, y: integer);//AntiBan Mouse Function
var
Cx, Cy: Integer;
begin
GetMousePos(Cx, Cy);
AL_SetMouseSpeed(20);
case Random(5) of
0: AL_BrakeWindMouse(Cx, Cy, x, y, 15 + Random(10), 5 + Random(15), 5, 10, 5, True);
1: AL_HumanWindMouse(Cx, Cy, x, y, 15 + Random(10), 5 + Random(15), 5, 10, 5);
2: AL_AccurateMMouse(IntToPoint(x, y), 2, 2);
3: AL_HumanMMouse(IntToPoint(x, y), 2, 2);
4: AL_ShiftWindMouse(Cx, Cy, x, y, 15 + Random(10), 5 + Random(15), 5, 10, 20, 5);
5: AL_MissMouse(IntToPoint(x, y), 2, 2);
end;
end;
procedure AutoUpdateMe;//Credit Shuttleu , elfy
var
ThisFile: integer;
OnlineVersion, NewScript, FileNew: string;
begin
if USE_AUTO_CHECKER then
begin
writeln('Checking for script updates...');
OnlineVersion := GetPage('http://pastebin.com/raw.php?i=ZtYjbggJ');
writeln('Online version: '+OnlineVersion);
writeln('Current version: '+Version);
if (trim(OnlineVersion) > Version) then
begin
writeLn('Using Outdated Script!!');
writeLn('Updating to New Version.');
NewScript := GetPage('http://pastebin.com/raw.php?i=c2Mff4jF');
FileNew := ScriptPath + 'FuckYewsBot-V' + OnlineVersion + '.simba';
ThisFile := Rewritefile(FileNew, true);
try
WriteFileString(ThisFile, NewScript);
except
begin
writeLn('Failed writting to ' + FileNew + '!!');
terminatescript;
end;
end;
CloseFile(ThisFile);
writeLn('New script downloaded to ' + FileNew + '!! Please use this one!!');
TerminateScript;
end;
if (trim(OnlineVersion) = Version) then
writeLn('You Are Updated To the Lastest Version!');
end
else
WriteLn('!!!!! Not checking for latest version, you may be outdated!');
end;
procedure ProgressReport;
begin
cleardebug;
MarkTime(CurTime);
writeln('Banked ' + inttostr(ProgBank) + ' invs in ' + inttostr(((TimeFromMark(ProgTime) / 1000) / 60)) + ' mins.');
writeln('Birds Nests: '+inttostr(birdsnest)+'. Died: '+inttostr(died));
writeln('Times Axe Broken: '+inttostr(brokentimes)+'. Random Events: '+inttostr(randoms)+', WorldSwitches: '+inttostr(timesswitched));
writeln(nearbynpc);
end;
function FindBirdsNest1: Boolean;
var // seed nest [(5073, 1, (2726, 3492)), ring nest (5074, 1, (2726, 3493))]
i: Integer;
itemsInArea:TGroundItemArray;
begin
itemsInArea:=R_GetGroundItemsDistance(10);
for i:=0 to high(itemsInArea) do
begin
if((itemsInArea[i].ID = 5073) or (itemsInArea[i].ID = 5074)) then
begin
birdsnest:=birdsnest+1;
Writeln('Birds Nest Found.');
Result:=R_ChooseOptionTile('Take',itemsInArea[i].Tile);
end;
end;
end;
function withinZone(topLeft,botRight: tpoint): boolean;
begin
MyLoc:=R_GetTileGlobal;
if((myloc.x>=topLeft.x) and (myloc.x<=botRight.x) and (myloc.y<=topLeft.y) and (myloc.y>=botRight.y)) then
begin
result:=true;
end
else
begin
result:=false;
end;
end;
function withinBank: boolean;
begin
result:=withinZone(point(2806,3441),point(2812,3438));
end;
function isatTrees: boolean;
begin
result:=withinZone(point(2752,3435),point(2770,3425));
end;
function Banker(spot: tpoint): boolean;
var
tile:tpoint;
begin
makecompass('n');
Tile:= R_TileToMs(spot);
elfmouse(tile.x,tile.y);
wait(randomrange(500,600));
if(random(2) = 1) then
begin
ClickMouse2(Mouse_Left);
Wait(1000+random(300));
end
else
begin
ClickMouse2(Mouse_Right);
R_ChooseOption('Bank booth');
Wait(1000+random(300));
end;
if(pinpending) then
confirmpin;
if(pinscreen) then
inpin(pin);
if(bankscreen) then
begin
result:=true;
end
else
result:=false;
end;
function AmIDead1: boolean;
begin
if(R_GetHealth = 0) then
begin
result:=true;
end
else
result:=false;
end;
procedure BankLogs;
begin
writeln('Bank logs');
wait(lagg);
if(BankScreen) then
begin
if(not Skiller) then
QuickDeposit('inv');
if(skiller) then
Deposit(2,28,true);
end;
ProgBank := ProgBank + 1;
end;
function setRun1(Enable: Boolean): Boolean;
var
x,y : Integer;
begin
Result := False;
if not loggedin() then
Exit;
if Enable then
begin
if findColorTolerance(x, y, 28552, 571, 127, 595, 152, 20) then
begin
result := true;
exit;
end else
begin
mouseBox(545, 130, 590, 150, MOUSE_LEFT);
result := true;
exit;
end;
end else if not Enable then
if findColorTolerance(x, y, 28552, 571, 127, 595, 152, 20) then
begin
mouseBox(545, 130, 590, 150, MOUSE_LEFT);
Result := True;
end;
end;
procedure GoToBank;
begin
setRun1(True);
R_WalkPath(tobank);
Wait(1300+random(300));
end;
procedure CheckAxeBroken;
begin
if(skiller)then
begin
invmouse(1,3);
end
else
begin
ftab(tab_Equip);
wait(1000+random(100));
elfMouse(592,303);
wait(1000+random(100));
end;
if(isuptext(AxeType)) then
writeln('Axe good.');
if(isUpText('Broken')) then
begin
Writeln('Axe has been broken, powering down.');
Gotobank;
Logout;
terminatescript;
end;
end;
Function FindEnt: boolean;
var
ent:tnpc;
begin
if (R_FindNpc('Yew tree', ent)) then
begin
nearbynpc:=R_GetAllNpcs;
if(ent.tile = currentTree) then
begin
ents:=ents+1;
Writeln ('An ent has been detected, getting off...');
R_BlindWalk(Point(R_gettileglobal.x+randomrange(-2,2),R_gettileglobal.y+randomrange(-2,2)));
WriteLn ('Waiting a moment for the ent to go away...');
result:=true;
end;
end
else
result:=false;
end;
procedure GoToTrees;
begin
setRun1(True);
R_WalkPath(totrees);
if(not isattrees) then
R_BlindWalk(point(2761,3430));
end;
function pointNotOnScreen(point:tpoint): boolean;
var
pointtile:tpoint;
begin
result:=false;
pointtile:=R_TileToMsHeight(point,R_GetTileHeight(point));
if((pointtile.x<MSX1)
or (pointtile.x>MSX2)
or (pointtile.y<MSY1)
or (pointtile.y>MSY2)) then
result:=true;
end;
function R_ChooseOptionTileUptext2(Option, TileUptext: String; Tile: TPoint): Boolean; //changed a little to minimize forloop
var
i, Tilex, Tiley: Integer;
Tile2: TPoint;
begin
Result:= false;
Tile2:= R_TileToMs(Tile);
if (Tile2.x = 0) then
Exit;
Tilex:= Tile2.x;
Tiley:= Tile2.y;
for i:=1 to 3 do
begin
MouseBox(Tilex-i, Tiley-i, Tilex+i, Tiley+i, mouse_move);
wait(103 + random(88));
if IsUpTextMultiCustom([TileUptext]) then
begin
ClickMouse2(false);
wait(103 + random(288));
Result:= R_ChooseOptionMultiEx([Option], 'action', ClickLeft);
Result:=true;
end;
wait(100 + random(50));
end;
end;
procedure ChopTree;
var
i,treeID:integer;
treeLocations: tpointArray;
begin
treeLocations:=[point(2755,3434),point(2756,3431),point(2758,3434),point(2761,3432),point(2760,3428),point(2766,3428)];
if(not isatTrees) then
gototrees;
for i:=0 to high(treeLocations) do
begin
currentTree:=R_GetObjectAt(0,treeLocations[i]).Tile;
treeID:=R_GetObjectAt(0,treeLocations[i]).ID;
if((treeID = 2111) and (not findent)) then
begin
if(pointNotOnScreen(currentTree)) then
begin
R_BlindWalkMS(point(currentTree.x+randomrange(-2,2),currentTree.y+randomrange(-2,-1)));
repeat
wait(random(300));
until(not r_iswalking);
end;
if(not r_iswalking) then
begin
if(random(2) = 1) then
begin
currentTree:=R_GetObjectAt(0,treeLocations[i]).Tile;
R_ChooseOptionTileUptext2('Chop','Yew',R_TileToMsHeight(treeLocations[i],R_GetTileHeight(treeLocations[i])));
AL_HumanRandomMouse;
wait(2000+random(500));
exit;
end
else
begin
currentTree:=R_GetObjectAt(0,treeLocations[i]).Tile;
elfmouse(R_TileToMsHeight(treeLocations[i],R_GetTileHeight(treeLocations[i])).x, R_TileToMsHeight(treeLocations[i],R_GetTileHeight(treeLocations[i])).y);
ClickMouse2(Mouse_Left);
AL_HumanRandomMouse;
wait(2000+random(500));
exit;
end;
end;
end
else
continue;
end;
end;
Procedure Antiban;
begin
findent;
if(r_isanimating) then
begin
case random(45) of
1: HoverSkill(randomrange(1,23), False);
2: HoverOnlineFriend;
3: compassmovement(100,150,false);
4..7: BoredHuman;
8: setRun1(True);
9: RandomFKeys(false);
10: MMouseOffClient('random');
11: PressKey(randomrange(1,4));
12..15: AL_HumanRandomMouse;
end;
wait(1000+random(300));
end;
end;
begin
SetupSRL();
DeclarePlayers;
ActivateClient;
SetupReflection;
ClearDebug;
initVars;
AutoUpdateMe;
AddOnTerminate('srl_freebitmaps');
writeln('Welcome to Fuck Yews Bot.');
If (Not LoggedIn) Then
begin
LogInPlayer;
end;
makecompass('n');
checkaxebroken;
setAngle(Srl_angle_high);
repeat
if(FindBirdsNest1) then
Birdsnest := Birdsnest + 1;
if(findchatboxtext('You do not have',8,0))then
begin
checkaxebroken;
end;
if(not R_NearTile(point(2761,3430),300))then
begin
writeln('Somethings fucked, we are way too far.');
logout;
TerminateScript;
end;
ProgressReport;
FindEnt;
if(R_FindNormalRandoms) then
randoms:=randoms+1;
if(solvebox) then
randoms:=randoms+1;
if(invfull) then
begin
gotobank;
if(withinBank) then
begin
for j:=0 to 4 do
begin
banker(cathybankspots[randomrange(0,3)]);
if(bankscreen) then
break;
end;
end
else
R_BlindWalk(point(2809,3440));
banklogs;
closebank;
end
else
begin
if((not R_isAnimating) and (not R_isWalking) and (not invfull)) then
choptree;
end;
AntiBan;
until (not LoggedIn)
end.