SRL Archive - First Scripts

Master Farmer Thiever - Banks, Eats. (Need testers)


Zota

2010-12-04 04:10:38

Master Farmer Thiever!

[ADMIN]Reflection is Broken this script will not work.

~BraK[/ADMIN]

Features:

+Banks
- Deposits if inv full, deposits if low hp and need food)
- Withdraws food (Currently only lobsters)
+Progress report (FINALLY!)
+Fairly quick…


Instructions:

1. Make sure lobsters are in the first bank slot.
2. Withdraw 10 Lobsters.
3. Stand in Draynor by all the stalls and the Master Farmer.
4. Start


NSFAQ: (Not so frequently Asked Questions)

I haven't added bank tab swapping yet so if you haven't got a seed tab already… your bank's misc tab is going to get messsssy :P

I will be adding food support for: Salmon, Trout, Tuna, Lobby, Monkfish.


Known Bugs:

If it is too far away from banksymbol it wont bank. This is something to do with the radialwalking not kicking in. It's an awkward little path bit… I know how to fix it though, which I'll do later at some point.

————————————————————————

Things to keep in mind:
I as a botter really do not care for antiban. When I thieve, I dont go dicking about in my skill tab or some crazy ass shit.. I just thieve lol. I WILL try and add some antiban that doesn't waste time. For now… be a man!

Make sure you reply with any feedback/suggestions. I'm still learning so if something is inefficient/wrong, please let me know!





program MasterFarmerThiever;

{$i SRL/SRL/Misc/SMART.scar}
{$i SRL/SRL.scar}
{$i Reflection/Reflection.simba}

var
x, y, stop, Startexp, Newexp : Integer;

const
SMARTWORLD = 72;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := ''; //Your username
Players[0].Pass := ''; //Your password
Players[0].Nick := ''; //3-4 letters from your username
Players[0].Active := true;
end;

procedure Antiban;
begin
case Random(100) of
0: HoverSkill('thieving', false);
1: RandomRClick;
2: RandomMovement;
4: PickUpMouse;
end;
end;

Procedure Login;
begin
LoginPlayer;
wait(1000+random(1000));
MakeCompass('N');
SetAngle(true);
GetAllLevels;
FindNormalRandoms;
Startexp := R_GetSkillExperience(17);
end;

Function Health : integer; //VeryBigKitty's ;p
begin
result := (R_GetMMLevels('hp'));
end;

procedure Report;
Var
gained, running, rate, times, fun, h, m, s: integer;
begin
if not(loggedin) then exit;
ClearDebug;
Newexp := R_GetSkillExperience(17);
gained := Newexp - Startexp;
ConvertTime(gettimerunning, h, m, s);
running := round (gettimerunning / 1000);
rate := (gained*3600)/(h*3600+m*60+s);
times := gained / 43;
fun := 13034431 - Newexp;
WriteLn('=================================');
WriteLn('Ran for: ' + TimeRunning + ' ');
WriteLn('Gained ' + inttostr(gained) + ' exp');
WriteLn('Pickpocketed ' + inttostr(times) + ' times');
WriteLn('EXP/Hour: ' + inttostr(rate));
WriteLn('=================================');
end;

procedure Bank;
var
food, inventory : TInvItemArray;
monkfish, lobster : TIntegerArray;
i, energy : Integer;
begin
monkfish := ([7946, 7947]);
lobster := ([379, 380]);
energy := R_GetMMLevels('energy');

if ((InvFull()) and ((not(R_ItemIDExistsEx(lobster, inventory)))) or (Health < 160) and ((not(R_ItemIDExistsEx(lobster, inventory))))) then
begin
writeln('Status: Inventory full. Banking.');
if ((energy >= 8) and ((not(R_IsRunning)))) then
Mouse(725, 109, 5, 5, true);
repeat
MakeCompass('n');
wait(500 + random(250));
RadialWalk(7434099, 80, 150, 20, -1, 0);
R_Flag;
until findsymbol(x, y, 'bank') or FindBank('db');
begin
writeln('Status: Found bank');
Mouse(x,y,2,3,true);
R_Flag;
wait(1000+random(500));
end;
OpenBankFast('db');
if (BankScreen) then
begin
Wait(30+random(65));
DepositAll;
SearchBank('Lobster');
Wait(1500 + random(1220));
Withdraw(0, 0, 10);
CloseBank;
food := GetInventoryItems;
if (food[i].Name = 'Lobster') then
begin
writeln('Status: We have food');
if ((energy >= 8) and ((not(R_IsRunning)))) then
Mouse(725, 109, 5, 5, true);
RadialWalk(7434099, 310, 280, 70, -1, 0);
R_Flag;
end else
Bank;
end;
end;
end;

