SRL Archive - Jr. Member OSR Outdated Scripts

Seers Magics


vizzyy

2014-03-15 01:38:05

Yadidadi

Work in progress. i'm Aware of redundancies.
axe equipped, Coins first slot , airs second, laws third, eaths fourth (bank slots), ensure bank scrolled all the way up (for repairing axe), obvi will require cami tele magic level
if skiller then it uses teletabs

pretty awesome ent detection, nests, axe repair, bank and chop functions
will switch world per interval, based on elfy's world switch that i edited(really unreliable but i added because of the whole world 85/86 bullshit)

also, a quick shoutout to the community, as I have pulled snippets from other scripts .



program SeersMagics;
{$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,plantTime,birdsnest,timesswitched,worldtime,switchinterval,ents,ProgBank ,died, TreeFail, randoms, Lagg,brokentimes, TreeColor, BankColor1, spot: integer;
pin,axetype: string;
skiller: boolean;
toTrees,toBank,seersToTrees,toBob,fromBob,seersBanks:TPointArray;
myloc,currentTree:TPoint;
evacced,pickedPlant:boolean;
ent:tnpc;
entnpcs:tnpcarray;

Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
pin:='';
skiller:=false;
SetScreenName(Players[CurrentPlayer].Nick);
End;

procedure initVars;
begin
lampskill:='woodcutting';
AxeType:='Drag';
TreeColor:= 7579819;
evacced:=false;
pickedPlant:=false;
BankColor1:=8555406;
MarkTime(ProgTime);
MarkTime(worldtime);
switchinterval:=randomrange(450,700);
treefail:=0;
ProgBank := 0;
R_RunAwayDirection := 'random';
R_Reincarnate := True;
R_CombatRandoms := True;
timesswitched:=0;
died:=0;
ents:=0;
brokentimes:=0;
randoms:=0;
birdsnest:=0;
seersbanks:=[point(2721,3494),point(2722,3494),point(2724,3494),point(2727,3494),point(2728,3494),point(2729,3494)];
toTrees := [Point(2725 + RandomRange(-2, 2), 3492 + RandomRange(-2, 2)), Point(2726 + RandomRange(-2, 2), 3480 + RandomRange(-2, 2)), Point(2724 + RandomRange(-2, 2), 3464 + RandomRange(-2, 2)), Point(2718 + RandomRange(-2, 2), 3449 + RandomRange(-2, 2)), Point(2717 + RandomRange(-2, 2), 3433 + RandomRange(-2, 2)), Point(2716 + RandomRange(-2, 2), 3417 + RandomRange(-2, 2)), Point(2715 + RandomRange(-2, 2), 3402 + RandomRange(-2, 2)), Point(2701 + RandomRange(-2, 2), 3395 + RandomRange(-2, 2)),point(2703 + RandomRange(-2, 2),3397 + RandomRange(-2, 2))];
toBank:=[Point(2702 + RandomRange(-2, 2), 3398 + RandomRange(-2, 2)), Point(2703 + RandomRange(-2, 2), 3393 + RandomRange(-2, 2)), Point(2708 + RandomRange(-2, 2), 3392 + RandomRange(-2, 2)), Point(2713 + RandomRange(-2, 2), 3392 + RandomRange(-2, 2)), Point(2714 + RandomRange(-2, 2), 3397 + RandomRange(-2, 2)), Point(2716 + RandomRange(-2, 2), 3402 + RandomRange(-2, 2)), Point(2715 + RandomRange(-2, 2), 3407 + RandomRange(-2, 2)), Point(2715 + RandomRange(-2, 2), 3412 + RandomRange(-2, 2)), Point(2715 + RandomRange(-2, 2), 3417 + RandomRange(-2, 2)), Point(2714 + RandomRange(-2, 2), 3422 + RandomRange(-2, 2)), Point(2713 + RandomRange(-2, 2), 3427 + RandomRange(-2, 2)), Point(2713 + RandomRange(-2, 2), 3432 + RandomRange(-2, 2)), Point(2713 + RandomRange(-2, 2), 3437 + RandomRange(-2, 2)), Point(2710 + RandomRange(-2, 2), 3442 + RandomRange(-2, 2)), Point(2712 + RandomRange(-2, 2), 3447 + RandomRange(-2, 2)), Point(2714 + RandomRange(-2, 2), 3452 + RandomRange(-2, 2)), Point(2718 + RandomRange(-2, 2), 3456 + RandomRange(-2, 2)), Point(2718 + RandomRange(-2, 2), 3461 + RandomRange(-2, 2)), Point(2718 + RandomRange(-2, 2), 3466 + RandomRange(-2, 2)), Point(2720 + RandomRange(-2, 2), 3471 + RandomRange(-2, 2)), Point(2724 + RandomRange(-2, 2), 3475 + RandomRange(-2, 2)), Point(2726 + RandomRange(-2, 2), 3480 + RandomRange(-2, 2)), Point(2727 + RandomRange(-2, 2), 3485 + RandomRange(-2, 2)), Point(2726 + RandomRange(-2, 2), 3490 + RandomRange(-2, 2))];
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 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)+', Ents: '+inttostr(ents));
writeln('Times Axe Broken: '+inttostr(brokentimes)+'. Random Events: '+inttostr(randoms)+', WorldSwitches: '+inttostr(timesswitched));
writeln(entnpcs);
end;

procedure Release;
begin
srl_freebitmaps;
freebitmap(bmpAdmin);
freebitmap(bmpMinimapMask);
freedtm(Lamp);
freedtm(BookOfKnowledge);
//progressreport;
end;

function withinZone(topLeft,botRight: tpoint): boolean;
begin
MyLoc:=R_GetTileGlobal;
result:=((myloc.x>topLeft.x) and (myloc.x<botRight.x) and (myloc.y<topLeft.y) and (myloc.y>botRight.y));
end;

function isAtTrees: boolean;
begin
result:=withinZone(Point(2696, 3402), Point(2707, 3394));
end;

function isInBank: boolean;
begin
result:=withinZone(Point(2720, 3494), Point(2730, 3486));
end;

function isAtLumby: boolean;
begin
result:=withinZone(Point(3200, 3236), Point(3226, 3200));
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 AmIDead1: boolean;
begin
if(R_GetHealth = 0) then
begin
result:=true;
end
else
result:=false;
end;

procedure teleWalkTrees;
begin
wait(2000+random(100));
if(skiller) then
invmouse(3,1);
if(not skiller) then
CastSpellByNumber(27);
wait(6000+random(300));
seersToTrees:=[Point(2756, 3476), Point(2748, 3465), Point(2734, 3456), Point(2727, 3441), Point(2728, 3423), Point(2728, 3407), Point(2715, 3397), Point(2703, 3397)];
R_WalkPath(seersToTrees);
end;

procedure RepairAxe;
var
Guard: TNPC;
Tp : Tpoint;
begin
brokentimes:=brokentimes+1;
MyLoc:=R_GetTileGlobal;
toBob:=[Point(3225, 3218), Point(3234, 3214), Point(3230, 3203)];
fromBob:=[Point(3235, 3203), Point(3232, 3216), Point(3218, 3218), Point(3206, 3210)];

if(not skiller) then
begin
gametab(tab_equip)
wait(randomrange(700,900));
elfMouse(592,303);//,3,3,true);
ClickMouse2(Mouse_Left);
end;

for spot:=1 to 28 do
begin
invmouse(spot,3);
wait(randomrange(150,250));
if(isuptext(AxeType) or isuptext('roken')) then
begin
invmouse(spot,3);
Break;
end;
end;
if(isUpText('roken')) then
begin
Writeln('Excercising RepairAxe');
R_WalkPath(toBob);
repeat
repeat
if R_FindNpc('Bob', Guard) then // Loads the record for Guard.
begin
Tp := Guard.Tile; //Get guard tile location
Tp := R_TileToMs(Tp); //Changes Tile into a Onscreen Point
elfmouse(Tp.x, Tp.y);
if waituptext('Bob', 200) then
begin
InvMouse(spot,1);
elfmouse(Tp.x, Tp.y);
ClickMouse2(Mouse_Left);
wait(randomrange(1500,2000));
end;
end;
until(aretalking);

if(areTalking()) then
begin
ClickContinueEx(true,true);
elfmouse(261,401);//,3,3,true);
ClickMouse2(Mouse_Left);
ClickContinueEx(true,true);
ClickContinueEx(true,true);
wait(randomrange(1500,2000));
end;

for spot:=1 to 28 do
begin
invmouse(spot,3);
wait(randomrange(150,250));
if(isuptext(AxeType)) then
begin
invmouse(spot,3);
Break;
end;
end;

until(isUpText(AxeType));
end;
if(isuptext(AxeType)) then
begin
writeln('Axe is good.');
if(not skiller) then
invmouse(spot,1);
teleWalkTrees;
end;
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 turnonrun: Boolean;
var
x,y : Integer;
enable:boolean;
begin
Result := False;
enable:=true;
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
writeln('gotobank');
if(BankScreen) then
begin
BankLogs;
end;
TurnOnRun;
R_WalkPath(toBank);
if(not IsInBank) then
R_BlindWalk(Point(2726, 3491));
writeln('Walk to bank successful.');
wait (lagg);
end;

function Banker(spot: tpoint): boolean;
var
tile:tpoint;
begin
Tile:= R_TileToMs(spot);
elfmouse(tile.x,tile.y);
wait(randomrange(500,600));
if(random(2) = 1) then
begin
ClickMouse2(Mouse_Left);
wait(2000+random(100));
end
else
begin
ClickMouse2(Mouse_Right);
ChooseOptionMulti(['ank','ooth']);
wait(2000+random(100));
end;
if(pinpending) then
confirmpin;
if(pinscreen) then
inpin(pin);
if(bankscreen) then
begin
result:=true;
end
else
result:=false;
end;

