Simba Code:
program Fishing;
{$DEFINE SMART}
{$DEFINE WALKER}
{$I Aerolib/Aerolib.simba}
type
TScriptState = (Dropping, Fishing, Clicking, Walking);
var
pBox: TBox;
RSW: TRSWalker;
const
playerCol := 6767366;
playerTol := 14;
playerHue := 0.04;
playerSat := 0.84;
procedure antiban();
var
rand: Integer;
what: String
begin
if Random(30) = 1 then
begin
case random(7) of
0: pickUpMouse();
1: randomRClick();
2: hoverSkill('random', false);
3: SleepAndMoveMouse(RandomRange(3000, 9000));
4: examineInv();
5: randomFKeys(True);
6: MMouseOffClient('rand');
end;
end;
end;
procedure findpBox();
var
x, y: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
SetColorToleranceSpeed(2);
SetColorspeed2Modifiers(playerHue, playerSat);
if FindColorsSpiralTolerance(x, y, TPA, playerCol, MSX1, MSY1, MSX2, MSY2, playerTol) then
begin
ATPA := SplitTPA(TPA, 2);
SortATPAFromFirstPoint(ATPA, MSCP);
pBox := GetTPABounds(ATPA[0]);
end;
end;
function IsFishing: boolean;
begin
findpBox();
//OS_SMART.__Graphics.DrawClippedBox(pBox, pBox, False, clRed);
if (getInvCount() = 28) then
begin
Exit;
end;
begin
if averagePixelShift(pBox, 50, 500) > 16 then
begin
result := True;
end else
begin
result := False;
end;
end;
end;
procedure debugState(state: String);
begin
OS_SMART.ClearScreen();
OS_SMART.__Graphics.DrawClippedText('State: ' + state, 'SmallChars07', Point(5, 275), clWhite);
end;
procedure clickObject(col, tol: integer; hue, sat: extended; uptext: array of string);
var
x, y, height, width: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
SetColorToleranceSpeed(2);
SetColorspeed2Modifiers(hue, sat);
if FindColorsSpiralTolerance(x, y, TPA, col, MSX1, MSY1, MSX2, MSY2, tol) then
begin
ATPA := SplitTPA(TPA, 10);
SortATPAFromFirstPoint(ATPA, MSCP);
height := Round((GetTPABounds(ATPA[0]).Height)/2);
width := Round((GetTPABounds(ATPA[0]).Width)/2);
x := GetTPABounds(ATPA[0]).MidPoint.X + Round(GaussRange(-height, height));
y := GetTPABounds(ATPA[0]).MidPoint.Y + Round(GaussRange(-width, width));
//OS_SMART.__Graphics.DrawClippedBox(GetTPABounds(ATPA[0]), GetTPABounds(ATPA[0]), False, clRed);
humanMMouse(Point(x, y), 0, 0);
Sleep(30+GaussRandom(110));
if isUptextMulti(uptext) then
begin
case random(5) of
0..3: fastClick(mouse_Left);
4:
begin
fastClick(mouse_Right);
Sleep(30+GaussRandom(110));
chooseOptionMulti(uptext);
end;
end;
while isPlayerWalking() do
Sleep(500+GaussRandom(1000));
end;
end;
end;
function findObject(col, tol: integer; hue, sat: extended): Boolean;
var
x, y, height, width: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
SetColorToleranceSpeed(2);
SetColorspeed2Modifiers(hue, sat);
if FindColorTolerance(x, y, col, MSX1, MSY1, MSX2, MSY2, tol) then
Result := True;
end;
procedure dropInv();
var
x, y, i, height, width: integer;
invSlots: TIntegerArray;
begin
for i := 3 to 28 do
begin
height := Round(invBox(i).Height()/2);
width := Round(invBox(i).Width()/2);
x := invBox(i).CX + Round(GaussRange(-height, height));
y := invBox(i).CY + Round(GaussRange(-width, width));
//OS_SMART.__Graphics.DrawClippedBox(invBox(i), invBox(i), False, clRed);
if Random(32) = 1 then
Sleep(GaussRandom(11200));
humanMMouse(Point(x, y), 0, 0);
Sleep(30+GaussRandom(110));
fastClick(mouse_Right);
Sleep(30+GaussRandom(110));
if optionExistsMulti(['>', '-']) then
begin
chooseOptionMulti(['se']);
end else
begin
case Random(30) of
0..25: chooseOptionMulti(['rop']);
26..28: chooseOptionMulti(['xamine']);
29: chooseOptionMulti(['se']);
end;
end;
Sleep(30+GaussRandom(110));
end;
end;
procedure changeSpot();
var
x1, y1: integer;
p: TPoint;
begin
p := RSW.GetMyPos();
x1 := p.X;
y1 := p.Y;
if Distance(x1, y1, 246, 181) < Distance(x1, y1, 227, 215) then
begin
RSW.blindWalk(Point(227+RandomRange(-4, 4), 215+RandomRange(-4, 4)));
end else
begin
RSW.blindWalk(Point(246+RandomRange(-4, 4), 181+RandomRange(-4, 4)));
end;
while isPlayerWalking() do
Sleep(500+GaussRandom(1000));
end;
Function getState(): TScriptState;
begin
If getInvCount() = 28 then
Exit(Dropping);
If IsFishing() then
begin
Exit(Fishing);
end else
begin
if findObject(14862500, 15, 0.18, 1.03) then
begin
Exit(Clicking);
end else
begin
Exit(Walking);
end;
end;
end;
begin
initAL();
MouseSpeed := 35;
RSW.Init('Fishing');
repeat
case getState() of
Dropping:
begin
debugState('Dropping');
dropInv();
end;
Fishing:
begin
debugState('Fishing');
while IsFishing() do
begin
Sleep(400+GaussRandom(2000));
antiban();
end;
end;
Clicking:
begin
debugState('Clicking');
clickObject(14862500, 15, 0.18, 1.03, ['ishing', 'pot']);
end;
Walking:
begin
debugState('Walking');
changeSpot();
end;
end;
until False;
end.