SRL Archive - RS3 Outdated / Broken Scripts

Want a basic eating script.


vinnievinboy

2009-08-19 15:52:44

Basicly I want a script that just eats, Ive looked at the auto fighters and I am sure all the stuff in the script is slowing it down if all i want is something that eats. Im looking at the zombies in stronghold.

What I want;
Smart
Eats at low hp (the food I use are swordies or lobbies)
Has some antibans,
and maybe 'sometimes' clicks monsters, just as an extra antiban.
Breaks would be nice but not needed.

Oh and maybe but it may be a bit more advance, when only have 1/2 food left log out? (thing is you would have to make it go through the door to log out or you'll be in combat most of the time)

Pretty basic really.

NCDS

2009-08-19 18:11:14

I did this quick a while ago for someone else.

All it is is AntiBan and eating really. You just need to fill out const and declareplayers.

It may be what your looking for.


program Czepa;
{.include SRL/SRL/misc/SMART.scar}
{.include srl/srl.scar}

const
HPToEat = 30; // Percentage of HP you want to eat at.
dir = 'n'; // Direction to run away to. Valid arguments: n,e,s,w.

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

with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
Active := True;

for i := 0 to HowManyPlayers-1 do
Players[i].Active := True;
SetPlayerNameTPAs;
end;
end;

procedure StayLoggedIn;
var x, y: Integer;
begin
case Random(150) of
1, 33, 56 : HoverSkill('random', False);
16, 24, 88 : begin
GetMousePos(x, y);
MoveMouseSmoothEx(x + Random(65),y + Random(120), 1,
3, 45, 20, 10);
end;
53, 44, 122 : ExamineInv;
97, 133, 146 : BoredHuman;
94, 95, 149 : PickUpMouse;
end;
end;

function HPCheck(HP: Integer): Boolean;
begin
Writeln('HP Check...');
if (not (LoggedIn)) then Exit;

Result := HPPercent < HP;
if Result then
Writeln('Health is less than '+IntToStr(HP)+'%!');
Status('');
end;

procedure StayAlive;
var i, x, y, lobster: Integer; iBox: TBox; Find: Boolean;
begin
if not HPCheck(HPToEat) then Exit;

lobster := BitmapFromString(4, 3, 'beNoLFrlXLvs/VeJ/huR/UdF' +
'XdfLfWhQYGBg7vYQgjF5voVkAD4YNJQ==');

for i := 1 to 28 do
begin
iBox := InvBox(i);

if FindBitmapToleranceIn(lobster, x, y, iBox.x1, iBox.y1, iBox.x2,
iBox.y2, 5) then
begin
Find := True;
Mouse(x, y, 5, 1 + Random(2), True);
Wait(RandomRange(800, 1600));

if not HPCheck(HPToEat) then
Exit;
end;

if i = 28 then
if not Find then
begin
RunTo(dir, True);
NextPlayer(False);
end;
end;
end;

begin
SetUpSRL;
ClearDebug;
Writeln('Author := NCDS;');
ActivateClient;
DeclarePlayers;
LogInPlayer;
SetAngle(True);
FindNormalRandoms;

while Players[CurrentPlayer].Active = True do
begin
StayAlive;
StayLoggedIn;
Wait(RandomRange(5000, 15000));
end;
end.

HyperSecret

2009-08-19 18:19:57

btw, that script uses lobsters. ^^

vinnievinboy

2009-08-20 00:32:04

ah thanks alot, ill give it a go :)


Line 70: [Error] (19954:1): Unknown identifier 'RunTo' in script

Just took it out, testing now.

Doesnt seem to eat, might be a bitmap problem (looks a little short to be a bitmap to me)

Ill try putting a new bitmap in.

HyperSecret

2009-08-20 01:33:57

From: vinnievinboy
ah thanks alot, ill give it a go :)


Line 70: [Error] (19954:1): Unknown identifier 'RunTo' in script

Just took it out, testing now.

Doesnt seem to eat, might be a bitmap problem (looks a little short to be a bitmap to me)

Ill try putting a new bitmap in.



It is the smart way of doing a bitmap ;). You don't need a huge bitmap you just need a small portion of the bitmap you want instead of the whole thing…

NCDS

2009-08-20 01:37:49

From: HyperSecret
It is the smart way of doing a bitmap ;). You don't need a huge bitmap you just need a small portion of the bitmap you want instead of the whole thing…

Thank you (h)


From: vinnievinboy
ah thanks alot, ill give it a go :)


Line 70: [Error] (19954:1): Unknown identifier 'RunTo' in script

Just took it out, testing now.

Doesnt seem to eat, might be a bitmap problem (looks a little short to be a bitmap to me)

Ill try putting a new bitmap in.


I'll fix it real quick.

vinnievinboy

2009-08-20 01:42:35

For some reason I cant get it to eat. It detects the health and everything, just wont eat just logs out.


Ah thanks, (wasnt refreshing the page inbetween the editing my post :P)

But yeah can't get it to eat, ill try again after you update it.

Thanks alot.

Btw any easier way to copy the code instead of line by line? (copying it all and pasting into scar just puts it all in one line -.-)

ian.

2009-08-20 01:55:44

Ermm.. I still don't get why people get that issue.. But possibly try quoting the post, and copying everything between the
 tags? :)

vinnievinboy

2009-08-20 01:57:30

Ah that works, thanks alot! Feel like I wasted them 5minutes doing it line by line :P

ian.

2009-08-20 02:06:14

By the way, did you try marpis's tut? :)

vinnievinboy

2009-08-20 02:27:34

ah I'll give it ago at fixing it myself. Thanks for that link.

vinnievinboy

