PDA

View Full Version : Found my 1st script



rj
03-06-2013, 03:13 AM
Lol, found my first script (technicly second, leeched one that someone pretty much made before back in 2010)


Look how bad it is:

////////////////////////////////////////////////////////////////////////////////
//////////////////////////Soulsplit Log molestor Version 1.02///////////////////
/////////////////////////Made by RJJ95, Use at any bank/////////////////////////
///////////////Programed to be used at south neit, change bank color////////////
///////////if you want it to fletch somewere else. HAPPY BOTTING!!!!!!//////////
{
-Recent updates,Version 1.02-
added new feature, waits for logs to be fletched instead of waiting
-32000 miliseconds fixed bank bitmap, looks for usebank is a wider area
-searches for bank in a slightly wider area to combat camera shifting
-ADDED ANTIBAN, YOU CAN EDIT MESSAGE IT SENDS AT LINE 39,EDIT ANTIBANRATE=50 TO
WHAT EVER YOU WANT, THE HIGHER THE NUMBER, THE LESS LIKELY A BREAK WILL BE TAKEN
-added random breaktimes
}
////////////////////////////////////////////////////////////////////////////////
program Molestor;
{$i srl/srl.simba}
const
fletchlogcolor=10201131;
storebowcolor=5330965;
bank=1857394;
bankx=210;
banky=124;
bankxtwo=278;
bankytwo=164;
antibanrate=50;
minbreaktime=4; //min break time in minutes
maxbreaktime=9; // max break time in minutes

var
usebank,withall,outcome,resulte,bitch: Integer;
procedure antibanme;
begin
outcome := Random(antibanrate);
bitch := (maxbreaktime*60000)-(minbreaktime*60000);
resulte := Random(bitch)
if outcome = 1 then
begin
Writeln('Doing random antiban wait!')
TypeSend('This is boring lol');
wait(minbreaktime+resulte)
end;
end;
procedure storeall;
var
X, Y: Integer;
begin
Writeln('Looking for bow . . .')
if FindColorTolerance(X,Y,storebowcolor,557,213,722,2 47,19) then
begin
MouseSpeed:=15;
mmouse(x, y,1,1);
Writeln('Found bow to store.')
Wait(550 + Random(150));
ClickMouse(x, y, mouse_Right);
Wait(550 + Random(150));
FindBitmapToleranceIn(withall, X, Y,554, 210, 730, 322, 145)
mmouse(x, y,1,1);
Writeln('Storing bows . . .')
Wait(550 + Random(150));
ClickMouse(X, Y, mouse_Left)
Wait(850 + Random(150));
ClearDebug;
antibanme;
end;
end;
procedure bankit;
var
X, Y: Integer;
begin
Writeln('FLooking for bank . . .')
if FindColorTolerance(X,Y,bank,bankx,banky,bankxtwo,b ankytwo,17) then
begin
MouseSpeed:=15;
mmouse(x, y,1,1);
Writeln('Found bank.')
Wait(250 + Random(150));
ClickMouse(x, y, mouse_Right);
Wait(900 + Random(250));
FindBitmapToleranceIn(usebank, X, Y,31, 93, 455, 304, 165)
MouseSpeed:=40;
mmouse(x, y,1,1);
WriteLn('Opened Bank!');
Wait(500 + Random(120));
ClickMouse(X, Y, mouse_Left);
Wait(1500 + Random(250));
storeall;
end;
end;
procedure fletchinglogs;
var
X, Y: Integer;
begin
if FindColorTolerance(X,Y,fletchlogcolor,558,215,728, 455,15) then
begin
Wait(500 + Random(150));
fletchinglogs;
end;
bankit;
end;

