Simba Code:
//----------------------------------------------------------------------------//
// -- BirdTrap
// -- by WT-Fakawi
// -- 0.12
// --
// -- HUNTING SCRIPT
//----------------------------------------------------------------------------//
// --
// -- !!!! FOR THE SRL COMMUNITY ONLY !!!!!
// -- !!!! DO NOT DISTRIBUTE THIS SCRIPT !!!!!
// -- !!!! USE FOR YOUR OWN PRIVATE PURPOSES !!!!
// --
// -- You are free to copy/paste/modify this script or parts
// -- of this script as long as you credit me and the SRL-community.
//----------------------------------------------------------------------------//
// --
// -- This Script traps birds
// -- Use it to level your Hunting to 30+
//----------------------------------------------------------------------------//
// -- INSTRUCTIONS
// -- 1. Place your Player at a Bird Hunting spot.
// -- 2. Have one (1) birdtrap in invspot 1-24 and have reserve traps in spot 25-28.
// -- 3. This script is NOT designed for MultiPlayer. Use one Player only.
// -- Enjoy!
//----------------------------------------------------------------------------//
program BirdHunter;
{.include SRL/SRL/Misc/Smart.simba}
{.include SRL\SRL.simba}
var
BBones, Birds, Traps, Missed, FallenTraps, HuntingLevel, HPLevel: integer;
var
OBx, OBy, CalTime:Integer;
Const
FawkiDebug = False;
BirdXp = 95;
//----------------------------------------------------------------------------//
Procedure DeclarePlayers;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active := True;
end;
//----------------------------------------------------------------------------//
procedure ProgressReport;
begin
ClearDebug;
WriteLn(' ');
WriteLn('<============== - Progress Report ===============>');
writeln('Worked for '+ TimeRunning);
writeln('Hunting Level '+ IntToStr(HuntingLevel));
writeln('Caught '+ IntToStr(Birds)+ ' Birds');
writeln('XP Gained '+ IntToStr(Birds * BirdXp));
writeln('Placed '+ IntToStr(Traps)+ ' Traps');
writeln('Missed '+ IntToStr(Missed)+ ' Times');
writeln('Picked Up '+ IntToStr(FallenTraps)+ ' Fallen Traps');
writeln('Buried '+ IntToStr(BBones)+ ' Bones');
end;
//----------------------------------------------------------------------------//
Procedure Up;
Begin
KeyDown(VK_UP);
Wait(2500 + Random(1000));
KeyUp(VK_UP);
End;
//----------------------------------------------------------------------------//
procedure FTWait(myLen:Integer);
var mywait: Integer;
begin
for mywait := 1 to myLen do
begin
Wait(100 + Random(100));
FindNormalRandoms;
end
end;
//----------------------------------------------------------------------------//
Function HaveBirdTrap(var WhereX, WhereY:Integer):Boolean;
var
BirdTrap:Integer;
begin
BirdTrap := BitmapFromString(16, 11, 'meJxjYECA////M5AICGpBU4Cpni' +
'QFEPZ/MCBoApHimAbispdUd+K3Ar96NC3EOwCrX/BYgSYCAHr4aJg=');
if FindBitMapMaskTolerance(BirdTrap, WhereX, WhereY, MIx1, MIy1, MIx2, MIy2 - 42, 10, 10) then
begin // keep lower row free! for extra reserve traps
Result := True;
if FawkiDebug then writeln('HaveBirdTrap returned True');
end;
// if FawkiDebug then writeln('HaveBirdTrap returned False');
FreeBitmap(BirdTrap);
end;
//----------------------------------------------------------------------------//
Function PlaceTrap(StepForward:Boolean):Boolean;
var
BTX, BTy:Integer;
begin
if HaveBirdTrap(BTx, BTy) then
begin
if StepForward then Mouse(MSCx + 30, MSCy + 5, 10, 10,True);
FFlag(0);
FTWait(12);
Mouse(BTX, BTy, 4, 4, True);
FTWait(24);
if pos('lay a trap here',GetBlackChatMessage) <> 0 then
begin
Mouse(MSCx + 30, MSCy - 5, 10, 5,True);
end;
Inc(Traps);
Result := True;
if FawkiDebug then writeln('PlaceTrap: Placed Trap');
end
else
Result := False;
end;
//----------------------------------------------------------------------------//
procedure DropandBury;
var
i, Ix, Iy, RawBirdMeat, BonesMask: Integer;
TB: TBox;
begin
RawBirdMeat := BitmapFromString(8, 6, 'beNpNy9sKQEAYReHHNZj' +
'fYdQMQ5JccOGdLamd+q5We5tPrsBUOuS6ksW8rI1h61rsoZdjCHLG' +
'+MeSC997zh82XNSvMYGl4tsfee9COg==');
BonesMask := BitmapFromString(10, 9, 'meJxjYEAH/8EAQxghCyfhiuEAWQq' +
'XAoKASGX4TUCzEQ8DWT0Aj6NNsw==');
MakeCompass('N');
GameTab(tab_Inv);
FtWait(1);
for i := 1 to 28 do
begin
TB := InvBox(i);
if ExistsItem(i) then
begin
if FindBitmapToleranceIn(RawBirdMeat, Ix, Iy, TB.x1, TB.y1, TB.x2, TB.y2, 50) then
begin
if FawkiDebug then writeln('Dropping RawBirdMeat');
Mouse(Ix - 4, Iy - 4 , 8, 8, False);
ChooseOption('rop');
FTWait(2);
end;
if FindBitmapMaskTolerance(BonesMask, Ix, Iy, TB.x1, TB.y1, TB.x2, TB.y2, 20, 50) then
begin
if FawkiDebug then writeln('Burying Bones');
Mouse(Ix - 4, Iy - 4 , 8, 8, False);
ChooseOption('ury');
FTWait(8);
end;
end;
end;
FreeBitmap(RawBirdMeat);
FreeBitmap(BonesMask);
ProgressReport;
end;
//----------------------------------------------------------------------------//
procedure CheckLevels;
begin
GameTab(Tab_Stats);
HuntingLevel := GetSkillLevel('hunting');
HPLevel := GetSkillLevel('hitpoints');
GameTab(Tab_Inv);
end;
//----------------------------------------------------------------------------//
procedure Quit(reason:String);
begin
writeln('QUIT: '+ reason + 'QUIT');
Logout;
TerminateScript;
end;
//----------------------------------------------------------------------------//
Procedure Setup;
begin
SetupSRL;
DeclarePlayers;
LoginPlayer;
CheckLevels;
end;
//----------------------------------------------------------------------------//
begin
Setup;
CalTime := GetSystemTime;
repeat
if PlaceTrap(True) then
begin
repeat
FtWait( 1 + Random(3));
if Random(50) = 0 then SleepAndMoveMouse(1000 + random(200));
repeat
if FindColorTolerance(OBx, OBy, 4880299, 265, 143, 331, 185, 20)
or FindColorTolerance(OBx, OBy, 3956845, 265, 143, 331, 185, 20) then
begin
MMouse(OBx, OBy, 0, 0);
GetMousePos(OBx,OBy);
end;
until not IsUpText('Walk here') or not IsUpText('Walk here / ');
if IsUpText('Dismantle Bird snare / 2 more options') then
begin
FtWait(2);
Mouse(Obx, Oby, 0, 0, True);
FtWait(12);
Inc(Missed);
Break;
end;
if IsUpText('Check Bird snare / 2 more options') then
begin
FtWait(2);
Mouse(Obx, Oby, 0, 0, True);
FtWait(12);
Inc(Birds);
if InvCount > 10 + Random(10) then DropAndBury;
Break;
end;
if IsUpText('Take Bird snare / 3 more options') then
begin
FtWait(2);
Mouse(Obx, Oby, 0, 0, True);
FtWait(12);
Inc(FallenTraps);
Break;
end;
until False;
end;
until not LoggedIn;
Quit('EOF');
end.