procedure OpenBank1;
begin
makecompass('n');
myloc:=R_gettileGlobal;
writeln('openbank ('+inttostr(myloc.x)+','+inttostr(myloc.y)+')');
Repeat
Banker(seersbanks[randomrange(0,5)]);
wait (1000+random(2000));
if(not isInBank) then
begin
writeln('Bank Contingency');
R_BlindWalk(Point(2726, 3492));
end;
until(BankScreen)
end;

procedure CheckAxeBroken;
begin
if(skiller)then
begin
invmouse(1,3);
end
else
begin
ftab(tab_Equip);
wait(1000+random(100));
elfMouse(592,303);//,3,3);
wait(1000+random(100));
end;
if(isuptext(AxeType)) then
writeln('Axe good.');
if(isUpText('Broken')) then
begin
writeln('Axe broken.');
gotobank;
openbank1;
banklogs;
if(bankscreen) then
begin
writeln('Withdrawing');
if(skiller) then
begin
wait(randomrange(500,600)); //coins in first bank slot
Withdraw(0, 0, 1800);//, ['Coins']);
wait(randomrange(500,600)); //Cammy in second slot
Withdraw(1, 0, 1); //['Cammy Tele']);
wait(randomrange(500,600));
end
else
begin
wait(randomrange(500,600)); //coins in first bank slot
Withdraw(0, 0, 1800);//, ['Coins']);
wait(randomrange(500,600)); //airs in second slot
Withdraw(1, 0, 5); //['Air Rune']);
wait(randomrange(500,600)); //laws in third slot
Withdraw(2, 0, 1);//, ['Law Rune']);
wait(randomrange(500,600));
end;
end;
closebank;
wait(2000+random(1000));
elfmouse (644,91);//,3,3,true);
ClickMouse2(Mouse_Left);
wait(randomrange(600,800));
CastSpellByNumber(1);
wait(randomrange(600,800));
if(findchatboxtext('need to wait',8,0)) then //skill on cooldown then use reagents
begin
openbank1;
if(skiller) then
begin
wait(randomrange(500,600));
Withdraw(2, 0, 1); //['Lumby Tab']);
wait(randomrange(500,600));
closebank;
wait(randomrange(600,800));
invmouse(4,1);
end
else
begin
wait(randomrange(500,600));
Withdraw(3, 0, 1);//, ['Earth Rune']);
wait(randomrange(500,600));
Withdraw(2, 0, 1);//, ['Law Rune']);
wait(randomrange(500,600)); //airs in second slot
Withdraw(1, 0, 3); //['Air Rune']);
wait(randomrange(500,600));
closebank;
wait(randomrange(600,800));
CastSpellByNumber(19);
end;
end;
wait(15000+random(300));
RepairAxe;
Exit;
end;
end;

Function FindEnt: tpoint;
begin
if (R_Findnpc('Magic tree',ent)) then
begin
entnpcs:=r_getallnpcs;
result:=ent.tile;
if(ent.tile = currentTree) then
begin
if(not evacced) then
begin
Writeln ('An ent has been detected...');
ents:=ents+1;
R_BlindWalkMS(point(2702+randomrange(-1,1),3398+randomrange(-1,1)));
evacced:=true
end;
end;
end
else
begin
evacced:=false;
result:=point(0,0);
end;
end;

procedure GoToTrees;
begin
writeln('gototrees');
myloc:= R_GetTileGlobal;
if(not isattrees and not isatlumby) then //if outside tree zone reflection walk to tree zone
begin
TurnOnRun;
R_WalkPath(toTrees);
if(not isattrees) then
R_BlindWalk(point(2702,3398));
writeln('Walk to trees successfully');
end;
wait (lagg);
end;

function plant:boolean;
var
Ivy:tnpc;
begin
if(R_Findnpc('Strange',ivy)) then
begin
if(R_NearTile(ivy.tile,5) and (not pickedPlant))then
begin
ElfMouse(R_Tiletoms(ivy.tile).x,R_Tiletoms(ivy.tile).y);
ClickMouse2(Mouse_Left);
pickedPlant:=true;
MarkTime(plantTime);
if(IsChatBoxTextAnyLine('fruit',0)) then
pickedPlant:=false;
end;
end;
end;

function froggieRandom: boolean;
var
Frogs:tnpcArray;
Peach:Tnpc;
i:integer;
begin
result:=false;
if(withinZone(point(2450,4797),point(2480,4760))) then
begin
R_FindNPC(1329,Peach);
frogs:=R_GetAllNpcs;
writeln(Peach);
for i:=0 to high(frogs) do
begin
if(frogs[i].Index = 1329) then
Peach:=frogs[i];
end;
R_BlindWalk(Peach.tile);
for i:=0 to 5 do
begin
R_FindNPC(1329,Peach);
Mouse(R_TiletoMs(Peach.tile).x,R_TiletoMS(Peach.Tile).y,3,3,true);
wait(2000+random(1000));
if(aretalking)then
break;
end;
if(aretalking) then
begin
ClickContinueEx(true,true);
ClickText('back','CharsNPC07',MCX1,MCY1,MCX2,MCY2,true);
wait(randomrange(600,800));
ClickContinueEx(true,true);
ClickContinueEx(true,true);
result:=true;
end;
end;
end;

function pointNotOnScreen(point:tpoint): boolean;
begin
result:=false;
if((point.x<MSX1)
or (point.x>MSX2)
or (point.y<MSY1)
or (point.y>MSY2)) then
result:=true;
end;

procedure ChopTree;
var
i,treeID:integer;
treespots: tpointarray;
mouseGo,mouseGo2:tpoint;
begin
treespots:=[point(2706, 3397),point(2706, 3399),point(2699, 3399),point(2699, 3397)];
if(not isatTrees) then
gototrees;
for i:=0 to high(treespots) do
begin
if(findent = treespots[i]) then
continue;
treeID:=R_GetObjectAt(0,treespots[i]).ID;
writeln(treeID);
if(treeID = 2120) then
begin
if(not r_iswalking) then
begin
mouseGo:=point(treespots[i].x-1,treespots[i].y-1);
mouseGo2:=point(treespots[i].x,treespots[i].y);
mouseGo:=point((R_TileToMsHeight(mouseGo,R_GetTileHeight(mouseGo)).x+R_TileToMsHeight(mouseGo2,R_GetTileHeight(mouseGo2)).x)/2,
(R_TileToMsHeight(mouseGo,R_GetTileHeight(mouseGo)).y+R_TileToMsHeight(mouseGo2,R_GetTileHeight(mouseGo2)).y)/2);
if(pointNotOnScreen(mouseGo)) then
begin
R_BlindWalkMS(point(2702+randomrange(-1,1),3398+randomrange(-1,1)));
//compassmovement(45,90,false);
end;
elfmouse(mouseGo.x,mouseGo.y);
wait(randomrange(400,600));
if(R_Isuptext('Magic tree')) then
begin
ClickMouse2(Mouse_Left);
AL_HumanRandomMouse;
currentTree:=treespots[i];
R_FNRwait(randomrange(900,1400),300);
break;
end
else
R_BlindWalkMS(point(2702+randomrange(-1,1),3398+randomrange(-1,1)));
end;
end
else
continue;
end;
end;

procedure haveDied;
begin
if(not skiller) then
begin
for spot:=1 to 28 do
begin
invmouse(spot,3);
wait(randomrange(150,250));
if(isuptext(AxeType) or isuptext('roken')) then
begin
invmouse(spot,1);
Break;
end;
end;
end;
repeat
R_BlindWalk(point(3206, 3209));
wait(randomrange(800,1000));
if(R_getplane=0) then
R_ChooseOptionTile('Climb-up',point(3205, 3208));
wait(randomrange(800,1000));
until((R_getplane=1) or (R_getplane=2));
repeat
if(R_getplane=1) then
R_ChooseOptionTile('Climb-up',point(3205, 3208));
wait(randomrange(800,1000));
until(R_getplane=2);
if(R_getplane=2) then
begin
repeat
R_BlindWalk(Point(3209, 3219));
wait(randomrange(800,1000));
Banker(point(3208, 3221));
wait(randomrange(800,1100));
until(bankscreen);
BankLogs;
wait(randomrange(800,1100));
if(skiller) then
begin
Withdraw(1, 0, 1); //['Cammy Tele']);
end
else
begin
wait(randomrange(500,600)); //airs in second slot
Withdraw(1, 0, 5); //['Air Rune']);
wait(randomrange(500,600)); //laws in third slot
Withdraw(2, 0, 1);//, ['Law Rune']);
end;
wait(randomrange(800,1100));
closebank;
wait(randomrange(600,1000));
if(skiller) then
invmouse(2,1);
wait(randomrange(2500,3000));
telewalktrees;
end;
end;

procedure MyWorld(W: Integer);//Pick World On WOrld Screen
var
WArray: array of Integer;
I: Integer;
begin
Warray := [302, 303, 304, 305, 306, 309, 310, 311, 312, 313, 314, 317, 318, 319, 320, 321, 322, 326, 327, 328, 329, 330, 333, 334, 335, 336, 338, 341, 342, 343, 344, 345, 346, 349, 350, 351, 352, 353, 354, 357, 358, 359, 360, 361, 362, 366, 367, 368, 369, 370, 373, 374, 375, 376, 377, 378];
if InIntArrayEx(WArray, i, W) then
begin
ElfMouse(250 + ((i / 16) * 90), 80 + (24 * (i mod 16)));
Wait(1000)
ClickMouse2(Mouse_Left);
Exit;
end
else
i := 28;
ElfMouse(250 + ((i / 16) * 90), 80 + (24 * (i mod 16)));
Wait(1000)
ClickMouse2(Mouse_Left);
Exit;
end;