procedure fletchit;
var
X, Y: Integer;
begin
Writeln('Finding knife . . .')
if FindColorTolerance(X,Y,7434874,683,420,727,457,15) then
begin
Writeln('Found knife.')
MouseSpeed:=15;
mmouse(x, y,1,1);
Wait(250 + Random(150));
ClickMouse(x, y, mouse_Left);
Writeln('Finding log . . .')
Wait(850 + Random(150));
FindColorTolerance(X,Y,fletchlogcolor,557,214,719, 458,15)
mmouse(x, y,1,1);
Writeln('Using knife on log . . . ')
Wait(250 + Random(150));
ClickMouse(x, y, mouse_Left);
Writeln('Waiting for fletch interface . . . ')
Wait(1400 + Random(150));
Writeln('Found fletching interface')
FindColorTolerance(X,Y,10799322,242,380,253,387,15 )
mmouse(x, y,1,1);
Wait(250 + Random(150));
ClickMouse(x, y, mouse_Right);
Wait(550 + Random(150));
mmouse(x, y+65,1,1);
Wait(550 + Random(150));
ClickMouse(x, y, mouse_Left);
//Writeln('Fletching logs . . . ')
//Wait(32000 + Random(2200));
//bankit;
fletchinglogs;
end;
end;


procedure closefletch;
var
X, Y: Integer;
begin
if FindColorTolerance(X,Y,8421504,423,29,491,45,15) then
begin
Writeln('Closing bank . . .')
MouseSpeed:=20;
mmouse(x, y,1,1);
Wait(250 + Random(150));
ClickMouse(x, y, mouse_Left);
Wait(700 + Random(150));
fletchit;
end;
end;
procedure withd;
var
X, Y: Integer;
begin
if FindColorTolerance(X,Y,storebowcolor,560,213,720,4 57,6) then
begin
if FindColorTolerance(X,Y,3358280,18,25,499,325,6) then
begin
Writeln('LogMolestor detected bows in your inventory and is banking them!')
bankit;
end;
Writeln('LogMolestor detected your bank open and bows in your inventory!')
storeall;
end;
if FindColorTolerance(X,Y,fletchlogcolor,560,213,720, 457,6) then
begin
if FindColorTolerance(X,Y,3358280,18,25,499,325,6) then
begin
Writeln('LogMolestor detected logs in your inventory and your bank open!')
closefletch;
end;
Writeln('LogMolestor detected logs in your inventory and is starting to fletch!')
fletchit
end;
if FindColorTolerance(X,Y,fletchlogcolor,16,25,502,32 7,6) then
begin
Writeln('Withdrawing logs . . .')
MouseSpeed:=18;
mmouse(x, y,1,1);
Wait(250 + Random(150));
ClickMouse(x, y, mouse_Right);
Wait(250 + Random(150));
mmouse(x, y+72,1,1);
Wait(250 + Random(150));
ClickMouse(x, y, mouse_Left);
Wait(950 + Random(150));
closefletch;
end;
end;
begin
usebank := BitmapFromString(38, 13, 'meJyTUdeWoTuauuMYEOHiko3+/2' +
'dARpg2MjAwYOVSaCMEoFlKaxvR2IPQRggXjtBCBk+ko8UjBBC 0Ec5' +
'GBmjiuCwlOx7xeBDNdirGI6Zf0IIaOcSIsVEGKQ8iG4JmAv7Q Jinl' +
'4HI2fr/gSlHEpBy00ENzNlZBglJEKqAPAgANRYUm');
withall := BitmapFromString(33, 14, 'meJyTUdeWGV5o6o5jEIQpiMlGRg' +
'4T/gMRfhG4dgYGBjRz4OJobEwDkcUxReB6kY0i1Qq4s+FcrFbgN5a ' +
'gFWgI0wo0RKoVQHFMBtaAgkcHGVYA2RATaBRQREb3qBX4rYBH E1Yu' +
'LjYe7XhU0gIBAMyXctQ=');
repeat
withd;
until False;
FreeBitmap(usebank);
FreeBitmap(withall);
end.


LOL

Ian
03-06-2013, 03:23 AM
Vast improvement rjj!

rj
03-06-2013, 03:27 AM
I didn't know how to use procedure before this, and I think I called each procedure to the next for it to loop

Wetish
03-06-2013, 05:34 PM
At least you free your bitmaps. I didn't at first.

litoris
03-06-2013, 07:00 PM
At least you free your bitmaps. I didn't at first.

