Simba Code:
program Powerfisher;
{$DEFINE SMART}
{$i srl-6/srl.simba}
{$i srl-6/lib/misc/srlplayerform.simba}
type
ColorInformation = record
CTS: TColorSettings;
Color, Tolerance: Integer;
Area: TBox;
end;
var
x, y, z, InitialXP, InitialLevel, FishCaught, InitialFeathers: Integer;
FishingSpots: ColorInformation;
CurrentLocation: Integer;
CurrentSpot: TBox;
FishingSymbolTPA: TPointArray;
FISHSPOT_ONE, FISHSPOT_TWO: Integer;
TP: TPoint;
const
ScriptName = 'Edgeville Powerfisher';
BUILD_TESTING = 0;
BUILD_PRODUCTION = 1;
BUILD = BUILD_PRODUCTION;
EVENT_TALK_LEVEL_UP = 0;
EVENT_TALK_BORED = 1;
DEBUG_FATAL = 1;
DEBUG_SUCCESS = 0;
DEBUG_INFO = 2;
SPOT_ONE = 0;
SPOT_TWO = 1;
procedure DeclarePlayers;
var
i: Integer;
begin
Players.setup(playerForm.playerNames, playerForm.playerFile);
CurrentPlayer := 0;
for i := 0 to High(Players) do
with Players[i] do
begin
integers[0] := strToInt(playerForm.players[i].settings[0]);
booleans[0] := strToBool(playerForm.players[i].settings[2]);
booleans[1] := strToBool(playerForm.players[i].settings[3]);
booleans[2] := strToBool(playerForm.players[i].settings[4]);
isMember := strToBool(playerForm.players[i].settings[1]);
isActive := TRUE;
world := RandomRange( - 1, 0);
end;
end;
procedure initialize;
begin
with FishingSpots do
begin
CTS.cts := 2;
CTS.modifier.hue := 0.27;
CTS.modifier.saturation := 1.98;
CTS.modifier.sensitivity := 15;
Color := 15587756;
Tolerance := 19;
Area := Mainscreen.GetBounds;
end;
FISHSPOT_ONE := DTMFromString('m6wAAAHic42ZgYFjPxMCwG4iXAfFmIF4OxPOBe' +
'AkQnwXivVDxBUCcB1SfD8QVQBwFxHFAHA7EWUC' +
'cCMVNUDWcfi8ZwpOKwNjGQoJBQ1WEYUk/C0NwX' +
'C6DpZEsRFxPiCEsoYBBGaieWMxEAkYCAKEjF/E=');
FISHSPOT_TWO := DTMFromString('mwQAAAHic42RgYNjAxMCwGogPAfEiIF4KxMuBe' +
'B0QbwPifUCcC1QXBsRZQJwExMVAXAfE9UBcDcS' +
'VQKw35R9D64ybDN8en2ewNlVl8DAVZWhoqmYw1' +
'xJgCE8qAmNloDpCmIkIDAcAZgYXUg==');
end;
procedure initPlayerForm;
begin
with playerForm do
begin
name := 'Edgeville Powerfisher';
scriptHelpThread := 'http://villavu.com/forum/showthread.php?t=107595';
scriptSettingsPath := '';
editBoxLabels := ['Feather slot'];
editBoxDefaults := ['28'];
checkBoxLabels := ['Member', 'Take IP Screenshots', 'Draw on SMART',
'Disable SRL Log'];
checkBoxDefaults := ['True', 'False', 'True', 'True'];
end;
end;
procedure PrintDebug(debugType: integer; message: string);
begin
case debugType of
0: print('[SUCCESS] ' + message, TDebug.Sub);
1: print('[FATAL] ' + message, TDebug.Error);
2: print('[INFO] ' + message, TDebug.Sub);
end;
end;
procedure ScriptTerminate();
begin
PrintDebug(DEBUG_INFO, 'Shuttting down script ...');
TakeScreenshot(ScriptName + ' [' + ToStr(GetTimeRunning) + '].png');
if (BUILD = BUILD_PRODUCTION) then
begin
if isLoggedIn() then
players[currentPlayer].logout();
end;
FreeDTM(FISHSPOT_ONE);
FreeDTM(FISHSPOT_TWO);
end;
function MouseRandom(TPoint: TPoint; MouseAction: Integer): Boolean;
var
MouseStyle: array [0..2] of Integer;
begin
MouseStyle := [MOUSE_BREAK, MOUSE_ACCURATE, MOUSE_HUMAN];
MouseSpeed := RandomRange(15, 20);
if (MouseAction = MOUSE_MOVE) then
MissMouse(TPoint, TRUE);
if (MouseAction <> MOUSE_MOVE) then
Mouse(TPoint, MouseAction, MouseStyle[RandomRange(0, 2)]);
end;
function AMouseCircle(Mainscreen: TBox): Boolean;
begin
case Random(4) of
1: MouseBox(Mainscreen);
2: MouseOval(RandomRange(RandomRange(100, 200), RandomRange(100, 150)),
RandomRange(RandomRange(100, 200), RandomRange(100, 150)),
RandomRange(10, 50), RandomRange(50, 60));
3: MouseCircle(RandomRange(50, 100), RandomRange(50, 100),
RandomRange(25, 50));
end;
end;
function RespondToChat: Boolean;
var
SpeakerName: string;
begin
PrintDebug(DEBUG_INFO, 'Checking for new chat ...');
if (ConversationBox.AreTalking()) then
begin
if (ConversationBox.FindChat(['hello', 'Hello', 'Hi', 'hello everyone',
'Hello everyone', 'Hi everbody', 'hey',
'Hello everyone ! :D', 'Hey'])) then
begin
PrintDebug(DEBUG_INFO, 'New chat found ...');
PrintDebug(DEBUG_INFO, 'Responding ...');
SpeakerName := ConversationBox.GetSpeaker;
case Random(10) of
1: TypeSend('Hi!!!', true);
2: TypeSend('Hey there ' + SpeakerName, true);
3: TypeSend('Hi guys!! :D', true);
4: TypeSend('What' 's up people!!', true);
5: TypeSend('Glad I' 'm not covered by bots lol :p', true);
6: TypeSend('Please leave a message after the beep... BEEP', true);
7: TypeSend('Won' 't be available for talking lol...' +
'I' 'll be busy. sry brah <3', true);
8: TypeSend('I' 'm sexy and I know it :p', true);
9:;
10:;
end;
end;
end
else
PrintDebug(DEBUG_INFO, 'No new chat found ...');
end;
function SayStuff(EVENT: Integer): Boolean;
begin
if (EVENT = EVENT_TALK_LEVEL_UP) then
begin
case Random(50) of
10: TypeSend('Wohooo level up!!', true);
20:;
30: TypeSend('YAY more time spent being lifeless paid off', true);
40:;
50:;
end
end
else if (EVENT = EVENT_TALK_BORED) then
begin
case Random(50) of
1: TypeSend('Fishing the boringest skill ever', true);
2: TypeSend('BOOOOOOOOORED', true);
3:;
4: TypeSend('Man they have to find a way to make this interesting', true);
5: TypeSend('Gosh skilling gets boring as hell', true);
10:;
20:;
30:;
end;
end;
end;
function DropItems: Boolean;
begin
FishCaught := FishCaught + 27;
case Random(5) of
1: tabBackpack.dropItemsExcept([Players[CurrentPlayer].integers[0]],
DROP_PATTERN_REGULAR);
2: tabBackpack.dropItemsExcept([Players[CurrentPlayer].integers[0]],
DROP_PATTERN_BACKWARDS);
3: tabBackpack.dropItemsExcept([Players[CurrentPlayer].integers[0]],
DROP_PATTERN_SNAKE);
4: tabBackpack.dropItemsExcept([Players[CurrentPlayer].integers[0]],
DROP_PATTERN_UP_DOWN);
end;
end;
function IsPlayerFishing: Boolean;
var
InitialCount: Integer;
begin
InitialCount := TabBackPack.Count();
Wait(randomRange(2000, 5000));
if (TabBackPack.Count <> InitialCount) then
begin
Result := TRUE;
end
else
Result := FALSE;
end;
function FeatherCount: Integer;
begin
if (ChooseOption.IsOpen()) then
ChooseOption.Close();
Result := GetItemAmount(TabBackPack.GetSlotBox(Players[CurrentPlayer].
integers[0]));
end;
function TRSChatBox.getXP: Integer;
var
b: TBox;
s: string;
tpa: TPointArray;
atpa: T2DPointArray;
i, p: Integer;
begin
b := self.getBounds();
b.edit( + (b.x2 - b.x1) - 140, + 10, - 5, - 94);
findColorsTolerance(tpa, 14013909, b, 4, colorSetting(2, 0.00, 0.00));
if length(tpa) < 2 then
begin
PrintDebug(DEBUG_FATAL, 'No XP found');
exit;
end;
atpa := tpa.cluster(5);
b := atpa.getbounds;
b.edit( - 2, - 2, + 2, + 2);
s := tesseractgettext(b.x1, b.y1, b.x2, b.y2, FILTER_SMALL_CHARS);
P := Pos('x', S);
if P > 0 then
Result := StrToIntDef(ExtractFromStr(Copy(s, P, Length(S)), Numbers), 0)
else
Result := StrToIntDef(ExtractFromStr(S, Numbers), 0);
end;
function TPointArray.CenterPoint: TPoint;
var
TemporaryArray: TPointArray;
begin
if (Length(Self) < 1) then
Exit;
TemporaryArray := Self;
TemporaryArray.SortFromPoint(Self.GetMiddle);
Result := TemporaryArray[0];
end;
function FindFishingSpot(MinWait: Integer; SearchArea: TBox;
out Fish2DPointArray: T2DPointArray;
ExitOnFind: Boolean): Boolean;
var
FishingSpots2D: T2DPointArray;
FishingPoints: TPointArray;
FindTime, i, h: Integer;
begin
Fish2DPointArray := [];
FindTime := GetSystemTime + RandomRange(MinWait, Round(MinWait * 1.3));
while (GetSystemTime < FindTime) do
begin
if FindColorsTolerance(FishingPoints, FishingSpots.Color, SearchArea,
FishingSpots.Tolerance, FishingSpots.CTS) then
begin
if ExitOnFind then
exit(TRUE)
else
Insert(FishingPoints, FishingSpots2D);
end;
Wait(RandomRange(100, 200));
end;
if (Length(FishingSpots2D) > 0) then
begin
FishingPoints := FishingSpots2D.Merge();
FishingPoints.ClearEquals();
FishingSpots2D := FishingPoints.ToATPA(25, 25);
if (Length(FishingSpots2D) > 0) then
begin
Fish2DPointArray := FishingSpots2D;
Result := TRUE;
end;
end;
end;
function IsSpotGone: Boolean;
var
Temporary2D: T2DPointArray;
begin
if TabBackPack.IsFull then
exit(TRUE);
Result := CurrentSpot.equals([0, 0]);
if not Result then
Result := not FindFishingSpot(1500, CurrentSpot, Temporary2D, true);
Result := False;
end;
function IsAtFishingSpot: Boolean;
var
TP: TPoint;
begin
if (Minimap.FindSymbol(TP, MM_SYMBOL_FISHING, Minimap.GetBounds())) then
begin
Result := TRUE;
end
else
Result := FALSE;
end;
function IsAtBank: Boolean;
var
TP: TPoint;
begin
if (Minimap.FindSymbol(TP, MM_SYMBOL_BANK, Minimap.GetBounds())) then
begin
Result := TRUE;
end
else
Result := FALSE;
end;
procedure Antiban;
begin
PrintDebug(DEBUG_INFO, 'Running Antiban ...');
case Random(120) of
10:;
20: AMouseCircle(Mainscreen.GetBounds);
30: RandomRClickItem();
40:;
50: PickUpMouse();
60: MouseOffClient(OFF_CLIENT_RANDOM);
70:;
80: HoverRandomSkill();
90: BoredHuman();
100:;
110: SmallRandomMouse();
end;
end;
procedure TakeMiniBreak;
begin
PrintDebug(DEBUG_INFO, 'Taking a mini break ...');
case Random(100) of
1: Wait(RandomRange(1000, 2000));
2:;
3: Wait(RandomRange(2000, 3000));
4:;
5: Wait(RandomRange(3000, 4000));
6: Wait(RandomRange(4000, 5000));
7:;
8: Wait(RandomRange(5000, 6000));
9:;
10: Wait(RandomRange(6000, 7000));
11: Wait(RandomRange(7000, 8000));
12:;
13: Wait(RandomRange(8000, 9000));
14:;
15: Wait(RandomRange(9000, 10000));
16:;
17: Wait(RandomRange(10000, 11000));
end;
end;
procedure GoFishing;
var
FishingSpotTPA: TPointArray;
FishingSpots2D: T2DPointArray;
TP: TPoint;
begin
ClaimSpinTicket();
if TabBackPack.isFull then
exit;
if (FeatherCount <= 1) then
begin
PrintDebug(DEBUG_FATAL, 'No feathers !!');
TerminateScript();
end;
for y := 20 to 24 do
begin
if TabBackPack.isFull then
exit;
CurrentSpot := [0, 0];
if FindFishingSpot(1200, Mainscreen.GetBounds, FishingSpots2D, FALSE) then
begin
z := High(FishingSpots2D);
for x := 0 to z do
Insert(FishingSpots2D[x].CenterPoint, FishingSpotTPA);
FishingSpotTPA.SortFromPoint(Mainscreen.PlayerPoint);
for x := 0 to z do
begin
MouseRandom(FishingSpotTPA[x].RandRange( - 3, 3), MOUSE_MOVE);
if (IsMouseOverText(['ure'])) then
begin
TakeMiniBreak();
MouseRandom(FishingSpotTPA[x].RandRange( - 3, 3), MOUSE_LEFT);
PrintDebug(DEBUG_INFO, 'Found and clicked on fishing spot ...');
exit;
end else if (x = z) then
begin
if TabBackPack.IsFull then
exit;
PrintDebug(DEBUG_INFO, 'Failed to find fishing spot ...');
if (CurrentLocation = SPOT_ONE) then
begin
if FindDTM(FISHSPOT_TWO, x, y, Minimap.GetBounds) then
begin
MouseRandom([x, y], MOUSE_LEFT);
end else
PrintDebug(DEBUG_FATAL, 'Failed to find second fishing spot ...');
CurrentLocation := SPOT_TWO;
wait(1000);
while (Minimap.IsPlayerMoving) do
wait(100);
wait(100);
end;
if (CurrentLocation = SPOT_TWO) then
begin
if FindDTM(FISHSPOT_ONE, x, y, Minimap.GetBounds) then
begin
MouseRandom([x, y], MOUSE_LEFT);
end else
PrintDebug(DEBUG_FATAL, 'Failed to find first fishing spot ...');
CurrentLocation := SPOT_ONE;
wait(1000);
while (Minimap.IsPlayerMoving) do
wait(100);
wait(100);
end;
exit;
end;
end;
end;
end;
end;
procedure Proggy;
begin
SmartImage.Clear();
//SmartImage.DrawClippedText('Level: ' +
// ToStr(TabStats.GetSkillLevel(SKILL_FISHING)) +
// ' (+' +
// ToStr(TabStats.GetSkillLevel(SKILL_FISHING)
// - InitialLevel) + ')', point(55, 60),
// 'UpChars07', TRUE, clWhite);
SmartImage.DrawClippedText('Experience: ' + ToStr(ChatBox.GetXP()) +
' (+' + ToStr((ChatBox.GetXP() - InitialXP)) +
')', point(55, 75), 'UpChars07', TRUE, clWhite);
TabBackPack.Open();
SmartImage.DrawClippedText('Fish caught: ' + ToStr(FishCaught),
point(55, 90), 'UpChars07', TRUE, clWhite);
SmartImage.DrawClippedText('Feathers: ' +
ToStr(FeatherCount()) +
' (' + ToStr(FeatherCount() - InitialFeathers) +
')', point(55, 105),
'UpChars07', TRUE, clWhite);
SmartImage.DrawClippedText('Time running: ' + TimeRunning(TIME_FORMAL),
point(55, 120), 'UpChars07', TRUE, clWhite);
end;
procedure MainLoop;
var
TP: TPoint;
begin
Proggy();
RespondToChat();
if not Minimap.IsRunEnabled then
Minimap.toggleRun(TRUE);
if TabBackPack.isFull then
DropItems();
Mainscreen.SetAngle(MS_ANGLE_HIGH);
Minimap.SetAngle(MM_DIRECTION_EAST);
if not IsPlayerFishing then
begin
Status('Current location: Fishing spot | Fishing: False');
GoFishing;
end;
if IsPlayerFishing then
begin
Status('Current location: Fishing spot | Fishing: True');
Wait(RandomRange(100, 150));
Antiban();
end;
end;
begin
AddOnTerminate('scriptTerminate');
ClearDebug();
initPlayerForm();
runPlayerForm();
if (not playerForm.isScriptReady) then
exit;
DeclarePlayers();
smartEnableDrawing := Players[CurrentPlayer].booleans[1];
DisableIPScreenshots := not Players[CurrentPlayer].booleans[0];
DisableSRLLog := Players[CurrentPlayer].booleans[2];
SetupSRL();
Initialize();
if not IsLoggedIn then
Players[CurrentPlayer].Login;
if (Players.GetActive > 0) then
begin
Wait(Random(500, 600));
InitialFeathers := FeatherCount();
InitialXP := ChatBox.GetXP();
FishCaught := 0;
InitialLevel := TabStats.GetSkillLevel(SKILL_FISHING);
if IsAtBank then
begin
Status('Current location: At bank | Fishing: False');
Minimap.ClickCompass;
if (not Minimap.FindSymbol(TP, MM_SYMBOL_FISHING, Minimap.GetBounds)) then
begin
repeat
for x := 1 to 5 do
Minimap.RadialWalk(7693658, x, 100, 180, 120, 10);
Wait(RandomRange(3000, 5000));
until (Minimap.FindSymbol(TP, MM_SYMBOL_FISHING, Minimap.GetBounds));
end;
if FindDTM(FISHSPOT_ONE, x, y, Minimap.GetBounds) then
begin
MouseRandom([x, y], MOUSE_LEFT);
end else
PrintDebug(DEBUG_FATAL, 'Failed to find first fishing spot ...');
Mainscreen.SetAngle(MS_ANGLE_HIGH);
Minimap.SetAngle(MM_DIRECTION_EAST);
CurrentLocation := SPOT_ONE;
end;
if not IsAtBank then
begin
if FindDTM(FISHSPOT_ONE, x, y, Minimap.GetBounds) then
begin
MouseRandom([x, y], MOUSE_LEFT);
end else
PrintDebug(DEBUG_FATAL, 'Failed to find first fishing spot ...');
end;
CurrentLocation := SPOT_ONE;
end;
while (Players.GetActive > 0) do
begin
if (AnsiCompareStr(timeRunning(TIME_BARE), '05:30:00') <> 0) then
begin
CloseAdWindow();
ExitSquealOfFortune();
MainLoop();
end else
begin
PrintDebug(DEBUG_INFO, 'It' 's been 6 hours ...');
TerminateScript();
end;
end;
end.