function OpenWScreen: Boolean;
var
x, y: integer;
begin
Result := False;
if findcolortolerance(x, y, 3166829, 350, 190, 435, 220, 10) then
Result := True;
if Loggedin then
Exit;
if not result then
begin
Mmouse(54, 475, 1, 1);
wait(200);
ClickMouse2(Mouse_Left);
Wait(1500);
Result := True;
end;
end;

procedure SwitchWorldTo;
var
WArray: array of Integer;
num: integer;
begin
num:= Randomrange(2,50);
Warray := [302, 303, 304, 305, 306, 309, 310, 311, 312, 313, 314, 317, 318, 319, 320, 321, 322, 326, 327, 328, 329, 330, 333, 334, 335, 336, 338, 341, 342, 343, 344, 345, 346, 349, 350, 351, 352, 353, 354, 357, 358, 359, 360, 361, 362, 366, 367, 368, 369, 370, 373, 374, 375, 376, 377, 378];
Logout;
OpenWScreen;
MyWorld(WArray[num]);
writeln(warray[num]);
LoginPlayer;
end;

Procedure Antiban;
begin
R_FindNormalRandoms;
findent;
if(r_isanimating) then
begin
case random(45) of
1: HoverSkill(randomrange(1,23), False);
2: HoverOnlineFriend;
//3: compassmovement(100,150,false);
4: BoredHuman;
8: Turnonrun;
9: RandomFKeys(false);
10: MMouseOffClient('random');
//11: PressKey(randomrange(1,4));
12..15: AL_HumanRandomMouse;
end;
Wait(randomrange(800,1000));
end;
end;

begin
SetupSRL();
DeclarePlayers;
SetScreenName(Players[CurrentPlayer].Nick);
ActivateClient;
SetupReflection;
ClearDebug;
writeln('Welcome to Vizzyy Seers Magic Bot.');
initVars;
AddOnTerminate('Release');
If (Not LoggedIn) Then
begin
LogInPlayer;
end;
makecompass('n');
setAngle(Srl_angle_high);

repeat

if (((TimeFromMark(PlantTime) / 1000) / 60) > 2) then
begin
pickedPlant:=false;
end;

if (((TimeFromMark(WorldTime) / 1000) / 60) > switchinterval) then
begin
Writeln('Switching World');
SwitchWorldTo;
MarkTime(WorldTime);
switchinterval:=randomrange(450,700);
timesswitched:=timesswitched+1;
end;

if(not R_NearTile(point(2705,3397),400) and (not isatlumby))then
begin
writeln('Somethings fucked, we are too far.');
CastSpellByNumber(1);
wait(15000);
end;
//main loop
if(findchatboxtext('You do not have',8,0))then
begin
checkaxebroken;
end;
progressreport;

plant;
froggieRandom;
FindEnt;

if(R_FindNormalRandoms) then
randoms:=randoms+1; ;
if(solvebox) then
randoms:=randoms+1;

AntiBan;

if(FindBirdsNest1) then
Birdsnest := Birdsnest + 1;

if(AmIDead1 or isatlumby) then
begin
writeln('Died/lumby, resetting');
died:=died+1;
haveDied;
end;

if(InvFull) then
begin
GoToBank;
OpenBank1;
BankLogs;
closebank;
GoToTrees;
end
else
begin
if((not R_IsAnimating) and (not Al_playerwalking)) then
begin
ChopTree;
end;
end;
until (Not LoggedIn)
TerminateScript;
end.


Ilya

2014-04-15 05:29:00

This script has been up here a month without as much as a "Thanks"!
I will try it and give you feedback as soon as I'm 75 WC (around 100k xp left).
Thanks for sharing!!

jhildy

2014-04-26 12:06:37

Great script. I appreciate you releasing it, i've been looking for something like this for a while. I made a couple tweaks on like 2 of your functions because for whatever reason they weren't working at the time.

program SeersMagics;
{$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,plantTime,birdsnest,timesswitched,worldtime,switchinterval,ents,ProgBank ,died, TreeFail, randoms, Lagg,brokentimes, TreeColor, BankColor1, spot: integer;
pin,axetype: string;
skiller: boolean;
toTrees,toBank,seersToTrees,toBob,fromBob,seersBanks:TPointArray;
myloc,currentTree:TPoint;
evacced,pickedPlant:boolean;
ent:tnpc;
entnpcs:tnpcarray;

Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
pin:='';
skiller:=false;
SetScreenName(Players[CurrentPlayer].Nick);
End;

procedure initVars;
begin
lampskill:='woodcutting';
AxeType:='Drag';
TreeColor:= 7579819;
evacced:=false;
pickedPlant:=false;
BankColor1:=8555406;
MarkTime(ProgTime);
MarkTime(worldtime);
switchinterval:=randomrange(450,700);
treefail:=0;
ProgBank := 0;
R_RunAwayDirection := 'random';
R_Reincarnate := True;
R_CombatRandoms := True;
timesswitched:=0;
died:=0;
ents:=0;
brokentimes:=0;
randoms:=0;
birdsnest:=0;
seersbanks:=[point(2721,3494),point(2722,3494),point(2724,3494),point(2727,3494),point(2728,3494),point(2729,3494)];
toTrees := [Point(2725 + RandomRange(-2, 2), 3492 + RandomRange(-2, 2)), Point(2726 + RandomRange(-2, 2), 3480 + RandomRange(-2, 2)), Point(2724 + RandomRange(-2, 2), 3464 + RandomRange(-2, 2)), Point(2718 + RandomRange(-2, 2), 3449 + RandomRange(-2, 2)), Point(2717 + RandomRange(-2, 2), 3433 + RandomRange(-2, 2)), Point(2716 + RandomRange(-2, 2), 3417 + RandomRange(-2, 2)), Point(2715 + RandomRange(-2, 2), 3402 + RandomRange(-2, 2)), Point(2701 + RandomRange(-2, 2), 3395 + RandomRange(-2, 2)),point(2703 + RandomRange(-2, 2),3397 + RandomRange(-2, 2))];
toBank:=[Point(2702 + RandomRange(-2, 2), 3398 + RandomRange(-2, 2)), Point(2703 + RandomRange(-2, 2), 3393 + RandomRange(-2, 2)), Point(2708 + RandomRange(-2, 2), 3392 + RandomRange(-2, 2)), Point(2713 + RandomRange(-2, 2), 3392 + RandomRange(-2, 2)), Point(2714 + RandomRange(-2, 2), 3397 + RandomRange(-2, 2)), Point(2716 + RandomRange(-2, 2), 3402 + RandomRange(-2, 2)), Point(2715 + RandomRange(-2, 2), 3407 + RandomRange(-2, 2)), Point(2715 + RandomRange(-2, 2), 3412 + RandomRange(-2, 2)), Point(2715 + RandomRange(-2, 2), 3417 + RandomRange(-2, 2)), Point(2714 + RandomRange(-2, 2), 3422 + RandomRange(-2, 2)), Point(2713 + RandomRange(-2, 2), 3427 + RandomRange(-2, 2)), Point(2713 + RandomRange(-2, 2), 3432 + RandomRange(-2, 2)), Point(2713 + RandomRange(-2, 2), 3437 + RandomRange(-2, 2)), Point(2710 + RandomRange(-2, 2), 3442 + RandomRange(-2, 2)), Point(2712 + RandomRange(-2, 2), 3447 + RandomRange(-2, 2)), Point(2714 + RandomRange(-2, 2), 3452 + RandomRange(-2, 2)), Point(2718 + RandomRange(-2, 2), 3456 + RandomRange(-2, 2)), Point(2718 + RandomRange(-2, 2), 3461 + RandomRange(-2, 2)), Point(2718 + RandomRange(-2, 2), 3466 + RandomRange(-2, 2)), Point(2720 + RandomRange(-2, 2), 3471 + RandomRange(-2, 2)), Point(2724 + RandomRange(-2, 2), 3475 + RandomRange(-2, 2)), Point(2726 + RandomRange(-2, 2), 3480 + RandomRange(-2, 2)), Point(2727 + RandomRange(-2, 2), 3485 + RandomRange(-2, 2)), Point(2726 + RandomRange(-2, 2), 3490 + RandomRange(-2, 2))];
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 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)+', Ents: '+inttostr(ents));
writeln('Times Axe Broken: '+inttostr(brokentimes)+'. Random Events: '+inttostr(randoms)+', WorldSwitches: '+inttostr(timesswitched));
writeln(entnpcs);
end;

procedure Release;
begin
srl_freebitmaps;
freebitmap(bmpAdmin);
freebitmap(bmpMinimapMask);
freedtm(Lamp);
freedtm(BookOfKnowledge);
//progressreport;
end;

function withinZone(topLeft,botRight: tpoint): boolean;
begin
MyLoc:=R_GetTileGlobal;
result:=((myloc.x>topLeft.x) and (myloc.x<botRight.x) and (myloc.y<topLeft.y) and (myloc.y>botRight.y));
end;

function isAtTrees: boolean;
begin
result:=withinZone(Point(2696, 3402), Point(2707, 3394));
end;

function isInBank: boolean;
begin
result:=withinZone(Point(2720, 3494), Point(2730, 3486));
end;

function isAtLumby: boolean;
begin
result:=withinZone(Point(3200, 3236), Point(3226, 3200));
end;

function FindBirdsNest1: Boolean;
var // seed nest [(5073, 1, (2726, 3492)), ring nest (5074, 1, (2726, 3493))]
i: Integer;
itemsInArea:TGroundItemArray;
nest : TRSObject;
location: TPoint;
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.');
nest := R_GetObjectAt(0, itemsInArea[i].Tile);
location := R_TileToMS(nest.Tile);
Mouse(location.x, location.y, 1, 1, mouse_right);
Result:= ChooseOption('Take');
end;
end;
end;