I think that actually isn't needed, Freddy or Ben or someone else had made a thread saying that you don't need to free anything at the end of the script, because even though Sibma says that those weren't freed, the error message is posted right as Simba frees those by itself. So, you don't need to free anything...

Sjoe
03-06-2013, 07:06 PM
Oh, I thought it was your latest script release!

The Killer
03-06-2013, 07:11 PM
Mine:
Program KillersDecantor;
{$DEFINE SMART}
{$I SRL/SRL.simba}

//Layout from Spike's summonner
{================================================= =============================}
{========== INSTRUCTIONS ==========}
{================================================= =============================}
{========== Killer's Flask Decantor v1.0 ==========}
{================================================= =============================}
{========== 1. Fill out all the information below. ==========}
{========== 2. Put Empty Potion flasks in 9th bank slot. ==========}
{========= 3. Put the secondary item (potion) in the 10th bank slot.=========}
{======= 4. Make sure correct bank tab with secondary item is selected. =======}
{========== 5. Post proggies and bugs please. ==========}
{================================================= =============================}
const
Bank = 'veb'; // Varrock West Bank (default) [change to w/e you want from bank.simba]

var
loadsDone:Integer;
{================================================= =============================}
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := ''; //login in name
Pass := ''; //Password
Pin := ''; // Leave blank if you don't have one
Active := True;
end;
end;
{================================================= =============================}
{========== End of Setup ==========}
{================================================= =============================}

Procedure Banking;
begin;
OpenBankFast(Bank); //open bank
QuickDeposit(SRL_DEPOSIT_ALL); //deposits invotory

Withdraw(7, 0, 9); // flask wihtdraw
Wait(150 + Random(40));
MouseBankSlot(9, mouse_Right);
if (WaitOption('ithdraw-All', 500)) then
Writeln('Withdrew pot');
Closebank; //closes bank
end;

Procedure Makeflasks;
begin;
Writeln('Making flasks');
InvMouse(9, 1);// clicks use on the flasks
Wait(100 + Random(40));
InvMouse(10, 1);// uses flasks on potions
Wait(1000 + Random(40));
MouseBox(198, 412, 322, 452 , 1); // clicks make flasks in chatbox
wait(6500 + Random(50));
end;

Procedure progress;
var
Flasks, FlasksHour, TimeRan:Integer;
begin
TimeRan := (GetTimeRunning / 1000);
Flasks := ((9) * (loadsdone));
Flaskshour := (3600 * (Flasks)) / ((TimeRan));
ClearDebug;
Writeln('The Killers Flasks');
Writeln('Flasks made: ' + IntToStr(Flasks));
Writeln('Flasks per hour: ' + IntToStr(FlasksHour));
Writeln('Time running: ' + TimeRunning);
End;

begin
ClearDebug;
SRL_SixHourFix := True;
SMART_FixSpeed := True;
If (SRL_SixHourFix) then
SRL_Procs[srl_OnRSUpdate] := @SixHourFix;
SetupSRL;
DeclarePlayers;
LoginPlayer;
FindNormalRandoms;
Repeat
Banking;
MakeFlasks;
inc(loadsdone);
Progress;
until(false);
end.
{================================================= =============================}
xD
edit: note that it has been updated for 6hr fix awhile back ;)

J J
03-06-2013, 07:29 PM
See some similarities
program ThievingGuildChests;
{$DEFINE SMART}
{$i srl/srl.simba}

Function OpenChest:Boolean;
Var
X, Y, t: Integer;

begin
MarkTime(t);
repeat

X:=MSCX;
Y:=MSCY;
if FindObjTPA(X, Y, 7376552, 15, 1, 4, 9, 20, ['ract']) then
begin;
Writeln('We found the chest');
GetMousePos(X, Y);

Case Random(4) of
0..2: begin;
Mouse(X, Y, 5, 5, True);
Writeln('We clicked the chest');
end;

3: begin;
Mouse(X, Y, 5, 5, False);
WaitOption('Open', 300);
Writeln('We clicked the chest');
end;
end;