2009-08-20 02:58:12

Ive got it to kinda work I think.
It eats, but sometimes it doesnt work…

Think it would be hard to make it run out of a door when it has a few food left and log out?

Griff

2009-08-20 03:25:02

From: vinnievinboy
Ive got it to kinda work I think.
It eats, but sometimes it doesnt work…

Think it would be hard to make it run out of a door when it has a few food left and log out?


No, with you could either count the items in the inventory for the nest part to execute, or count how much food you eat, and make it run out after you eat 24-25.

NCDS

2009-08-20 04:50:41

There you go.

Works perfect with lobsters. Just fill in what ever direction you want it to run .


program Czepa;
//{.include SRL/SRL/misc/SMART.scar}
{.include srl/srl.scar}

const
HPToEat = 100; // Percentage of HP you want to eat at.
dir = 'n'; // Direction to run away to. Valid arguments: n,e,s,w.

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

with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
Active := True;

for i := 0 to HowManyPlayers-1 do
Players[i].Active := True;
SetPlayerNameTPAs;
end;
end;

procedure StayLoggedIn;
var x, y: Integer;
begin
case Random(150) of
1, 33, 56 : HoverSkill('random', False);
16, 24, 88 : begin
GetMousePos(x, y);
MoveMouseSmoothEx(x + Random(65),y + Random(120), 1,
3, 45, 20, 10);
end;
53, 44, 122 : ExamineInv;
97, 133, 146 : BoredHuman;
94, 95, 149 : PickUpMouse;
end;
end;

function HPCheck(HP: Integer): Boolean;
begin
Writeln('HP Check...');
if (not (LoggedIn)) then Exit;

Result := HPPercent < HP;
if Result then
Writeln('Health is less than '+IntToStr(HP)+'%!');
Status('');
end;

function GetColorPoints(x, y, Color, bp1, bp2, bp3, bp4, Width, Height, Tol: Integer): TPointArray;
var tpa: array of TPoint; i, o: SmallInt; atpa: T2DPointArray;
begin
FindColorsSpiralTolerance(x, y, tpa, Color, bp1, bp2, bp3, bp4, Tol);
atpa := TPAtoATPAEx(tpa, Width, Height);

for i := 0 to High(atpa) do
begin
o := GetArrayLength(Result);
SetArrayLength(Result, o + 1);
Result[o] := MiddleTPA(atpa[i]);
end;

if Length(Result) > 1 then
WriteLn('Length(Array): '+IntToStr(o)+';');
end;

procedure StayAlive;
var i, x, y: Integer; iBox: TBox; Find: Boolean; Arr: array of TPoint;
P: TPoint;
begin
if not HPCheck(HPToEat) then Exit;
if GetCurrentTab <> tab_Inv then
GameTab(tab_Inv);

for i := 1 to 28 do
begin
iBox := InvBox(i);

Arr := GetColorPoints(x, y, 1533377, iBox.x1, iBox.y1, iBox.x2, iBox.y2, 5, 5, 20);
if Length(Arr) > 4 then
begin
Find := True;
P := MiddleTpa(Arr);
Writeln('Found Lobster At ('+IntToStr(x)+', '+IntToStr(y)+');');
MMouse(P.x, P.y, 3, 3);
Wait(120 + Random(50));
if Pos('obster', Rs_GetUpText) > 0 then
Mouse(P.x, P.y, 5, 3 + Random(2), True);
Wait(RandomRange(800, 1600));

if not HPCheck(HPToEat) then
Exit;
end;

if i = 28 then
if not Find then
begin
RunTo(dir, True);
NextPlayer(False);
end;
end;
end;

begin
SetUpSRL;
ClearDebug;
Writeln('Author := NCDS;');
ActivateClient;
DeclarePlayers;
LogInPlayer;
SetAngle(True);
FindNormalRandoms;

while Players[CurrentPlayer].Active = True do
begin
StayAlive;
StayLoggedIn;
Wait(RandomRange(5000, 15000));
end;
end.

vinnievinboy

2009-08-20 13:17:44

Thanks alot! :)

Its a shame that the monsters actually stop attacking you after a while :P
could leave it there all night.

NCDS

2009-08-20 20:59:29

From: vinnievinboy
Thanks alot! :)

Its a shame that the monsters actually stop attacking you after a while :P
could leave it there all night.


Would they attack you again if you Logged out, then back in?

Sabzi

2009-08-20 21:09:47

As far as I remember logging in right after you logged out won't work. But it's not sure.
What is sure: The time after they stop attacking is constant. 10 mins or 20? I think 20 but not sure about the time. Maybe not in the wildy, I haven't afk-d there.
And to make them attack again it's enough to go out from their "area" then enter again.
So measuring the time and then using
procedure RunAway(dir: string; RunFar: Boolean; Action, WaitTime: Integer);
would be good I think. (we would use that twice, once we runaway, twice we runback http://freddy1990.com/srlmanual/SRL/core/MapWalk.html#RunAway)

EDIT:Lol afking is against the rules? Haha
http://runescape.wikia.com/wiki/Afk_training

vinnievinboy

2009-08-22 15:43:27

Yeah but a problem with that in stronghold is that there are doors (double doors) so you would need it to open them.

I might play around with it, might make it randomly click a mob here and there. Would be good also if you can get it to run from one set of zombies to the higher level zombies after like 10-20 minutes.

NCDS

2009-08-22 20:39:44

if I'm going to do that though I really might as well just make a stronghold script, honestly.

Let me finish this flax spinner then i'll see about it.

vinnievinboy

2009-08-24 01:21:33

Haha that is true :)
If you do, i'll be more than willing to help test for bugs and stuff (Although I am not on much)