function AmIDead1: boolean;
begin
if(R_GetHealth = 0) then
begin
result:=true;
end
else
result:=false;
end;

procedure teleWalkTrees;
begin
wait(2000+random(100));
if(skiller) then
invmouse(3,1);
if(not skiller) then
CastSpellByNumber(27);
wait(6000+random(300));
seersToTrees:=[Point(2756, 3476), Point(2748, 3465), Point(2734, 3456), Point(2727, 3441), Point(2728, 3423), Point(2728, 3407), Point(2715, 3397), Point(2703, 3397)];
R_WalkPath(seersToTrees);
end;

procedure RepairAxe;
var
Guard: TNPC;
Tp : Tpoint;
begin
brokentimes:=brokentimes+1;
MyLoc:=R_GetTileGlobal;
toBob:=[Point(3225, 3218), Point(3234, 3214), Point(3230, 3203)];
fromBob:=[Point(3235, 3203), Point(3232, 3216), Point(3218, 3218), Point(3206, 3210)];

if(not skiller) then
begin
gametab(tab_equip)
wait(randomrange(700,900));
elfMouse(592,303);//,3,3,true);
ClickMouse2(Mouse_Left);
end;

for spot:=1 to 28 do
begin
invmouse(spot,3);
wait(randomrange(150,250));
if(isuptext(AxeType) or isuptext('roken')) then
begin
invmouse(spot,3);
Break;
end;
end;
if(isUpText('roken')) then
begin
Writeln('Excercising RepairAxe');
R_WalkPath(toBob);
repeat
repeat
if R_FindNpc('Bob', Guard) then // Loads the record for Guard.
begin
Tp := Guard.Tile; //Get guard tile location
Tp := R_TileToMs(Tp); //Changes Tile into a Onscreen Point
elfmouse(Tp.x, Tp.y);
if waituptext('Bob', 200) then
begin
InvMouse(spot,1);
elfmouse(Tp.x, Tp.y);
ClickMouse2(Mouse_Left);
wait(randomrange(1500,2000));
end;
end;
until(aretalking);

if(areTalking()) then
begin
ClickContinueEx(true,true);
elfmouse(261,401);//,3,3,true);
ClickMouse2(Mouse_Left);
ClickContinueEx(true,true);
ClickContinueEx(true,true);
wait(randomrange(1500,2000));
end;

for spot:=1 to 28 do
begin
invmouse(spot,3);
wait(randomrange(150,250));
if(isuptext(AxeType)) then
begin
invmouse(spot,3);
Break;
end;
end;

until(isUpText(AxeType));
end;
if(isuptext(AxeType)) then
begin
writeln('Axe is good.');
if(not skiller) then
invmouse(spot,1);
teleWalkTrees;
end;
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 turnonrun: Boolean;
var
x,y : Integer;
enable:boolean;
begin
Result := False;
enable:=true;
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
writeln('gotobank');
if(BankScreen) then
begin
BankLogs;
end;
TurnOnRun;
R_WalkPath(toBank);
if(not IsInBank) then
R_BlindWalk(Point(2726, 3491));
writeln('Walk to bank successful.');
wait (lagg);
end;

function Banker(spot: tpoint): boolean;
var
tile:tpoint;
begin
Tile:= R_TileToMs(spot);
elfmouse(tile.x,tile.y);
wait(randomrange(500,600));
if(random(2) = 1) then
begin
ClickMouse2(Mouse_Left);
wait(2000+random(100));
end
else
begin
ClickMouse2(Mouse_Right);
ChooseOptionMulti(['ank','ooth']);
wait(2000+random(100));
end;
if(pinpending) then
confirmpin;
if(pinscreen) then
inpin(pin);
if(bankscreen) then
begin
result:=true;
end
else
result:=false;
end;

procedure OpenBank1;
begin
makecompass('n');
myloc:=R_gettileGlobal;
writeln('openbank ('+inttostr(myloc.x)+','+inttostr(myloc.y)+')');
Repeat
Banker(seersbanks[randomrange(0,5)]);
wait (1000+random(2000));
if(not isInBank) then
begin
writeln('Bank Contingency');
R_BlindWalk(Point(2726, 3492));
end;
until(BankScreen)
end;

procedure CheckAxeBroken;
begin
if(skiller)then
begin
invmouse(1,3);
end
else
begin
ftab(tab_Equip);
wait(1000+random(100));
elfMouse(592,303);//,3,3);
wait(1000+random(100));
end;
if(isuptext(AxeType)) then
writeln('Axe good.');
if(isUpText('Broken')) then
begin
writeln('Axe broken.');
gotobank;
openbank1;
banklogs;
if(bankscreen) then
begin
writeln('Withdrawing');
if(skiller) then
begin
wait(randomrange(500,600)); //coins in first bank slot
Withdraw(0, 0, 1800);//, ['Coins']);
wait(randomrange(500,600)); //Cammy in second slot
Withdraw(1, 0, 1); //['Cammy Tele']);
wait(randomrange(500,600));
end
else
begin
wait(randomrange(500,600)); //coins in first bank slot
Withdraw(0, 0, 1800);//, ['Coins']);
wait(randomrange(500,600)); //airs in second slot
Withdraw(1, 0, 5); //['Air Rune']);
wait(randomrange(500,600)); //laws in third slot
Withdraw(2, 0, 1);//, ['Law Rune']);
wait(randomrange(500,600));
end;
end;
closebank;
wait(2000+random(1000));
elfmouse (644,91);//,3,3,true);
ClickMouse2(Mouse_Left);
wait(randomrange(600,800));
CastSpellByNumber(1);
wait(randomrange(600,800));
if(findchatboxtext('need to wait',8,0)) then //skill on cooldown then use reagents
begin
openbank1;
if(skiller) then
begin
wait(randomrange(500,600));
Withdraw(2, 0, 1); //['Lumby Tab']);
wait(randomrange(500,600));
closebank;
wait(randomrange(600,800));
invmouse(4,1);
end
else
begin
wait(randomrange(500,600));
Withdraw(3, 0, 1);//, ['Earth Rune']);
wait(randomrange(500,600));
Withdraw(2, 0, 1);//, ['Law Rune']);
wait(randomrange(500,600)); //airs in second slot
Withdraw(1, 0, 3); //['Air Rune']);
wait(randomrange(500,600));
closebank;
wait(randomrange(600,800));
CastSpellByNumber(19);
end;
end;
wait(15000+random(300));
RepairAxe;
Exit;
end;
end;

Function FindEnt: tpoint;
begin
if (R_Findnpc('Magic tree',ent)) then
begin
entnpcs:=r_getallnpcs;
result:=ent.tile;
if(ent.tile = currentTree) then
begin
if(not evacced) then
begin
Writeln ('An ent has been detected...');
ents:=ents+1;
R_BlindWalkMS(point(2702+randomrange(-1,1),3398+randomrange(-1,1)));
evacced:=true
end;
end;
end
else
begin
evacced:=false;
result:=point(0,0);
end;
end;

procedure GoToTrees;
begin
writeln('gototrees');
myloc:= R_GetTileGlobal;
if(not isattrees and not isatlumby) then //if outside tree zone reflection walk to tree zone
begin
TurnOnRun;
R_WalkPath(toTrees);
if(not isattrees) then
R_BlindWalk(point(2702,3398));
writeln('Walk to trees successfully');
end;
wait (lagg);
end;

function plant:boolean;
var
Ivy:tnpc;
begin
if(R_Findnpc('Strange',ivy)) then
begin
if(R_NearTile(ivy.tile,5) and (not pickedPlant))then
begin
ElfMouse(R_Tiletoms(ivy.tile).x,R_Tiletoms(ivy.tile).y);
ClickMouse2(Mouse_Left);
pickedPlant:=true;
MarkTime(plantTime);
if(IsChatBoxTextAnyLine('fruit',0)) then
pickedPlant:=false;
end;
end;
end;

function froggieRandom: boolean;
var
Frogs:tnpcArray;
Peach:Tnpc;
i:integer;
begin
result:=false;
if(withinZone(point(2450,4797),point(2480,4760))) then
begin
R_FindNPC(1329,Peach);
frogs:=R_GetAllNpcs;
writeln(Peach);
for i:=0 to high(frogs) do
begin
if(frogs[i].Index = 1329) then
Peach:=frogs[i];
end;
R_BlindWalk(Peach.tile);
for i:=0 to 5 do
begin
R_FindNPC(1329,Peach);
Mouse(R_TiletoMs(Peach.tile).x,R_TiletoMS(Peach.Tile).y,3,3,true);
wait(2000+random(1000));
if(aretalking)then
break;
end;
if(aretalking) then
begin
ClickContinueEx(true,true);
ClickText('back','CharsNPC07',MCX1,MCY1,MCX2,MCY2,true);
wait(randomrange(600,800));
ClickContinueEx(true,true);
ClickContinueEx(true,true);
result:=true;
end;
end;
end;

function pointNotOnScreen(point:tpoint): boolean;
begin
result:=false;
if((point.x<MSX1)
or (point.x>MSX2)
or (point.y<MSY1)
or (point.y>MSY2)) then
result:=true;
end;

