Code:
//----------------------------------------------------------------------------//
// --
// -- Thiever 0.1
// --
// -- by WT-Fakawi
// --
// --
// -- 0.11
// --
// --
// -- --- colors only ---
// --
// --
// --
// -- This script thieves the farmer at Lumbridge, near the chicken pen.
// -- Use it for low level thieving (until 37)
// --
// -- Place your players in the Farmer house with plenty lobsters
//---
// --
//----------------------------------------------------------------------------//
// --
// -- !!!! FOR THE SRL COMMUNITY ONLY !!!!!
// -- !!!! DO NOT DISTRIBUTE THIS SCRIPT !!!!!
// -- !!!! FOR PRIVATE USE ONLY !!!!
// --
// -- You are free to copy/paste/modify this script or parts
// -- of this script as long as you credit me and the SRL-community.
// --
//----------------------------------------------------------------------------//
program Farmer_Thiever;
{$i SRL/SRL/misc/SMART.scar}
{$i srl/srl.scar}
{$i srl/srl/misc/stats.simba}
{$i srl/srl/skill/magic.scar}
var // Color and counters
LobMask, PocketsPicked, PocketsFailed: Integer;
const
SMART_world = 3;
SRLStatsName = ''; // Your SRL Stats name
SRLStatsPW = ''; // Your SRL Stats password
PlayerTime = 360; // PlayerTime in minutes, maxed to 6 hours.
WTLampSkill = 'dungeoneering'; // Lamp skill.
FawkiDebug = False; // set to true for extensive debug.
FawkiProcDebug = False;
VersionNumber = 0.11;
Procedure ProgressReport; Forward;
//----------------------------------------------------------------------------//
procedure DeclarePlayers;
begin
HowManyPlayers:= 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Pin := '';
Players[0].Active := true;
end;
procedure loadbm;
begin
LobMask := BitmapFromString(33, 31, 'meJzVlEsOwCAIBbn/pdudMWAej5' +
'+JLppUZIYWokjP+rbVhNR88DqhmLAcgc9ZAKrFYnvdOF0WwjPdGo5' +
'Rkq9yeRTDB2XvH1Xhu2fAMTe92Pdp/hMKZnorNYARUjWMKlwIiK79' +
'4jwrlMWG7hwc3f+J4q8nbn2iGCCt8FUKyU8oovyoYppvLUOKY1bLL' +
'CW8dxSNfDHdYS7AnCVB/gHu+XiW');
end;
//----------------------------------------------------------------------------//
procedure SetupScript;
begin
if SMART_world <> 0 then
SMART_Server := SMART_world;
SMART_members := true;
SMART_signed := true;
SetUpSRL;
DeclarePlayers;
SetupSRLAutoResponder;
SymbolAccuracy := 0.75;
LampSkill := WTLampSkill;
Loadbm;
ClearDebug;
Writeln('Welcome to Farmer Thiever ' + FloatToStr(VersionNumber));
end;
//----------------------------------------------------------------------------//
function WTFindObjTPAEx(var X, Y: Integer; Color, Tol, CTS, ObjWidth, ObjHeight, // by Wizzup? Edited by WT-Fakawi.
minCount: Integer; x1,y1,x2,y2:Integer; UpText: TStringArray): Boolean;
var
I, tCTS: Integer;
myPoint: TPoint;
Points: TPointArray;
aPoints: T2DPointArray;
begin
Result := False;
if not LoggedIn then exit;
tCTS := GetColorToleranceSpeed;
CTS := Integer(CTS * 9 mod 3 <> 0);
ColorToleranceSpeed(CTS);
FindColorsSpiralTolerance(X, Y, Points, Color, x1,y1,x2,y2, Tol);
if Length(Points) = 0 then
begin
ColorToleranceSpeed(tCTS);
Exit;
end;
ColorToleranceSpeed(1);
aPoints := TPAtoATPAEx(Points, ObjWidth, ObjHeight);
SetLength(Points, 0);
for I := 0 to High(aPoints) do
begin
if Length(aPoints[i]) < minCount then
Continue;
myPoint := MiddleTPA(aPoints[i]);
MMouse(myPoint.X, myPoint.Y, 0, 0);
if WaitUpTextMulti(UpText, 300) then
begin
GetMousePos(X, Y);
Result := True;
ColorToleranceSpeed(tCTS);
Exit;
end;
end;
ColorToleranceSpeed(tCTS);
end;
procedure WTFixChat; // Scrolls the chat down so we can do GetBlackChat
var
ScrollX, ScrollY, x, y: Integer;
begin
ScrollX := 499 + Random(8);
ScrollY := 445 + Random(8);
if FindColorTolerance(x, y, 2041131, 504, 441, 504, 441,10) then
begin
MMouse(ScrollX, ScrollY, 0, 0);
HoldMouse(ScrollX, ScrollY, MouseAction(True));
while FindColorTolerance(x, y, 2041131, 504, 441, 504, 441,10) do
Wait(10 + random(15));
Wait(50+random(50));
ReleaseMouse(ScrollX, ScrollY, MouseAction(true));
Wait(100+random(50));
end;
end;
//----------------------------------------------------------------------------//
procedure FTWait(myLen:Integer); // Pumping heart of script.
var mywait, Tab: Integer; // Performs findnormalrandoms, callibrate, respond
begin
// Respond;
If not Loggedin then Exit;
WTFixChat;
for Tab := 21 to 37 do
begin
if ((Tab = 29) or (Tab = 27)) then Continue;
if not TabExists(Tab) then
Begin
Writeln('TAB ' + IntToStr(Tab) + ' NOT VISIBLE. TROUBLE!');
if not LoggedIn then Exit;
if Not FindNormalRandoms then
begin
LogOut;
LeaveLobby;
ProgressReport;
end;
End;
End;
for mywait := 1 to myLen do
begin
Wait(50 + Random(50));
if IsFKeyDown(1) then progressreport;
if ( pos('maze',GetBlackChatMessage) <> 0 ) then
begin
Players[CurrentPlayer].loc := 'WT MAZE';
LogOut;
ProgressReport;
LeaveLobby;
end;
if FindNormalRandoms then // If random is solved...
Begin
end
end;
end;
//----------------------------------------------------------------------------//
procedure GetPlayerStats; // stats time.
begin
GetAllLevels;
Writeln('Thieving = ' + IntToStr(Players[CurrentPlayer].Level[Skill_Thieving]));
end;
//----------------------------------------------------------------------------//
procedure ProgressReport; // progressreport. If F1 is pushed runtime, a full report is printed in the debug!
var
Active: string;
var
i: Integer;
begin
if not FawkiDebug then ClearDebug;
SRLRandomsReport;
SendSRLReport;
Players[CurrentPlayer].Integers[1] := GetSystemTime;
writeln('**********************************************');
WriteLn(' ');
WriteLn('<============== ' + FloatToStr(VersionNumber) + ' Progress Report ===============>');
writeln('Worked for '+ TimeRunning);
Writeln('Pockets Picked = ' + IntToStr(PocketsPicked));
Writeln('Pockets Failed = ' + IntToStr(PocketsFailed));
WriteLn('<============== ' + FloatToStr(VersionNumber) + ' Progress Report ===============>');
writeln('Name : '+ Players[CurrentPlayer].Name);
writeln('Number : '+ inttostr(CurrentPlayer));
if Players[CurrentPlayer].Active=True then Active:='True' else Active:='False';
writeln('Active : '+ Active);
writeln('**********************************************');
for i := 0 to HowManyPlayers-1 do
begin
if Players[i].Active=True then Active:='T' else Active:='F';
writeln( (inttostr(i))+' : '+Players[i].name + ' = '+Active
+'. '
+'TH '+inttostr(Players[i].level[Skill_Thieving])+'. '
+'W : '+IntToStr((Players[i].Integers[2] + ( Players[i].Integers[1] - Players[i].Integers[0])) / 60000 )+' min. '
+'L: '+Players[i].loc
+' R: '+Players[i].Rand);
end;
end;
//----------------------------------------------------------------------------//
function EatLob: Boolean;
var
lx,ly: Integer;
begin
if FindBitmapMaskTolerance(LobMask, lx, ly, MIx1, MIy1, MIx2, MIy2, 10, 10) then
begin
if FawkiDebug then writeln('Lobster Found');
MMouse(lx,ly,16,16);
GetMousePos(lx,ly);
Mouse(lx,ly,0,0, True);
FTwait(4);
Result := True;
end
else
begin
if FawkiDebug then writeln('No Lobsters Found. Logging Out');
Logout;
LeaveLobby;
Result := False;;
end;
end;
//----------------------------------------------------------------------------//
procedure HpCheck; //Thanks Narcle, used your script to learn how to do this
var
a, t, b, x, y:Integer;
begin
if (HPPercent < 50) and LoggedIn then
begin
if not InvEmpty then
for a := 0 to 2 do
for b := 1 to 28 do
if ExistsItem(b) then
begin
MMouseItem(b);
GetMousePos(x, y);
if WaitUptext('Eat', 400) then
begin
Mouse(x,y,0,0,false);
if WaitOption('Eat', 400) then
begin
t := GetSystemTime;
while ExistsItem(b) and ((GetSystemTime-t) < 2000) do
wait(20);
if (HPPercent > 70) then
Exit;
end;
end;
end;
if (not LoggedIn) or (HPPercent > 50) then
Exit;
end;
end;
//----------------------------------------------------------------------------//
Function Pick:Boolean;
var
x, y, tol: integer;
begin
for Tol := 10 to 30 do
begin
if WTFindObjTPAEx(x, y, 8952566, Tol, 0, 4, 4, 8, MSX1,MSy1, MSX2,MSY2, ['arm']) then
begin
if fawkidebug then writeln('tol = ' + IntToStr(tol));
GetMousePos(x,y);
Mouse(x, y, 0, 0, False);
if ChooseOption('Pick') then
begin
FFlag(0);
FTWait(1);
Inc(PocketsPicked);
Result := True;
Exit;
end;
end;
end;
end;
//----------------------------------------------------------------------------//
var
WTx, WTy: Integer;
begin
SetupScript;
LoginPlayer;
GetAllLevels;
Repeat
Pick;
if pos( 'stunned', GetblackChatMessage) <> 0 then
begin
if fawkidebug then writeln('stunned');
Inc(PocketsFailed);
FTWait(25);
end;
if FindSymbol(WTx, WTy, 'churn') then
begin
if fawkidebug then writeln('found dairy'); // Not used, for later callib purposes.
end;
if FawkiDebug then Writeln('Pockets Picked = ' + IntToStr(PocketsPicked) + '. Pockets Failed = ' + IntToStr(PocketsFailed));
HpCheck;
ProgressReport;
If not LoggedIn then Begin LeaveLobby; Break; End;
until False;
end.