Wait(1500+random(1000));
Writeln('We are waiting to complete the thieving');
end;

begin;
repeat
Wait(200+random(200));
until FindChatBoxText('fail', 8, clBlack) or FindChatBoxText('open', 8, clBlack) or FindChatBoxText('reach', 8, clBlack) or (TimeFromMark(t) >= 10000);
end;

begin;
if FindChatBoxText('fail', 8, clBlack) then
Wait(300+random(200));
end;

begin;
if FindChatBoxText('open', 8, clBlack) then
Wait(2000+random(500));
end;

begin
if FindChatBoxText('reach', 8, clBlack) then
WriteLn('Time to open the doors');
Wait(300+random(200));
end;

until FindChatBoxText('reach', 8, clBlack) or (TimeFromMark(t) >= 15000);
end;


function OpenGate:Boolean;
var
X, Y, a, t, z: Integer;

begin
z:=0
t:=0
a:=0
MarkTime(t);

repeat
X:=MSCX;
Y:=MSCY;
z:=0
if FindObjTPA(X, Y, 1252637, 5, 1, 3, 3, 6, ['pen']) then
begin;
Writeln('We found the chest');
GetMousePos(X, Y);

Case Random(4) of
0..2: begin;
Mouse(X, Y, 2, 2, True);
Writeln('We clicked the gate');
end;

3: begin;
Mouse(X, Y, 2, 2, False);
WaitOption('Open', 300);
Writeln('We clicked the gate');
end;
end;

Writeln('We are waiting to open the gate');
Wait(2000+random(1000));
end;

begin;
repeat
Wait(200+random(200));
until FindChatBoxText('swings', 8, clBlack) or FindChatBoxText('bornly', 8, clBlack) or (TimeFromMark(t) >= 10000);
end;

begin;
if FindChatBoxText('bornly', 8, clBlack) then
WriteLn('We failed to open the gate');
Wait(200+random(200));
end;

begin;
if FindChatBoxText('swings', 8, clBlack) then
a:=a+1
end;

begin;
if (TimeFromMark(z) >= 10000) then
WriteLn('Time exceeded');
end;

until FindChatBoxText('swings', 8, clBlack) or (TimeFromMark(t) >= 20000);
end;


begin
SetUpSRL;
ActivateClient;
repeat
repeat OpenChest;
until(FindChatBoxText('reach', 8, clBlack));
OpenGate;
until(False);
end.

Has been a year :P

Enslaved
03-06-2013, 07:48 PM
Mine:
program CookingGuilder;
{$DEFINE SMART}
{$i srl/srl.simba}
(*
{=====================================Change Log v0.4 ====================================}
//Edited Banking Detection
//Reverted back to object detection, colorspiraltolerance not working great
//Error fix

{=====================================Change Log v0.3 ====================================}
//Edited Failsafe system
//Added Option to speed up range and inv selection as requested
//Changed Inv Uptext Search Method to WaitUpText instead of IsUpText to stop looping bug


{=====================================Change Log v0.2 ====================================}
// Failsafes added (If Range not clicked will hop worlds),
// breaking system added - Made By Flight - slightly edited variable names
*)


//======================================Intro======= =================================
//I made this script as a semi stable Script that coos at the cooking guild
//It is fairly basic as i just bashed this together
//=======================================Setup====== ==================================
//Just fill in the details of what you want to cook etc.
//currently works with any food that has the first option use and can be 1 click consumed
//Please post proggies and also some suggestions and errors
//
//===========================Declare Login Details here==============================

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; //Enter Username here
Players[0].Pass := ''; // Type Password Here
Players[0].Nick := ''; // Nickname = 3-4 lowercase letters of character name
Players[0].Active:= True; // Type True or dont bother running
Players[0].Pin := ''; // Leave Blank if none
end;


Const
{=========================Declare Settings Here=====================================}

{=========================General Settings=====================================}
Debug = True ;//True For details on where script is when its fucking up
RandomInvFoodSelect = True; // True if you want it to pick out a random item to use on range
//If True, Please state slots to start and end selection
StartInvSlot = 1 ;
EndInvSlot = 28 ;