procedure ChopTree;
var
i,treeID:integer;
treespots: tpointarray;
mouseGo,mouseGo2:tpoint;
begin
treespots:=[point(2706, 3397),point(2706, 3399),point(2699, 3399),point(2699, 3397)];
if(not isatTrees) then
gototrees;
for i:=0 to high(treespots) do
begin
if(findent = treespots[i]) then
continue;
treeID:=R_GetObjectAt(0,treespots[i]).ID;
writeln(treeID);
if(treeID = 2176) then
begin
if(not r_iswalking) then
begin
mouseGo:=point(treespots[i].x-1,treespots[i].y-1);
mouseGo2:=point(treespots[i].x,treespots[i].y);
mouseGo:=point((R_TileToMsHeight(mouseGo,R_GetTileHeight(mouseGo)).x+R_TileToMsHeight(mouseGo2,R_GetTileHeight(mouseGo2)).x)/2,
(R_TileToMsHeight(mouseGo,R_GetTileHeight(mouseGo)).y+R_TileToMsHeight(mouseGo2,R_GetTileHeight(mouseGo2)).y)/2);
if(pointNotOnScreen(mouseGo)) then
begin
R_BlindWalkMS(point(2702+randomrange(-1,1),3398+randomrange(-1,1)));
//compassmovement(45,90,false);
end;
MMouse(mouseGo.x,mouseGo.y, 1, 1);
wait(randomrange(400,600));
if(R_Isuptext('Magic tree')) then
begin
ClickMouse2(Mouse_Left);
AL_HumanRandomMouse;
currentTree:=treespots[i];
R_FNRwait(randomrange(900,1400),300);
break;
end
else
R_BlindWalkMS(point(2702+randomrange(-1,1),3398+randomrange(-1,1)));
end;
end
else
continue;
end;
end;

procedure haveDied;
var location : TPoint;
begin

if(not skiller) then
begin
for spot:=1 to 28 do
begin
invmouse(spot,3);
wait(randomrange(150,250));
if(isuptext(AxeType) or isuptext('roken')) then
begin
invmouse(spot,1);
Break;
end;
end;
end;
repeat
R_BlindWalk(point(3206, 3209));
wait(randomrange(800,1000));
if(R_getplane=0) then
begin
location := R_TileToMS(point(3205, 3208));
Mouse(location.x, location.y, 1, 1, mouse_right);
if (not ChooseOption('Climb-up')) then
begin
terminatescript;
end;
wait(randomrange(800,1000));
end;
until((R_getplane=1) or (R_getplane=2));
repeat

if(R_getplane=1) then
begin
location := R_TileToMS(point(3205, 3208));
Mouse(location.x, location.y, 1, 1, mouse_right);
if (not ChooseOption('Climb-up')) then
terminatescript;
wait(randomrange(800,1000));
end;
until(R_getplane=2);
if(R_getplane=2) then
begin
repeat
R_BlindWalk(Point(3209, 3219));
wait(randomrange(800,1000));
Banker(point(3208, 3221));
wait(randomrange(800,1100));
until(bankscreen);
BankLogs;
wait(randomrange(800,1100));
if(skiller) then
begin
Withdraw(1, 0, 1); //['Cammy Tele']);
end
else
begin
wait(randomrange(500,600)); //airs in second slot
Withdraw(1, 0, 5); //['Air Rune']);
wait(randomrange(500,600)); //laws in third slot
Withdraw(2, 0, 1);//, ['Law Rune']);
end;
wait(randomrange(800,1100));
closebank;
wait(randomrange(600,1000));
if(skiller) then
invmouse(2,1);
wait(randomrange(2500,3000));
telewalktrees;
end;
end;

procedure MyWorld(W: Integer);//Pick World On WOrld Screen
var
WArray: array of Integer;
I: Integer;
begin
Warray := [302, 303, 304, 305, 306, 309, 310, 311, 312, 313, 314, 317, 318, 319, 320, 321, 322, 326, 327, 328, 329, 330, 333, 334, 335, 336, 338, 341, 342, 343, 344, 345, 346, 349, 350, 351, 352, 353, 354, 357, 358, 359, 360, 361, 362, 366, 367, 368, 369, 370, 373, 374, 375, 376, 377, 378];
if InIntArrayEx(WArray, i, W) then
begin
ElfMouse(250 + ((i / 16) * 90), 80 + (24 * (i mod 16)));
Wait(1000)
ClickMouse2(Mouse_Left);
Exit;
end
else
i := 28;
ElfMouse(250 + ((i / 16) * 90), 80 + (24 * (i mod 16)));
Wait(1000)
ClickMouse2(Mouse_Left);
Exit;
end;

function OpenWScreen: Boolean;
var
x, y: integer;
begin
Result := False;
if findcolortolerance(x, y, 3166829, 350, 190, 435, 220, 10) then
Result := True;
if Loggedin then
Exit;
if not result then
begin
Mmouse(54, 475, 1, 1);
wait(200);
ClickMouse2(Mouse_Left);
Wait(1500);
Result := True;
end;
end;

procedure SwitchWorldTo;
var
WArray: array of Integer;
num: integer;
begin
num:= Randomrange(2,50);
Warray := [302, 303, 304, 305, 306, 309, 310, 311, 312, 313, 314, 317, 318, 319, 320, 321, 322, 326, 327, 328, 329, 330, 333, 334, 335, 336, 338, 341, 342, 343, 344, 345, 346, 349, 350, 351, 352, 353, 354, 357, 358, 359, 360, 361, 362, 366, 367, 368, 369, 370, 373, 374, 375, 376, 377, 378];
Logout;
OpenWScreen;
MyWorld(WArray[num]);
writeln(warray[num]);
LoginPlayer;
end;

Procedure Antiban;
begin
R_FindNormalRandoms;
findent;
if(r_isanimating) then
begin
case random(45) of
1: HoverSkill(randomrange(1,23), False);
2: HoverOnlineFriend;
//3: compassmovement(100,150,false);
4: BoredHuman;
8: Turnonrun;
9: RandomFKeys(false);
10: MMouseOffClient('random');
//11: PressKey(randomrange(1,4));
12..15: AL_HumanRandomMouse;
end;
Wait(randomrange(800,1000));
end;
end;

begin
SetupSRL();
DeclarePlayers;
SetScreenName(Players[CurrentPlayer].Nick);
ActivateClient;
SetupReflection;
ClearDebug;
writeln('Welcome to Vizzyy Seers Magic Bot.');
initVars;
AddOnTerminate('Release');
If (Not LoggedIn) Then
begin
LogInPlayer;
end;
makecompass('n');
setAngle(Srl_angle_high);

repeat

if (((TimeFromMark(PlantTime) / 1000) / 60) > 2) then
begin
pickedPlant:=false;
end;

if (((TimeFromMark(WorldTime) / 1000) / 60) > switchinterval) then
begin
Writeln('Switching World');
SwitchWorldTo;
MarkTime(WorldTime);
switchinterval:=randomrange(450,700);
timesswitched:=timesswitched+1;
end;

if(not R_NearTile(point(2705,3397),400) and (not isatlumby))then
begin
writeln('Somethings fucked, we are too far.');
CastSpellByNumber(1);
wait(15000);
end;
//main loop
if(findchatboxtext('You do not have',8,0))then
begin
checkaxebroken;
end;
progressreport;

plant;
froggieRandom;
FindEnt;

if(R_FindNormalRandoms) then
randoms:=randoms+1; ;
if(solvebox) then
randoms:=randoms+1;

AntiBan;

if(FindBirdsNest1) then
Birdsnest := Birdsnest + 1;

if(AmIDead1 or isatlumby) then
begin
writeln('Died/lumby, resetting');
died:=died+1;
haveDied;
end;

if(InvFull) then
begin
GoToBank;
OpenBank1;
BankLogs;
closebank;
GoToTrees;
end
else
begin
if((not R_IsAnimating) and (not Al_playerwalking)) then
begin
writeln('right hurr');
ChopTree;
end;
end;
until (Not LoggedIn)
TerminateScript;
end.

Whatever function you used to find and click the birds nest wasn't compiling, it's probably something on my end that i haven't set up correctly. The only other change I made was changing the mouse moving procedure in your findTree procedure. Just changed elfMouse to MMouse and it worked fine for me. Thanks for the great script, it looks incredibly solid.

jhildy

2014-04-29 14:52:00

Hey man this is a great script. I decided to make a few tweaks to it in order to make it work like I would like it to. It was just a couple things including:
* Added a wieldAxe variable (because Im not a skiller but I cant wield a dragon axe)
* Added a function that figures out how many players are in each world.
* Uses the amount of players in each world to decide whether you should switch worlds or wait for more trees to respawn.
* Added my own (kind of primative, although it works fine) method of switching worlds at the world selection screen. (yours was acting kind of funky and would click on either a free world or a pvp world every once in a while.
* Added a few things to the progress report.

I think that's everything I did on it. Anyway, thanks a lot for this script, it runs beautifully except for a few randoms that throw it off (frog, sandwich lady, giles for some reason). Other than that it is flawless.

program SeersMagics;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$I SRL-OSR/SRL/Reflection/Reflection.simba}
{$I SRL-OSR/SRL/misc/al_functions.simba}

type
TPlayer = record
Name: String;
Level: Integer;
Tile: TPoint;
end;

TPlayerArray = Array of TPlayer;

var
WArray: array of Integer;
CurTime, StartTime, ProgTime,plantTime,birdsnest,timesswitched,worldtime,switchinterval,ents,ProgBank ,died, TreeFail, randoms, Lagg,brokentimes, TreeColor, BankColor1, spot: integer;
pin,axetype: string;
skiller: boolean;
toTrees,toBank,seersToTrees,toBob,fromBob,seersBanks:TPointArray;
myloc,currentTree:TPoint;
evacced,pickedPlant,wieldAxe:boolean;
ent:tnpc;
entnpcs:tnpcarray;
failedTrees, tries, worldIndex, CI: Integer;
WorldCoord: TPointArray;
NumPeople: array of Integer;
StartXP, CurXP: Integer;

Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
pin:='';
skiller:=false;
wieldAxe := false;
SetScreenName(Players[CurrentPlayer].Nick);
End;