procedure CheckHealth;
var
x, y, monkfishDTM, lobsterDTM : Integer;
inventory : TInvItemArray;
monkfish, lobster : TIntegerArray;
begin
monkfish := ([7946, 7947]);
lobster := ([379, 380]);
monkfishDTM := DTMFromString('mrAAAAHic42BgYHBggmAvIA4CYm8gdgZiMyA2BeLnQD' +
'X3ofgOED8D4rdA/AKIHwJxoLsdkGTCg/EDRgIYBgAQ1Ao3');
lobsterDTM := DTMFromString('mggAAAHicY2NgYMhjYmDIAeJKIC4F4lwgjgNiDkYGBhY' +
'g/g1UwwukxYGYG4iXBIkDRZiwYOyAEQeGAAD7JgT+');
if ((Health < 160) and (R_ItemIDExistsEx(lobster, inventory))) then
begin
repeat
if FindDTM(lobsterDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
WriteLn('Status: Health is dangerously low - Eating!');
MMouse(x, y, 1, 1);
GetMousePos(x, y);
if (pos('Eat', rs_GetUpText) > 0) then
begin
Mouse(x, y, 1, 1,true);
wait(1500+random(500));
end;
end;
until Health > 160
end else
FreeDTM(monkfishDTM);
FreeDTM(lobsterDTM);
Bank;
end;

{*******************************************************************************
function Stunned: Boolean;
By: NCDS
Description: Return's True if stunned by NPC.
*******************************************************************************}
function Stunned: Boolean;
var
P : TPoint;
Search : TBox;
begin
P.x := MSCx;
P.y := MSCy;
Search.x1 := P.x - 30;
Search.y1 := P.y - 30;
Search.x2 := P.x + 30;
Search.y2 := P.y + 30;
Result := FindColorTolerance(P.x, P.y, 5106941, Search.x1, Search.y1,
Search.x2, Search.y2, 5) and
IsChatBoxTextBetween('stunned', 0, 7, 8);
end;

procedure CheckInv;
var
monkfishDTM, lobsterDTM : Integer;
inventory : TInvItemArray;
monkfish, lobster : TIntegerArray;
begin
monkfish := ([7946, 7947]);
lobster := ([379, 380]);
monkfishDTM := DTMFromString('mrAAAAHic42BgYHBggmAvIA4CYm8gdgZiMyA2BeLnQD' +
'X3ofgOED8D4rdA/AKIHwJxoLsdkGTCg/EDRgIYBgAQ1Ao3');
lobsterDTM := DTMFromString('mggAAAHicY2NgYMhjYmDIAeJKIC4F4lwgjgNiDkYGBhY' +
'g/g1UwwukxYGYG4iXBIkDRZiwYOyAEQeGAAD7JgT+');
if InvFull() and R_ItemIDExistsEx(lobster, inventory) then
begin
if FindDTM(lobsterDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
WriteLn('Status: Inventory full. Eating food to clear space.');
MMouse(x, y, 1, 1);
wait(200+Random(121));
GetMousePos(x, y);
if (pos('Eat', rs_GetUpText) > 0) then
begin
Mouse(x, y, 1, 1,true);
wait(1500+random(500));
end;
end;
end else
FreeDTM(monkfishDTM);
FreeDTM(lobsterDTM);
Bank;
end;

function CheckFight: Boolean;
var
P : TPoint;
Search : TBox;
begin
P.x := MSCx;
P.y := MSCy;
Search.x1 := P.x - 30;
Search.y1 := P.y - 30;
Search.x2 := P.x + 30;
Search.y2 := P.y + 30;
Result := FindColorTolerance(P.x, P.y, 5106941, Search.x1, Search.y1,
Search.x2, Search.y2, 5) and
IsChatBoxTextBetween('during', 0, 7, 8);
end;

function CheckNPC: TTile;
var
Farmer: TNPCArray;
i : Integer;
begin
if not LoggedIn then
Exit;
Farmer := GetNPCsBy('Master Farmer');
if high(Farmer) > -1 then
begin
for i:=0 to high(Farmer) do // Fixed!
begin
if (Farmer[i].Name = 'Master Farmer') then
begin
result := Farmer[i].Tile;
end;
end;
end;
end;

function ThieveFarmer: Boolean;
var
i, energy : Integer;
Farmer : TNPCArray;
FarmerPos : TPoint;
begin
energy := R_GetMMLevels('energy');
if ((energy >= 15) and ((not(R_IsRunning)))) then
Mouse(725, 109, 5, 5, true);
if CheckFight then
begin
writeln('Under attack!');
RunAway('N', true, 1, 4000);
end;
if InvFull() then CheckInv;
begin
if ((Health < 160)) then
CheckHealth;
if Stunned then
begin
writeln('Status: Stunned...');
Wait(RandomRange(2700, 500));
end;
if((not(TileOnMS(CheckNPC, 0)))) then
begin
writeln('Attempting to find farmer.');
CheckNPC;
FarmerPos := TileToMM(CheckNPC);
Mouse(FarmerPos.x, FarmerPos.y, 4, 4, True);
if(R_FlagExists)then
R_Flag;
end;
if(TileOnMS(CheckNPC, 0)) then
begin
CheckNPC;
FarmerPos := TileToMS(CheckNPC, 0);
MMouse(FarmerPos.x, FarmerPos.y, 1, -25);
end;
if(OptionExists('Steal') and (R_IsUpText('stall'))) then
begin
Mouse(FarmerPos.x, FarmerPos.y, 1, -25, false);
wait(500+Random(412));
if(WaitOptionMulti(['ickpocket'], 150)) then
begin
Result := True;
wait(50+random(100));
R_Flag;
end else
end;
if(OptionExists('Pickpocket') and (R_IsUpText('Master Farmer'))) then
begin
Mouse(FarmerPos.x, FarmerPos.y, 1, -25, true);
wait(50+random(100));
R_Flag;
end;
end;
result := true;
end;

begin
Smart_Server := SMARTWORLD;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;

SetupSRL;
DeclarePlayers;
Wait(500);
Login;
repeat
if not(loggedin) then login;
FindNormalRandoms;
repeat
Report;
ThieveFarmer;
FindNormalRandoms;
CheckHealth;
Antiban;
until(stop = 1);
stop := 0;
until(false);
end.

Version Changes:
V1.04 - Added running and energy checks.

Progress Reports:

I'm aiming to add a profit p/h at some point aswell… Just need to write up all the damn prices ffuu–


=================================
Ran for: 25 Minutes and 1 Seconds
Gained 10019 exp
Pickpocketed 233 times
EXP/Hour: 24029
=================================
Status: Stunned…


=================================
Ran for: 45 Minutes and 32 Seconds
Gained 16813 exp
Pickpocketed 391 times
EXP/Hour: 22154
=================================
Status: Health is dangerously low!


(Longest progress report so far! No errors as of yet :P)
=================================
Ran for: 1 Hours, 26 Minutes and 39 Seconds
Gained 37953 exp
Pickpocketed 882 times
EXP/Hour: 26280
=================================
Status: Stunned…


=================================
Ran for: 2 Hours, 36 Minutes and 45 Seconds
Gained 64221 exp
Pickpocketed 1493 times
EXP/Hour: 24582
=================================
Status: Inventory full. Banking.


Becks

2010-12-04 12:05:39

Ideas:
add cakes :) and gloves of silence withdraw.

Cstrike

2010-12-04 12:15:57

Wow color and reflection, impressive.
Going to use the, whats the thieving level to pickpocket master farmer again?

Becks

2010-12-04 12:18:28

From: cstrike
Wow color and reflection, impressive.
Going to use the, whats the thieving level to pickpocket master farmer again?


level 38. Zota impressing everyone :D

Zota

2010-12-04 13:42:10

Cheers guys :D

It doesn't run for more than half an hour without getting some sort of Out Of Range error though -sigh-. I thought I fixed them all >_>

Luke-

Cstrike

2010-12-04 13:46:34

From: Zota
Cheers guys :D

It doesn't run for more than half an hour without getting some sort of Out Of Range error though -sigh-. I thought I fixed them all >_>

Luke-


Does it end up saying it in the "Text.simba" menu?
If that is the out of range error, then that will be fixed. Ref devs who know the java/core part are doing finals, and once the break comes they'll fix it

Frement

2010-12-04 13:48:29

From: cstrike
Does it end up saying it in the "Text.simba" menu?
If that is the out of range error, then that will be fixed. Ref devs who know the java/core part are doing finals, and once the break comes they'll fix it


The Maze solver has similar out of range issues.
Line 268: Result.Tiles[17] := Tile(2910, 4576);

Debug:
[Reflection] Trying to solve: Maze
[Maze] Player Pos: (2891, 4555)
[Maze] Loading green path
Error: Out Of Range at line 268

Zota

2010-12-04 14:00:14

Ah ok then, good :D (Yes cstrike, it is only the text.simba that returns out of range now).

Luke-

HyperSecret

2010-12-05 02:53:12

If you're going to use reflection, I would just use animations for being stunned also. It will be 100% accurate. I assume the way it is now is fine, maybe an additional check…

Zota

2010-12-05 02:57:57

Ye the way I'm using now works perfectly :P However, I'll read into using animation checks. Sounds effective!

The only thing I'm not liking is the damn walking.. it seems so unreliable… radialwalking that is. Sometimes it doesn't find the road color (which seems to break every day!) I've set the angles as best I can get them.. argh! it seems like it's more luck than anything!

And also the bank finding is really ineffective. FindBank works great if it's in the bank. Banksymbol is totally unreliable and if someone is standing on the bank symbol, it wont find it!! >_< Know any way to get around that?


… Maybe I'll just switch it all to tile finding… I have no idea how to randomise the tile clicking though X'D

Luke-


edit:

lol I love your signature XD about the highlight indenting. Had to try it :P

bbri06

2010-12-05 18:46:38

After you convert the tile to a point on the minimap then the randomness in the mouse procedure should be sufficient for tile clicking randomness.

Nikize

2010-12-08 12:02:48

When hp get to < 160, it doesnt eat and say what it is supposed to say in the debug box

WriteLn('Status: Health is dangerously low - Eating!');

instead the Microsoft Dos window says
SMART Disabled
Replacing Canvas Drawing Surface
DIsaveling Events
Starting Image Transfer
SMART Enabled
Transfer Thread Entered

After this it stands for a long time, even though the farmer is near, and after 3 minutes it continiunes to steal even though hp < 160.

Edit: My food was lobsters

Becks

2010-12-08 13:02:21

Will be testing/running soon. Been having problems with my simba/smart.. You think you will be adding a death walker?

Nikize

2010-12-08 14:00:35

yeah, it seems this script is broken, it does the same freezing each and every time after hp goes below 160.

sigisx5

2011-11-06 02:08:21

yes the script not working :(

grats

2011-11-06 02:10:29

yea it's a reflection script, they're all broke

sigisx5

2011-11-06 02:22:15

but there`s no master thiefer bot with (color) :( so i cant boting

Mr. Bottomtooth

2011-11-06 08:40:40

From: sigisx5
but there`s no master thiefer bot with (color) :( so i cant boting


If there is no ball around, it's hard to play football, yes.

BraK

2011-11-06 09:05:11

Closed reflections broke wait for new color version. :/

WT-Fakawi

2011-11-06 13:10:43

From: sigisx5
but there`s no master thiefer bot with (color) :( so i cant boting


I guess I will need to update my MFT! Got me 99 on several accounts. My safe cracker still works. All members.