//If False, Please state slot to Pick Item From
ItemSlot = 1 ;
//__________________________________________________ ___________________________

SimpleType = False ;(* True = 1st click without checking option - will be the faster option
False = Moves Mouse there and checks uptext- will be slightly slower*)



{=========================Banking Settings=====================================}
Tab = 1; //What Bank Tab is Your Stuff in? Keep all items in one.
RowNo = 0; //This is the row number where you food is, starting at 0 for first row
ColNo = 9;//This is the column number where you food is, starting at 0 for first column
FoodExp = 120;// Exp per food Cooked
FoodName = 'Lobster';//Just for Proggy purposes (Lobster, Tuna, Swordfish, etc.)



{=========Made color detection at first but was buggy so relies on uptext=======================}
{RawCol = 2112617; //Raw Food Color
RawTol = 15; // Raw Color Tolerance (leave it be if you don't even know what it is)
CookCol= 1594796 ; //Cooked food color
CookTol = 39; //Tolerance for cooked food color}



{================================Break settings========================================== ==}
Breaking = True; //Are we going to take Breaks ( True / False )
SwitchWorlds = True; //Are we going to Hop worlds after breaks? ( True / False )
BreakIn = 140; //How long before we take a break? (minutes)
BreakFor = 30; //How long will we break for? (minutes)
Bir = 15; //Random minutes to add/subtract from how long until we break
Bfr = 15; //Random minutes to add/subjtract from break duraction


{************************************************* *************************************************
Do Not Touch Below Or Risk Fucking It Up
************************************************** *************************************************}

Version = 0.3 ;

var
x , y, Loads, ExpGained, Cooked: integer;

//Break variables
wb,xb,yb,zb,RealBTime,CurrentBTime,
BreakRounds,TotalBreaks: Integer;

//Failsafe vars
RangeClicked,Reset:boolean;
Rangemiss:integer;








{************************************************* ******************************
Procedure HumanMMouse(eX, eY: Integer);
By: Flight
Description: Human-like miss-and-correct mouse movement
************************************************** *****************************}
Procedure HumanMMouse(eX, eY, ranX, ranY: Integer);
var
randSpeed: extended;
X,Y,X2,Y2,A,Dist,MP: integer;
begin
A := MouseSpeed;
GetMousePos(X, Y);
Dist := Distance(X, Y, eX, eY);
MP := Round(Dist/150);
if MP < 0 then
MP := 1;

randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
X2 := RandomRange(eX-(A*MP), eX+(A*MP));
Y2 := RandomRange(eY-(A*MP), eY+(A*MP));
WindMouse(X, Y, X2, Y2, 11, 8, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);
GetMousePos(X, Y);
MMouse(eX, eY, ranX, ranY);
MouseSpeed := A;
end;
{************************************************* ******************************
Procedure BrakeWindMouse(xs, ys, xe, ye, gravity, wind, minWait, maxWait, targetArea: extended);
By: Flight
************************************************** *****************************}
procedure BrakeWindMouse(xs, ys, xe, ye, gravity, wind, minWait, maxWait, targetArea: extended);
var
veloX,veloY,windX,windY,veloMag,dist,randomDist,la stDist: extended;
lastX,lastY,MSP,W,maxStep,D: integer;
sqrt2,sqrt3,sqrt5: extended;
begin
MSP := MouseSpeed;
sqrt2:= sqrt(2);
sqrt3:= sqrt(3);
sqrt5:= sqrt(5);

repeat
dist:= hypot(xs - xe, ys - ye);
wind:= minE(wind, dist);
D := Random((Round(dist)/3));
if (D > 100) then
D := RandomRange(90, 100);
if (D < 5) then
D := RandomRange(5, 8);

maxStep := D;

if dist >= targetArea then
begin
windX:= windX / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
windY:= windY / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
end else
begin
windX:= windX / sqrt2;
windY:= windY / sqrt2;
end;

veloX:= veloX + windX;
veloY:= veloY + windY;
If Dist>0 then //sorts out The divide by 0 error (and the world imploding every time it crashes)
begin
veloX:= veloX + gravity * (xe - xs) / dist;
veloY:= veloY + gravity * (ye - ys) / dist;
end;
if hypot(veloX, veloY) > maxStep then
begin
randomDist:= maxStep / 2.0 + random(round(maxStep) div 2);
veloMag:= sqrt(veloX * veloX + veloY * veloY);
veloX:= (veloX / veloMag) * randomDist;
veloY:= (veloY / veloMag) * randomDist;
end;

lastX:= Round(xs);
lastY:= Round(ys);
xs:= xs + veloX;
ys:= ys + veloY;

if (lastX <> Round(xs)) or (lastY <> Round(ys)) then
MoveMouse(Round(xs), Round(ys));

W := (Random(100/MSP))*3;
if (W < 5) then
W := 5;
wait(W);
lastdist:= dist;
until(hypot(xs - xe, ys - ye) < 1)

if (Round(xe) <> Round(xs)) or (Round(ye) <> Round(ys)) then
MoveMouse(Round(xe), Round(ye));

MouseSpeed := MSP;
end;

{************************************************* ******************************
Procedure BrakeMMouse(eX, eY, ranX, ranY: Integer);
By: Flight
************************************************** *****************************}

procedure BrakeMMouse(eX, eY, ranX, ranY: Integer);
var
randSpeed: extended;
X,Y: integer;
begin
randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
GetMousePos(X, Y);
BrakeWindMouse(X, Y, eX, eY, 9, 15, 10.0 / randSpeed, 15.0 / randSpeed, 10.0 * randSpeed);
end;
{************************************************* ******************************
Function BreakHandler(BreakIn, BreakFor, randBreakIn, randBreakFor: Integer): Boolean;
His Breaking system
By: Flight
************************************************** *****************************}
Function BreakHandler(BreakIn, BreakFor, randBreakIn, randBreakFor: Integer): Boolean;
Var
h,m,s,timeleft: integer;
begin
if not LoggedIn then Exit;

if (HowManyPlayers = 1) then
begin
timeleft:=(wb) + (yb) - GetTimeRunning ;
ConvertTIME(Timeleft,H,M,S);
Writeln('Time Until Break: '+IntToStr(h)+' Hours, '+Inttostr(m)+' Minutes and '+ IntToStr(s)+' Seconds');
if (GetTimeRunning < ((wb) + (yb) + BreakRounds)) then Exit
else
if (GetTimeRunning > ((wb) + (yb) + BreakRounds)) then
begin
RealBTime := ((xb+zb)/60000);
Writeln('Taking a break for about ' + IntToStr(RealBTime) + ' minutes.');
Logout;
MarkTime(CurrentBTime);
repeat
Wait(21000);
ConvertTime((xb+zb)-TimeFromMark(CurrentBTime), h, m, s);
ClearDebug;
Writeln('Breaktime left: '+IntToStr(h)+':'+IntToStr(m)+':'+IntToStr(s));
until(TimeFromMark(CurrentBTime)>(xb+zb));
Writeln('Logging in.');
if SwitchWorlds then
if LoginPlayerToLob then
ChangeWorld(RandomWorld(True, False))
else
LoginPlayer;
Wait(4000);
Result := LoggedIn;
ClickNorth(SRL_ANGLE_HIGH);
IncEx(BreakRounds, (wb) + (xb));
Inc(TotalBreaks);
Writeln('The next break will occur in about ' + IntToStr(BreakIn) + ' minutes.');
wb := (BreakIn * 60000);
xb := (BreakFor * 60000);
yb := RandomRange(-Bir * 60000, Bir * 60000);
zb := RandomRange(-Bfr * 60000, Bfr * 60000);
end;
end;
end;




procedure AntiBan();
begin
if(not(LoggedIn))then Exit;
FindNormalRandoms;
//If Debug then Writeln('AntiBan');
case (Random(1000)) of
0 : BrakeMMouse(RandomRange(MSX1,MSX2),RandomRange(MSY 1,MSY2),4,4);
1 : HoverSkill('random', False);
2 : ExamineInv;
3 : MouseSpeed := (RandomRange(9,15));
4 : begin HoverSkill('Cooking', False); Wait(RandomRange(2000, 4000)); end;
5 : begin PickUpMouse; SleepAndMoveMouse(1500 + Random(500)); end;
6 : begin GameTab(tab_Stats); Wait(1500 + Random(500)); GameTab(tab_Inv); end;
7 .. 50 : begin BoredHuman; SetAngle(SRL_ANGLE_HIGH); end;
51 : Wait(RandomRange(750, 2000));
end;
end;





Procedure SelectFood;
begin
If SimpleType then
begin
If RandomInvFoodSelect then
InvMouse(ItemSlot,1)
else
InvMouse(RandomRange(StartInvSlot,EndInvSlot),1);
end else
Begin
repeat
if (GetCurrentTab <> 25) then
Gametab(tab_inv);
if RandomInvFoodSelect then
InvMouse(RandomRange(StartInvSlot,EndInvSlot),3)
else
InvMouse(ItemSlot,3);
if WaitUpText('Use',500) or FindNormalRandoms then
begin
ClickMouse2(true);
If Debug then Writeln('Food Clicked');
Break;
end else
ClickMouse2(False);
until chooseoption('se') ;
end;
end ;


Procedure Bank;
var
count:integer;
begin
SetAngle(SRL_ANGLE_HIGH);
//MakeCompass('w');
count := 0 ;
repeat
repeat
FindNormalRandoms;
if FindObjTPA(x, y, 5931683, 12, -1, 10, 10, 60, ['ank', 'oth']) or FindNormalRandoms then //6063011 tol 5 for client
begin
BrakeMMouse(x,y,4,4);
if WaitUpText('ank Bank',400) or FindNormalRandoms then
begin
ClickMouse2(true);
If Debug then Writeln('Bank Single Clicked');
end else
begin
repeat
HumanMMouse(x,y,4,4);
WaitUptext('ank Bank',3000);
ClickMouse2(False);
until ChooseOption('ank') or FindNormalRandoms ;
If Debug then Writeln('Bank Menu Clicked');
end;
end else MakeCompass('w');
wait(3000);
if Pinscreen or FindNormalRandoms then
begin
InPin(Players[currentplayer].Pin);
If Debug then Writeln('PinEntered');
end;
until BankScreen ;
DepositAll;
If Debug then Writeln('Deposited all');
Banktab(tab);
WithDraw(ColNo,Rowno,28);
If Debug then Writeln('Food Withdrawn');
CloseBank;
wait(1000);
Inc(count);
If (Count > 1) then If Debug then Writeln('Withrawing is fucking up, trying again');
if (Count > 3) then
TerminateScript;
until (Invcount = 28);

end;




procedure Afkcook;
begin
if(not(LoggedIn))then Exit;
FindNormalRandoms;
Case (Random(10)) of
1 : begin wait(1500+random(3000)); writeln('Afking'); end;
end;
end;





Procedure WorldHop;
begin
repeat
if LoginPlayerToLob then
ChangeWorld(RandomWorld(True, False));
until not loggedin;
LoginPlayer;
repeat until loggedin;

end;




Procedure Cook;
var
Found: boolean;
Fail: integer;

begin
repeat
SetAngle(SRL_ANGLE_HIGH);
If FindObjTPAMulti(x, y, [1977558, 1581995, 1581993], 27, -1, 5, 5, 10, ['aw', 'nge']) or FindNormalRandoms then
//If FindColorSpiralTolerance(x,y,1845443,354,74,398,19 0,30) or FindNormalRandoms then
begin
Found := true;
RangeClicked := False;
If Debug then Writeln('Range Found');
BrakeMMouse(x, y, 3, 3);
If WaitUptext('Range',500) or FindNormalRandoms then
begin
ClickMouse2(true);
MouseBox(250, 410, 261, 425, 2);
if WaitUpTextMulti(['ook', 'll'], 2500) or FindNormalRandoms then
begin
ClickMouse2(true);
RangeClicked := True;
If Debug then Writeln('Range Click Option Chosed');
end;
end else
begin
ClickMouse2(false);
ChooseOption('ange');
wait(1000 + random(300));
MouseBox(250, 410, 263, 425, 2);
if WaitUpTextMulti(['ook', 'll'], 2500) or FindNormalRandoms then
begin
ClickMouse2(true);
RangeClicked := True;
If Debug then Writeln('Range Menu Option Chosen');
end ;
end;
end else
begin
AntiBan;
Inc(Fail);
If Fail > 3 then
begin
Break;
If Debug then Writeln('YOU HAVE FUCKED UP THE SCRIPT-AKA range not found');
Playsound('D:\Simba\alarm.mp3'); //not working atm
TerminateScript;
end;
end;
until(Found);
wait(400+random(300));
end;



Procedure Cooking;
var
ts,Count:integer;
begin
count:=0;
MarkTime(ts);
GameTab(tab_Inv);
repeat
LevelUp;
if (count<10) then
AntiBan
else
FindNormalRandoms;
wait(2000 + random(600));
inc(count);
If Debug then Writeln('Count : '+IntToStr(Count));
if (GetCurrentTab <> 25) then
Gametab(tab_inv);
if (TimeFromMark(ts) > RandomRange(90000,110000)) then
Break;
if (Count>15) then
InvMouse(27,3);
FindNormalRandoms;
until WaitUpText('Eat',300) and ( TimeFromMark(ts) > 65000 ) ;
If Debug then Writeln('Load Done');
FindNormalRandoms;
//Afkcook;
inc(Loads);
Writeln('Loads: ' + ToStr(Loads) + ' Cooked' );
end;



Procedure Report;
begin
Cooked := Loads * 28;
ExpGained := (Cooked * FoodExp);
Writeln('#################Cooking Guilder-v0.5#################');
WriteLn('Time Running: '+TimeRunning);
Writeln('Exp Gained: ' + IntToStr(ExpGained));
Writeln('Exp/Hour: ' + IntToStr(Round((EXpGained/(GetTimeRunning/3600000.0)))));
Writeln(FoodName + ' Cooked: ' + IntToStr(Cooked));
Writeln(FoodName + 'Cooked/Hour: ' + IntToStr(Round(( Cooked/(GetTimeRunning/3600000.0)))));
Writeln('Please Post Proggies');
end;




Procedure Setup;
begin
{$IFDef Smart}
SRL_SixHourFix:= True;
{$ENDIF}
MouseSpeed := 12
wb := (BreakIn * 60000);
xb := (BreakFor * 60000);
yb := RandomRange(-Bir * 60000, Bir * 60000);
zb := RandomRange(-Bfr * 60000, Bfr * 60000);
ClearDebug;
SetupSRL;
DeclarePlayers;
//ChangeWorld(RandomWorld(True, False));
LoginPlayer;

end;


Label
STARTPOINT;
begin

Setup;
StartPoint:
Reset := false
ExitSquealOfFortune;
repeat
if not loggedin then
loginplayer;
until loggedin;
Writeln('Logged In');
repeat
Bank;
togglexpbar(True);
repeat
RangeMiss := 0;
repeat
SelectFood;
Cook;
if ( RangeMiss > 0 ) then Writeln('We Have Failed '+ IntToStr(RangeMiss) + ' Times');
if ( RangeMiss > 10 ) then
begin
Repeat
WorldHop;
Until Loggedin;
Reset:= True;
end;
inc(RangeMiss)
If Reset then Break;
FindNormalRandoms;
if not RangeClicked then
Case Random(4) of
1: MakeCompass('w');
2: MakeCompass('e');
3: MakeCompass('s');
3: MakeCompass('n');
end;
Until RangeClicked;
If Reset then Break;
InvMouse(1,3);
FindNormalRandoms;
until WaitUpText('Eat',1000);
If Reset then Break;
If Debug then Writeln('Found Started Cooking');
Cooking;
Report;
if breaking then BreakHandler(BreakIn,BreakFor,Bir,Bfr);
until not loggedin;
If Reset then Goto StartPoint;
end.