procedure initVars;
begin
setLength(NumPeople, 56);
for CI:= 0 to 55 do
begin
NumPeople[CI] := -1;
end;
WArray := [302, 303, 304, 305, 306, 309, 310, 311, 312, 313, 314, 317, 318,
319, 320, 321, 322, 326, 327, 328, 329, 330, 333, 334, 335, 336, 338,
341, 342, 343, 344, 345, 346, 349, 350, 351, 352, 353, 354, 357, 358, 359,
360, 361, 362, 366, 367, 368, 369, 370, 373, 374, 375, 376, 377, 378];
WorldCoord := [point(240, 106), point(236, 129), point(239, 154), point(242, 180), point(238, 201),
point(238, 250), point(235, 271), point(250, 299), point(239, 321), point(243, 347),
point(241, 370), point(232, 419), point(241, 442), point(330, 80), point(329,105),
point(338,129), point(325, 153), point(323, 201), point(321, 226), point(325, 250),
point(322, 275), point(326, 297), point(330, 320), point(330, 344), point(331, 371),
point(330,395), point(329, 441), point(423, 79), point(423, 105), point(420, 130),
point(420, 155), point(421, 177), point(424, 201), point(418, 225), point(421, 250),
point(421, 274), point(418, 297), point(422, 322), point(422, 344), point(414, 368),
point(420, 394), point(424, 417), point(423, 443), point(513, 83), point(516, 104),
point(514, 156), point(514, 176), point(517, 201), point(513, 225),
point(515, 249), point(516, 273), point(512, 295), point(511,322), point(509, 344),
point(511, 369), point(513, 392)];
lampskill:='agility';
tries := 0;
worldIndex := randomrange(0,55);
failedTrees := 0;
AxeType:='Drag';
TreeColor:= 7579819;
evacced:=false;
pickedPlant:=false;
BankColor1:=8555406;
MarkTime(ProgTime);
MarkTime(worldtime);
switchinterval:=randomrange(450,700);
treefail:=0;
ProgBank := 0;
R_RunAwayDirection := 'north';
R_Reincarnate := True;
R_CombatRandoms := True;
timesswitched:=0;
died:=0;
ents:=0;
brokentimes:=0;
randoms:=0;
birdsnest:=0;
seersbanks:=[point(2721,3494),point(2722,3494),point(2724,3494),point(2727,3494),point(2728,3494),point(2729,3494)];
toTrees := [Point(2725 + RandomRange(-2, 2), 3492 + RandomRange(-2, 2)), Point(2726 + RandomRange(-2, 2), 3480 + RandomRange(-2, 2)), Point(2724 + RandomRange(-2, 2), 3464 + RandomRange(-2, 2)), Point(2718 + RandomRange(-2, 2), 3449 + RandomRange(-2, 2)), Point(2717 + RandomRange(-2, 2), 3433 + RandomRange(-2, 2)), Point(2716 + RandomRange(-2, 2), 3417 + RandomRange(-2, 2)), Point(2715 + RandomRange(-2, 2), 3402 + RandomRange(-2, 2)), Point(2701 + RandomRange(-2, 2), 3395 + RandomRange(-2, 2)),point(2703 + RandomRange(-2, 2),3397 + RandomRange(-2, 2))];
toBank:=[Point(2702 + RandomRange(-2, 2), 3398 + RandomRange(-2, 2)), Point(2703 + RandomRange(-2, 2), 3393 + RandomRange(-2, 2)), Point(2708 + RandomRange(-2, 2), 3392 + RandomRange(-2, 2)), Point(2713 + RandomRange(-2, 2), 3392 + RandomRange(-2, 2)), Point(2714 + RandomRange(-2, 2), 3397 + RandomRange(-2, 2)), Point(2716 + RandomRange(-2, 2), 3402 + RandomRange(-2, 2)), Point(2715 + RandomRange(-2, 2), 3407 + RandomRange(-2, 2)), Point(2715 + RandomRange(-2, 2), 3412 + RandomRange(-2, 2)), Point(2715 + RandomRange(-2, 2), 3417 + RandomRange(-2, 2)), Point(2714 + RandomRange(-2, 2), 3422 + RandomRange(-2, 2)), Point(2713 + RandomRange(-2, 2), 3427 + RandomRange(-2, 2)), Point(2713 + RandomRange(-2, 2), 3432 + RandomRange(-2, 2)), Point(2713 + RandomRange(-2, 2), 3437 + RandomRange(-2, 2)), Point(2710 + RandomRange(-2, 2), 3442 + RandomRange(-2, 2)), Point(2712 + RandomRange(-2, 2), 3447 + RandomRange(-2, 2)), Point(2714 + RandomRange(-2, 2), 3452 + RandomRange(-2, 2)), Point(2718 + RandomRange(-2, 2), 3456 + RandomRange(-2, 2)), Point(2718 + RandomRange(-2, 2), 3461 + RandomRange(-2, 2)), Point(2718 + RandomRange(-2, 2), 3466 + RandomRange(-2, 2)), Point(2720 + RandomRange(-2, 2), 3471 + RandomRange(-2, 2)), Point(2724 + RandomRange(-2, 2), 3475 + RandomRange(-2, 2)), Point(2726 + RandomRange(-2, 2), 3480 + RandomRange(-2, 2)), Point(2727 + RandomRange(-2, 2), 3485 + RandomRange(-2, 2)), Point(2726 + RandomRange(-2, 2), 3490 + RandomRange(-2, 2))];
end;

function nextXp: Integer;
var NS, NE, NN: Integer;
var cur, temp: Integer;
begin
NS:= 10692629;
NE:= 11805606;
NN:= 13034431;
cur:= R_GetSkillLevel(SKILL_WOODCUTTING);
case cur of
96: temp:= NS;
97: temp:= NE;
98: temp:= NN;
end;
Result:= temp;
end;

function CreatePlayer(Name: String; Level: Integer; Tile: TPoint): TPlayer;
begin
Result.Name := Name;
Result.Level := Level;
Result.Tile := Tile;
end;
(* Credit for this function goes entirely to Frement*)
function R_GetPlayers: TPlayerArray;
var
I, J, _Count, _Player, _Name, _Level, _X, _Y: Integer;
begin
_Count := SmartGetFieldArraySize(SmartCurrentTarget, 0, 'client.ga', 0);
SetLength(Result, J);
for I := 0 to _Count - 1 do begin
_Player := SmartGetFieldArrayObject(SmartCurrentTarget, 0, 'client.ga', I);
if (_Player <= 0) then
Continue;
Inc(J);
SetLength(Result, J);
_Name := SmartGetFieldObject(SmartCurrentTarget, _Player, 'e');
_Level := SmartGetFieldInt(SmartCurrentTarget, _Player, 'j') * 1106596591;
_X := (SmartGetFieldInt(SmartCurrentTarget, 0, client_baseX) * client_baseX_Multiplier) + (SmartGetFieldInt(SmartCurrentTarget, _Player, 's') * -806469611) div 128;
_Y := (SmartGetFieldInt(SmartCurrentTarget, 0, client_baseY) * client_baseY_Multiplier) + (SmartGetFieldInt(SmartCurrentTarget, _Player, 'y') * -54698801) div 128;
Result[J - 1] := CreatePlayer(R_GetJavaString(_Name, 512), _Level, Point(_X, _Y));
SmartFreeObject(SmartCurrentTarget, _Name);
SmartFreeObject(SmartCurrentTarget, _Player);
end;
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;

Function PerHour: String;
var LPH, XPPH, THR: Extended;
begin
THR := (GetTimeRunning) / 1000.0 / 60.0 / 60.0;
XPPH:= (R_GetSkillExp(skill_woodcutting) - StartXP) / THR;
LPH := ((R_GetSkillExp(skill_woodcutting) - StartXP)/250) / THR;
Result:= inttostr(floor(XPPH)) + ' XP per hour, ' + inttostr(floor(LPH)) + ' logs per hour.';
end;

procedure ProgressReport;
var xp: Integer;
begin
xp:= NextXP - CurXP;
cleardebug;
MarkTime(CurTime);
writeln('Banked ' + inttostr(ProgBank) + ' invs in ' + inttostr(((TimeFromMark(ProgTime) / 1000) / 60)) + ' mins.');
writeln('Birds Nests: '+inttostr(birdsnest)+'. Died: '+inttostr(died)+', Ents: '+inttostr(ents));
writeln('Times Axe Broken: '+inttostr(brokentimes)+'. Random Events: '+inttostr(randoms)+', WorldSwitches: '+inttostr(timesswitched));
writeln('Gained ' + inttostr(R_GetSkillExp(skill_woodcutting) - StartXP) + ' experience, cut ' + inttostr((R_GetSkillExp(skill_woodcutting) - StartXP)/250) + ' Magic logs');
if ((R_GetSkillExp(skill_woodcutting) - StartXP) > 0) then
writeln(PerHour);
writeln('' + inttostr(xp) + ' XP until level ' + inttostr((R_GetSkillLevel(SKILL_WOODCUTTING) + 1)) + ', ' + inttostr(floor((xp/250))) + ' magic logs to cut.');
//writeln('Cut ' + inttostr((R_GetSkillExp(skill_woodcutting) - StartXP)/250) + ' logs. ' + 'That is ' + inttostr(((R_GetSkillExp(skill_woodcutting) - StartXP)/250) / (((GetTimeRunning / 1000) / 60)/ 60)) + ' per hour.');
writeln('There are ' + inttostr(NumPeople[worldIndex]) + ' people in this world.');
writeln(entnpcs);
end;



procedure Release;
begin
srl_freebitmaps;
freebitmap(bmpAdmin);
freebitmap(bmpMinimapMask);
freedtm(Lamp);
freedtm(BookOfKnowledge);
//progressreport;
end;

