Code:
program HoodzCooker;
{$i AeroLib/AeroLib.Simba}
var
x, y, cooked, currentFood: Integer;
DTM_Lobster, DTM_Trout, DTM_Salmon, DTM_Tuna, DTM_Karambwam, DTM_Shrimp, DTM_Shark,DTM_Swordfish,DTM_MonkFish,DTM_Angler: Integer;
Raw_Array, xpTable: TIntegerArray;
breakAfterTime, breakLength: Integer;
const
P_USERNAME = '';
P_PASSWORD = '';
P_PIN = '';
USEBREAKS = true;
breakAfterHours_MIN = 2;
breakAfterHours_MAX = 3;
breakForMinutes_MIN = 30;
breakForMinutes_MAX = 90;
VERSION = '1';
procedure declarePlayer();
begin
Me.Name := P_USERNAME;
Me.Pass := P_PASSWORD;
Me.Pin := P_PIN;
Me.Nick := '';
Me.Active := True;
Me.Member := True;
end;
procedure updater();
var
NewFile: integer;
OnlineVersion, NewScript, NewFileName: string;
begin
writeln('Checking for script updates...');
OnlineVersion := GetPage('http://pastebin.com/raw.php?i=Fnc4CpZp');
if (trim(OnlineVersion) > VERSION) then
begin
writeLn('Script update available!');
writeLn('Updating script to v' + OnlineVersion);
NewScript := GetPage('http://pastebin.com/raw.php?i=LJWtzExX');
NewFileName := 'C:\Simba\Scripts\' + 'HoodzCooker Aero V' + Trim(OnlineVersion) + '.simba';
NewFile := Rewritefile(NewFileName, true);
try
WriteFileString(NewFile, NewScript);
except
begin
writeLn('Fatal error writing to ' + NewFileName + '!!');
terminatescript;
end;
end;
CloseFile(NewFile);
writeLn('New script downloaded to ' + NewFileName + '. Please restart Simba.');
TerminateScript;
end
else
writeLn('You have the latest version of the script!');
end;
{procedure stats_check;
begin
if (STATS_ID = '') then
begin
writeln('You MUST have a stats account registered to use this script');
writeln('You can register for free here: http://stats.grats.pw/reg.php');
writeln('More information about stats here: https://villavu.com/forum/showthread.php?t=112103&p=1332139');
TerminateScript;
end;
end; }
procedure randomBreakTime();
begin
breakAfterTime := GetTimeRunning + (RandomRange(breakAfterHours_MIN, breakAfterHours_MAX) * 3600000) + RandomRange(2000, 3500000);
Writeln('breakAfterTime = ' + MsToTime(breakAfterTime, 3));
breakLength := (RandomRange(breakForMinutes_MIN, breakForMinutes_MAX) * 60000) + RandomRange(2000, 59000);
Writeln('breakLength = ' + MsToTime(breakLength, 3));
end;
procedure BreakHandlerCustom();
begin
writeln('starting breakhandler');
while (isLoggedIn) do
logoutPlayer;
while not (getTimeRunning >= (breakAfterTime + breakLength)) do
begin
Writeln('Break handler active');
Writeln('TimeRunning: ' + MsToTime(getTimeRunning, 3));
Writeln('Breaking till: ' + MsToTime((breakAfterTime + breakLength), 3));
Writeln('Time left until break is done: ' + MsToTime(((breakAfterTime + breakLength) - getTimeRunning), 3));
Sleep(5000);
ClearDebug;
end;
randomBreakTime;
end;
procedure free;
begin
freeDTM(DTM_Lobster);
freeDTM(DTM_Trout);
freeDTM(DTM_Salmon);
freeDTM(DTM_Tuna);
freeDTM(DTM_Karambwam);
freeDTM(DTM_Shrimp);
freeDTM(DTM_Shark);
freeDTM(DTM_Swordfish);
freeDTM(DTM_MonkFish);
freeDTM(DTM_Angler);
end;
procedure setupPlayer();
begin
writeln('player setup...');
if (not isLoggedIn()) then
loginPlayer(false);
if (isLoggedIn()) then
begin
toggleRunning(true);
setAngle(ANGLE_HIGH);
end;
end;
procedure setup();
begin
mouseSpeed := Random(18, 25);
writeln('mouseSpeed set at: ' + intToStr(mouseSpeed));
DTM_Lobster := DTMFromString('mggAAAHicY2NgYHBmYmDwBGJ7IDYHYhMg9gbiJ0C5j0D8GohfAfFTIH4OxBUuckCSEQOzM2AHmCohGAIA83QH9g==');
DTM_Shark := DTMFromString('mggAAAHicY2NgYGgH4logngZlVwPxFCBOBOIiIC4A4nQgToPi6b09QJIRA7MzYAeYKiEYAgDc0Qdv');
DTM_Trout := DTMFromString('mbQAAAHicY2VgYHBiYmCwB2I3IDYFYksgfgEUf8cAoV8B8QcgPrJ7F5BkRMHsDJiAEQsGAwBuJwgm');
DTM_Shrimp := DTMFromString('mggAAAHicY2NgYOBnhmAmIOYEYnEglgJiNUYGBiNGCG0IxFpArALEezuzgboYMTA7A3aAqRKCIQAAFswDOQ==');
DTM_Salmon := DTMFromString('mggAAAHicY2NgYNBiYWBQA2JZINYHYk0glgNiVUYgH4i1gVgDyjYE4q5wf6AuRgzMzoAdYKqEYAgAADSUA1E=');
DTM_Tuna := DTMFromString('mwQAAAHic42RgYLjLxMDwGIgvA/EtIL4HxM+A+CYQv4XyIxgZGOKAOBaIE6E4CohDGCFy0UC8b8sWoGmMuLEsAwM7A37Ajt8EOIYDACVbDZE=');
DTM_Karambwam := DTMFromString('mrAAAAHic42BgYNjIxMCwAYi3A/FyIF4PxLuAeB8QLwbit0A1P4D4CxB/BeLfUP4nIH4HxC4xJkCSESdmZ8APcOuEYBgAAGHHDi0=');;
DTM_Swordfish := DTMFromString('mAAEAAHiclcuxCoJgAMTxc+8RCyyHgsQHaA7CycElycAhHOTLqGj4JiGhRnHQ5+kfNrR68JvubiKpcAYlrj8JUhyR4YQLcsz4uJjDwxIB1lhhgamG3be326deh0aN6dVWnfLQ6BzddYutbFrJbB7a+5l2bqS6eGtsnJH+8wHxVSSF');
DTM_MonkFish := DTMFromString('mVAEAAHicE2BgYFjKyMCwAohXA/FmIN4OxeuhYsuBeBEQzwXi2UA8D8peAMRLgDgNaEY2EGcyQNgZUH4KFMcBcTwUJwFxMpIaEG6P8WFId7JiSHGwZMj2tGFw1lJjiLY0YQi3MQDzE53MGSojXBkKfe0ZynycGSYmBzFsra1i2FhVznDu+DEGSgEjhRgdAACuCyLM');
DTM_Angler := DTMFromString('mVAEAAHicE2BgYFjJyMCwHIgXA/FcIJ4NxHOg7HVAvAmItwHxdigN4q8H4iVAvBCIE4Fm5AFxIRRnA3EGEKcCcRQQxwJxPBAnA3EaEKdA5WKg/J2H9jIomWgw9HcWMtRWJDM01aQxWM5NZ9i9dRpDSIAaQ2C4AUN0uBaDWr4ng4+HEoNVmBODgYc5g09BOMOZYxsZKAWMFGJ0AAAjliQ4');
Raw_Array := [DTM_Shrimp, DTM_Trout, DTM_Salmon, DTM_Tuna, DTM_Lobster, DTM_Shark, DTM_Karambwam,DTM_Swordfish,DTM_MonkFish,DTM_Angler];
xpTable := [30, 70, 90, 100, 120, 210, 190,140,150,230];
addOnTerminate('free');
randomBreakTime();
setupPlayer();
end;
procedure customMouse(point: TPoint);
begin
case random(0, 6) of
0..2: BrakeMMouse(point, random(5), random(5), true);
3: BrakeMMouse(point, random(5), random(5), false);
4..5: MissMouse(point, random(5), random(5));
6: HumanMMouse(point, random(5), random(5));
end;
end;
function waitForPixelShift(amount, timeOut: Integer; box: TBox): Boolean;
var
x1, y1, BMP, BMP2, tempShift: Integer;
t: Timer;
begin
result := false;
t.start();
BMP := bitmapFromClient(box.x1, box.y1, box.x2, box.y2);
repeat
if (t.timeElapsed() >= timeOut) then
break;
sleep(250);
BMP2 := bitmapFromClient(box.x1, box.y1, box.x2, box.y2);
tempShift := calculatePixelShift(BMP, BMP2, IntToBox(0, 0, (box.x2 - box.x1), (box.y2 - box.y1)));
if (calculatePixelShift(BMP, BMP2, IntToBox(0, 0, (box.x2 - box.x1), (box.y2 - box.y1))) >= amount) then
result := true;
freeBitmap(BMP2);
until (Result);
freeBitmap(BMP);
end;
function getLocations(DTM: Integer): TIntegerArray;
var
I: Integer;
tempArray: TIntegerArray;
begin
setLength(tempArray, 0);
for I := 1 to 28 do
begin
if (FindDTM(DTM, x, y, invBox(I).x1, invBox(I).y1, invBox(I).x2, invBox(I).y2)) then
begin
SetLength(tempArray, Length(tempArray) + 1);
tempArray[High(tempArray)] := I;
end;
end;
result := tempArray;
end;
function textVisible(): Boolean;
var
t: Timer;
numb: Integer;
begin
result := false;
numb := random(2000, 3000);
t.start();
repeat
if (t.timeElapsed() > numb) then
break;
sleep(random(320, 600));
if (countColor(0, 211, 392, 307, 411) = 277) then
result := true;
until (result);
end;
function selectMenu(): Boolean;
begin
result := (countColor(128, 129, 359, 379, 382) > 50);
end;
procedure cookHandler();
var
Timer, world, I, rand: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
spot, selectPoint: TPoint;
aBool: Boolean;
tCol : TColEx;
begin
aBool := false;
if (not anySlotActivated()) then
begin
for I := 0 to high(Raw_Array) do
begin
if (FindDTM(Raw_Array[I], x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
customMouse(point(x, y));
sleep(20 + random(30));
case random(12) of
0..10: fastClick(MOUSE_LEFT);
11:
begin
fastClick(MOUSE_RIGHT);
waitOption('Use', 300);
end;
end;
sleep(20 + random(120));
break;
end
else
if (I = length(Raw_Array)) then
exit;
end;
end;
tCol.create(2660821, 15, 0.15, 1.42);
if (not tCol.findAllIn(AREA_MS, TPA)) then
begin
if (isBankOpen()) then
begin
closeInterface();
exit;
end;
world := randomWorld(true);
changeWorld(world, false);
exit;
end;
ATPA := FloodFillTPA(TPA);
sortATPASize(ATPA, true);
if (length(ATPA[0]) < 20) then
begin
if (isBankOpen()) then
begin
closeInterface();
exit;
end;
world := randomWorld(true);
changeWorld(world, false);
exit;
end;
sleep(200 + random(200));
if (not anySlotActivated()) then
exit;
spot := middleTPA(ATPA[0]);
customMouse(spot);
sleep(20 + random(150));
if (waitUpText('ire', 300)) then
begin
aBool := true;
case random(10) of
0..8: fastClick(MOUSE_LEFT);
9:
begin
fastClick(MOUSE_RIGHT);
waitOption('-> Fire', 300);
end;
end;
end
else
begin
fastClick(MOUSE_RIGHT);
if (waitOption('-> Fire', 300)) then
aBool := true;
end;
if (aBool) then
begin
//sleep(1000);
timer := (getTimeRunning() + 6000 + random(1200));
while (isLoggedIn) and (not selectMenu()) and (getTimeRunning() < timer) do
sleep(200 + random(150));
// if (selectMenu()) then
begin
if (I = high(RAW_ARRAY)) then
selectPoint := Point(245, 410)
else
selectPoint := Point(260, 424);
customMouse(point(selectPoint.X + random( - 22, 22), selectPoint.Y + random( - 17, 30)));
begin
fastClick(MOUSE_LEFT);
{ if (I = high(RAW_ARRAY)) then
rand := 0
else
rand := random(16);
case rand of
0:
begin
waitOption('Cook X', 300);
if (textVisible()) then
typeSend(toStr(random(28, 99)), true);
end;
1..15: waitOption('Cook All', 300); }
end;
end;
end;
end;
procedure antiban();
var
rand: Integer;
what: String
begin
if (random(0, 30) = 0) then
begin
rand := random(0, 71);
case rand of
0..45:
begin
if (pointInBox(getMousePnt(), intToBox(1, 1, 765, 500))) then
MMouseOffClient('random');
what := 'mouse off client';
end;
46..51:
begin
compassMovement(30, 170, false);
what := 'compass movement';
end;
52..57:
begin
hoverSkill(SKILL_COOKING, false);
what := 'hovering skill';
end;
58..70:
begin
pickUpMouse;
what := 'pick up mouse';
end;
end;
writeln('last antiban on: ' + mstoTime(getTimeRunning, 3) + ' ' + what);
end;
end;
procedure bankHandler();
var
slot, I: Integer;
slots: TIntegerArray;
begin
if (Interfaces[PINSCREEN].isVisible()) then
inPin(P_PIN);
case random(30) of
0..28: quickDeposit('inv');
29:
begin
middleBox(invBox(1));
customMouse(Point(x, y));
sleep(20 + random(20));
fastClick(MOUSE_RIGHT);
waitOption('Deposit-All', 300);
end;
end;
for I := 0 to high(Raw_Array) do
begin
if (FindDTM(Raw_Array[I], x, y, MSX1, MSY1, MSX2, MSY2)) then
begin
customMouse(Point(x, y));
sleep(20 + random(30));
fastClick(MOUSE_RIGHT);
if (random(0, 1) = 0) then
waitOption('Withdraw-All ', 300)
else
waitOption('Withdraw-All-but-1', 300);
sleep(100 + random(100));
closeInterface();
sleep(500 + random(300));
cookhandler();
break;
end else
begin
if (isBankOpen() and (I = length(Raw_Array))) then
begin
closeInterface();
logoutPlayer();
writeln('out of raws');
terminateScript();
end;
end;
end;
end;
procedure openBank();
var
TPA: TPointArray;
ATPA: T2DPointArray;
I, world: Integer;
spot: TPoint;
t: Timer;
tCol : TColEx;
begin
if (isBankOpen()) then
exit;
if (Interfaces[PINSCREEN].isVisible()) then
inPin(P_PIN);
tCol.create(1521211, 10, 0.08, 0.91);
if (not tCol.findAllIn(AREA_MS, TPA)) then
begin
if (isBankOpen()) then
begin
closeInterface();
exit;
end;
world := randomWorld(true);
changeWorld(world, false);
exit;
end;
ATPA := FloodFillTPA(TPA);
SortATPASize(ATPA, true);
spot := middleTPA(ATPA[0]);
customMouse(spot);
sleep(20 + random(30));
if (waitUptext('ald', 250)) then
begin
fastClick(MOUSE_RIGHT);
waitOption('Bank', 300);
I := getTimeRunning() + 3000 + random(1000);
while (not isBankOpen()) and (getTimeRunning < I) do
sleep(250 + random(200));
end;
end;
function findAnyRaw(): Boolean;
var
I: Integer;
begin
result := false;
for I := 0 to high(Raw_Array) do
begin
if (FindDTM(Raw_Array[I], x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
currentFood := I;
exit(true);
end;
end;
end;
procedure incVars();
var
xp: Integer;
begin
xp := xpTable[currentFood];
stats_incVariable('78', xp);
end;
function getState(): Integer;
begin
if (getTimeRunning >= breakAfterTime) and (USEBREAKS) then
exit(7);
if (not isLoggedIn()) then
exit(0);
if ((getCurrentTab <> TAB_INV) and (not isBankOpen())) then
exit(1);
if (not findAnyRaw()) and (not isBankOpen()) then
exit(5);
if (not findAnyRaw()) and (isBankOpen()) then
exit(6);
if (findAnyRaw()) and (isBankOpen()) then
exit(2);
if (findAnyRaw()) and (not isBankOpen()) and (not waitForPixelShift(10, 3400, intToBox(MIX1, MIY1, MIX2, MIY2))) then
exit(3);
incVars();
exit(4);
end;
procedure executeState(State: Integer);
begin
case (State) of
0: setupPlayer();
1: gameTab(TAB_INV);
2: closeInterface();
3: cookHandler();
4: antiban();
5: openBank();
6: bankHandler();
7: breakHandlerCustom();
end;
stats_Commit();
sleep(Random(100, 200));
end;
begin
declarePlayer();
initAL();
updater();
setup();
stats_setup('40');
//stats_check;
stats_initVariable('78', 0);
repeat
executeState(getState());
until (false);
end.