function withinZone(topLeft,botRight: tpoint): boolean;
begin
MyLoc:=R_GetTileGlobal;
result:=((myloc.x>topLeft.x) and (myloc.x<botRight.x) and (myloc.y<topLeft.y) and (myloc.y>botRight.y));
end;

function isAtTrees: boolean;
begin
result:=withinZone(Point(2696, 3402), Point(2707, 3394));
end;

function isInBank: boolean;
begin
result:=withinZone(Point(2720, 3494), Point(2730, 3486));
end;

function isAtLumby: boolean;
begin
result:=withinZone(Point(3200, 3236), Point(3226, 3200));
end;

function FindBirdsNest1: Boolean;
var // seed nest [(5073, 1, (2726, 3492)), ring nest (5074, 1, (2726, 3493))]
i: Integer;
itemsInArea:TGroundItemArray;
nest : TRSObject;
location: TPoint;
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.');
nest := R_GetObjectAt(0, itemsInArea[i].Tile);
location := R_TileToMS(nest.Tile);
Mouse(location.x, location.y, 1, 1, mouse_right);
Result:= ChooseOption('Take');
end;
end;
end;

function AmIDead1: boolean;
begin
if(R_GetHealth = 0) then
begin
result:=true;
end
else
result:=false;
end;

procedure teleWalkTrees;
var i: Integer;
begin
if (not skiller) then
begin
wait(2000+random(100));
CastSpellByNumber(27);
wait(6000+random(300));
end
else
begin
for i:= 1 to InvCount do
begin
InvMouse(i, 3);
if (isUpText('teleport')) then
begin
InvMouse(i,1);
break;
end;
end;
end;
seersToTrees:=[Point(2756, 3476), Point(2748, 3465), Point(2734, 3456), Point(2727, 3441), Point(2728, 3423), Point(2728, 3407), Point(2715, 3397), Point(2703, 3397)];
R_WalkPath(seersToTrees);
end;

procedure RepairAxe;
var
Guard: TNPC;
Tp : Tpoint;
begin
brokentimes:=brokentimes+1;
MyLoc:=R_GetTileGlobal;
toBob:=[Point(3225, 3218), Point(3234, 3214), Point(3230, 3203)];
fromBob:=[Point(3235, 3203), Point(3232, 3216), Point(3218, 3218), Point(3206, 3210)];

if (wieldAxe) then
begin
gametab(tab_equip)
wait(randomrange(700,900));
elfMouse(592,303);//,3,3,true);
ClickMouse2(Mouse_Left);
end;

for spot:=1 to 28 do
begin
invmouse(spot,3);
wait(randomrange(150,250));
if(isuptext(AxeType) or isuptext('roken')) then
begin
invmouse(spot,3);
Break;
end;
end;
if(isUpText('roken')) then
begin
Writeln('Excercising RepairAxe');
R_WalkPath(toBob);
repeat
repeat
if R_FindNpc('Bob', Guard) then // Loads the record for Guard.
begin
Tp := Guard.Tile; //Get guard tile location
Tp := R_TileToMs(Tp); //Changes Tile into a Onscreen Point
elfmouse(Tp.x, Tp.y);
if waituptext('Bob', 200) then
begin
InvMouse(spot,1);
elfmouse(Tp.x, Tp.y);
ClickMouse2(Mouse_Left);
wait(randomrange(1500,2000));
end;
end;
until(aretalking);

if(areTalking()) then
begin
ClickContinueEx(true,true);
elfmouse(261,401);//,3,3,true);
ClickMouse2(Mouse_Left);
ClickContinueEx(true,true);
ClickContinueEx(true,true);
wait(randomrange(1500,2000));
end;

for spot:=1 to 28 do
begin
invmouse(spot,3);
wait(randomrange(150,250));
if(isuptext(AxeType)) then
begin
invmouse(spot,3);
Break;
end;
end;

until(isUpText(AxeType));
end;
if(isuptext(AxeType)) then
begin
writeln('Axe is good.');
if(wieldAxe) then
invmouse(spot,1);
teleWalkTrees;
end;
end;

procedure BankLogs;
begin
writeln('Bank logs');
wait(lagg);
if(BankScreen) then
begin
if(wieldAxe) then
QuickDeposit('inv');
if(not wieldAxe) then
Deposit(2,28,true);
end;
ProgBank := ProgBank + 1;
end;


function turnonrun: Boolean;
var
x,y : Integer;
enable:boolean;
begin
Result := False;
enable:=true;
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
writeln('gotobank');
if(BankScreen) then
begin
BankLogs;
end;
TurnOnRun;
R_WalkPath(toBank);
if(not IsInBank) then
R_BlindWalk(Point(2726, 3491));
writeln('Walk to bank successful.');
wait (lagg);
end;

function Banker(spot: tpoint): boolean;
var
tile:tpoint;
begin
Tile:= R_TileToMs(spot);
elfmouse(tile.x,tile.y);
wait(randomrange(500,600));
if(random(2) = 1) then
begin
ClickMouse2(Mouse_Left);
wait(2000+random(100));
end
else
begin
ClickMouse2(Mouse_Right);
ChooseOptionMulti(['ank','ooth']);
wait(2000+random(100));
end;
if(pinpending) then
confirmpin;
if(pinscreen) then
inpin(pin);
if(bankscreen) then
begin
result:=true;
end
else
result:=false;
end;

procedure OpenBank1;
begin
makecompass('n');
myloc:=R_gettileGlobal;
writeln('openbank ('+inttostr(myloc.x)+','+inttostr(myloc.y)+')');
Repeat
Banker(seersbanks[randomrange(0,5)]);
wait (1000+random(2000));
if(not isInBank) then
begin
writeln('Bank Contingency');
R_BlindWalk(Point(2726, 3492));
end;
until(BankScreen)
end;

procedure CheckAxeBroken;
begin
if(not WieldAxe)then
begin
invmouse(1,3);
end
else
begin
ftab(tab_Equip);
wait(1000+random(100));
elfMouse(592,303);//,3,3);
wait(1000+random(100));
end;
if(isuptext(AxeType)) then
writeln('Axe good.');
if(isUpText('Broken')) then
begin
writeln('Axe broken.');
gotobank;
openbank1;
banklogs;
if(bankscreen) then
begin
writeln('Withdrawing');
if(skiller) then
begin
wait(randomrange(500,600)); //coins in first bank slot
Withdraw(0, 0, 1800);//, ['Coins']);
wait(randomrange(500,600)); //Cammy in second slot
Withdraw(1, 0, 1); //['Cammy Tele']);
wait(randomrange(500,600));
end
else
begin
wait(randomrange(500,600)); //coins in first bank slot
Withdraw(0, 0, 1800);//, ['Coins']);
wait(randomrange(500,600)); //airs in second slot
Withdraw(1, 0, 5); //['Air Rune']);
wait(randomrange(500,600)); //laws in third slot
Withdraw(2, 0, 1);//, ['Law Rune']);
wait(randomrange(500,600));
end;
end;
closebank;
wait(2000+random(1000));
elfmouse (644,91);//,3,3,true);
ClickMouse2(Mouse_Left);
wait(randomrange(600,800));
CastSpellByNumber(1);
wait(randomrange(600,800));
if(findchatboxtext('need to wait',8,0)) then //skill on cooldown then use reagents
begin
openbank1;
if(skiller) then
begin
wait(randomrange(500,600));
Withdraw(2, 0, 1); //['Lumby Tab']);
wait(randomrange(500,600));
closebank;
wait(randomrange(600,800));
invmouse(4,1);
end
else
begin
wait(randomrange(500,600));
Withdraw(3, 0, 1);//, ['Earth Rune']);
wait(randomrange(500,600));
Withdraw(2, 0, 1);//, ['Law Rune']);
wait(randomrange(500,600)); //airs in second slot
Withdraw(1, 0, 3); //['Air Rune']);
wait(randomrange(500,600));
closebank;
wait(randomrange(600,800));
CastSpellByNumber(19);
end;
end;
wait(15000+random(300));
RepairAxe;
Exit;
end;
end;

Function FindEnt: tpoint;
begin
if (R_Findnpc('Magic tree',ent)) then
begin
entnpcs:=r_getallnpcs;
result:=ent.tile;
if(ent.tile = currentTree) then
begin
if(not evacced) then
begin
Writeln ('An ent has been detected...');
ents:=ents+1;
R_BlindWalkMS(point(2702+randomrange(-1,1),3398+randomrange(-1,1)));
evacced:=true
end;
end;
end
else
begin
evacced:=false;
result:=point(0,0);
end;
end;

procedure GoToTrees;
begin
writeln('gototrees');
myloc:= R_GetTileGlobal;
if(not isattrees and not isatlumby) then //if outside tree zone reflection walk to tree zone
begin
TurnOnRun;
R_WalkPath(toTrees);
if(not isattrees) then
R_BlindWalk(point(2702,3398));
writeln('Walk to trees successfully');
end;
wait (lagg);
end;

function plant:boolean;
var
Ivy:tnpc;
begin
if(R_Findnpc('Strange',ivy)) then
begin
if(R_NearTile(ivy.tile,5) and (not pickedPlant))then
begin
ElfMouse(R_Tiletoms(ivy.tile).x,R_Tiletoms(ivy.tile).y);
ClickMouse2(Mouse_Left);
pickedPlant:=true;
MarkTime(plantTime);
if(IsChatBoxTextAnyLine('fruit',0)) then
pickedPlant:=false;
end;
end;
end;

function froggieRandom: boolean;
var
Frogs:tnpcArray;
Peach:Tnpc;
i:integer;
begin
result:=false;
if(withinZone(point(2450,4797),point(2480,4760))) then
begin
R_FindNPC(1329,Peach);
frogs:=R_GetAllNpcs;
writeln(Peach);
for i:=0 to high(frogs) do
begin
if(frogs[i].Index = 1329) then
Peach:=frogs[i];
end;
R_BlindWalk(Peach.tile);
for i:=0 to 5 do
begin
R_FindNPC(1329,Peach);
Mouse(R_TiletoMs(Peach.tile).x,R_TiletoMS(Peach.Tile).y,3,3,true);
wait(2000+random(1000));
if(aretalking)then
break;
end;
if(aretalking) then
begin
ClickContinueEx(true,true);
ClickText('back','CharsNPC07',MCX1,MCY1,MCX2,MCY2,true);
wait(randomrange(600,800));
ClickContinueEx(true,true);
ClickContinueEx(true,true);
result:=true;
end;
end;
end;

function pointNotOnScreen(point:tpoint): boolean;
begin
result:=false;
if((point.x<MSX1)
or (point.x>MSX2)
or (point.y<MSY1)
or (point.y>MSY2)) then
result:=true;
end;

procedure ChopTree;
var
i,treeID, stumps:integer;
treespots: tpointarray;
mouseGo,mouseGo2:tpoint;
begin
stumps := 0;
treespots:=[point(2706, 3397),point(2706, 3399),point(2699, 3399),point(2699, 3397)];
if(not isatTrees) then
gototrees;
for i:=0 to high(treespots) do
begin
if(findent = treespots[i]) then
continue;
treeID:=R_GetObjectAt(0,treespots[i]).ID;
// writeln(treeID);
if(treeID = 2176) then
begin
if(not r_iswalking) then
begin
mouseGo:=point(treespots[i].x-1,treespots[i].y-1);
mouseGo2:=point(treespots[i].x,treespots[i].y);
mouseGo:=point((R_TileToMsHeight(mouseGo,R_GetTileHeight(mouseGo)).x+R_TileToMsHeight(mouseGo2,R_GetTileHeight(mouseGo2)).x)/2,
(R_TileToMsHeight(mouseGo,R_GetTileHeight(mouseGo)).y+R_TileToMsHeight(mouseGo2,R_GetTileHeight(mouseGo2)).y)/2);
if(pointNotOnScreen(mouseGo)) then
begin
R_BlindWalkMS(point(2702+randomrange(-2,2),3398+randomrange(-2,2)));
//compassmovement(45,90,false);
end;
MMouse(mouseGo.x,mouseGo.y, 1, 1);
wait(randomrange(400,600));
if(R_Isuptext('Magic tree')) then
begin
ClickMouse2(Mouse_Left);
AL_HumanRandomMouse;
currentTree:=treespots[i];
R_FNRwait(randomrange(900,1400),300);
failedTrees:= 0;
break;
end
else
R_BlindWalkMS(point(2702+randomrange(-1,1),3398+randomrange(-1,1)));
end;
end
else
begin
inc(stumps);
continue;
end;
end;
if (stumps = 4) then
inc(failedTrees);
end;

procedure haveDied;
var location : TPoint;
begin

if (skiller) then
begin
for spot:=1 to 28 do
begin
invmouse(spot,3);
wait(randomrange(150,250));
if(isuptext(AxeType) or isuptext('roken')) then
begin
invmouse(spot,1);
Break;
end;
end;
end;
repeat
R_BlindWalk(point(3206, 3209));
wait(randomrange(800,1000));
if(R_getplane=0) then
begin
location := R_TileToMS(point(3205, 3208));
Mouse(location.x, location.y, 1, 1, mouse_right);
if (not ChooseOption('Climb-up')) then
begin
terminatescript;
end;
wait(randomrange(800,1000));
end;
until((R_getplane=1) or (R_getplane=2));
repeat

if(R_getplane=1) then
begin
location := R_TileToMS(point(3205, 3208));
Mouse(location.x, location.y, 1, 1, mouse_right);
if (not ChooseOption('Climb-up')) then
terminatescript;
wait(randomrange(800,1000));
end;
until(R_getplane=2);
if(R_getplane=2) then
begin
repeat
R_BlindWalk(Point(3209, 3219));
wait(randomrange(800,1000));
Banker(point(3208, 3221));
wait(randomrange(800,1100));
until(bankscreen);
BankLogs;
wait(randomrange(800,1100));
if (not skiller) then
begin
wait(randomrange(500,600)); //airs in second slot
Withdraw(1, 0, 5); //['Air Rune']);
wait(randomrange(500,600)); //laws in third slot
Withdraw(2, 0, 1);//, ['Law Rune']);
wait(randomrange(800,1100));
closebank;
wait(randomrange(600,1000));
end;
if(skiller) then
begin
wait(randomrange(500,600)); //Cammy in second slot
Withdraw(1, 0, 1); //['Cammy Tele']);
wait(randomrange(500,600));
end;
wait(randomrange(2500,3000));
telewalktrees;
end;
end;

procedure MyWorld(W: Integer);//Pick World On WOrld Screen
var

I: Integer;
begin
Mouse(WorldCoord[WorldIndex].x, WorldCoord[WorldIndex].y, 0, 0, mouse_left);
wait(200);
if (w = 55) then
WorldIndex := 0
else
inc(WorldIndex);
end;

function OpenWScreen: Boolean;
var
x, y: integer;
begin
Result := False;
if findcolortolerance(x, y, 3166829, 350, 190, 435, 220, 10) then
Result := True;
if Loggedin then
Exit;
if not result then
begin
Mmouse(54, 475, 1, 1);
wait(200);
ClickMouse2(Mouse_Left);
Wait(1500);
Result := True;
end;
end;

procedure SwitchWorldTo;
var
WArray: array of Integer;
num: integer;
begin
num:= Randomrange(2,50);
Warray := [302, 303, 304, 305, 306, 309, 310, 311, 312, 313, 314, 317, 318, 319, 320, 321, 322, 326, 327, 328, 329, 330, 333, 334, 335, 336, 338, 341, 342, 343, 344, 345, 346, 349, 350, 351, 352, 353, 354, 357, 358, 359, 360, 361, 362, 366, 367, 368, 369, 370, 373, 374, 375, 376, 377, 378];
Logout;
OpenWScreen;
MyWorld(WorldIndex);
LoginPlayer;
NumPeople[WorldIndex] := high(R_GetPlayers);
writeln(inttostr(NumPeople[WorldIndex]) + ' people in this world.');
wait(1000);
end;

Procedure Antiban;
begin
R_FindNormalRandoms;
findent;
if(r_isanimating) then
begin
case random(45) of
1: HoverSkill(randomrange(1,23), False);
2: HoverOnlineFriend;
//3: compassmovement(100,150,false);
4: BoredHuman;
8: Turnonrun;
9: RandomFKeys(false);
10: MMouseOffClient('random');
//11: PressKey(randomrange(1,4));
12..15: AL_HumanRandomMouse;
end;
Wait(randomrange(800,1000));
end;
end;

begin
SetupSRL();
DeclarePlayers;
SetScreenName(Players[CurrentPlayer].Nick);
ActivateClient;
SetupReflection;
ClearDebug;
writeln('Welcome to Vizzyy Seers Magic Bot.');
initVars;
AddOnTerminate('Release');
If (Not LoggedIn) Then
begin
LogInPlayer;
end;
makecompass('n');
setAngle(Srl_angle_high);
NumPeople[0] := high(R_GetPlayers);
StartXP := R_GetSkillExp(skill_woodcutting);
repeat

if (((TimeFromMark(PlantTime) / 1000) / 60) > 2) then
begin
pickedPlant:=false;
end;

// if (((TimeFromMark(WorldTime) / 1000) / 60) > switchinterval) then
// begin
// Writeln('Switching World');
// SwitchWorldTo;
// MarkTime(WorldTime);
// switchinterval:=randomrange(450,700);
// timesswitched:=timesswitched+1;
// end;

if(not R_NearTile(point(2705,3397),400) and (not isatlumby))then
begin
writeln('Somethings fucked, we are too far.');
CastSpellByNumber(1);
wait(15000);
end;
//main loop
if(findchatboxtext('You do not have',8,0))then
begin
checkaxebroken;
end;
progressreport;

plant;
froggieRandom;
FindEnt;

if(R_FindNormalRandoms) then
randoms:=randoms+1; ;
if(solvebox) then
randoms:=randoms+1;
// if (SL_Solve) then
// inc(randoms);
AntiBan;

if(FindBirdsNest1) then
Birdsnest := Birdsnest + 1;

if(AmIDead1 or isatlumby) then
begin
writeln('Died/lumby, resetting');
died:=died+1;
haveDied;
end;
CurXP:= R_GetSkillExp(SKILL_WOODCUTTING);
if(InvFull) then
begin
GoToBank;
OpenBank1;
BankLogs;
closebank;
GoToTrees;
end
else
begin
NumPeople[WorldIndex]:= high(R_GetPlayers);
if((not R_IsAnimating) and (not Al_playerwalking)) then
begin
ChopTree;
writeln('Failed: ' + inttostr(failedTrees));
wait(100);
end;
end;
if (NumPeople[worldIndex] > 2) then
begin
tries := randomrange(5,12);
if (failedTrees >= tries) then
begin
failedTrees := 0;
Writeln('Switching World');
SwitchWorldTo;
MarkTime(WorldTime);
switchinterval:=randomrange(450,700);
timesswitched:=timesswitched+1;
end;
end
else
if (NumPeople[WorldIndex] < 2) then
begin
writeln('Staying in this world for now');
wait(200);
failedTrees :=0;
end;
until (Not LoggedIn)
TerminateScript;
end.

vizzyy

2015-02-08 17:48:28

Greatly appreciate your feedback, and I think you for contributing your ideas. I have since abandoned this project but was glad to see it helped the community somehow