SRL Archive - Test corner

My FollowPlayerToBank(WhichBank : string; MaxAttempts : integer); Procedure


Cheesehunk

2006-05-20 17:19:37

I got lazy half way through the making, and decided not to make it.

If anyone likes the idea, they can build on it, and make it work, or use the idea to make something more superior.

What the Procedure does so far:
  • Clicks on a player in the Mini-map, waits for Flag to dissapear.
  • Moves to center of Mainscreen, and checks if you are on-top of a player. If not, it will repeat.
  • If a player is found, it will right click on them, and choose the option 'Follow.'
  • It then repeatedtly asks for a free ride to TheBank, until the player says he will give you one (very buggy in checking what player has said.)
  • The script will Terminate once the MaxAttempts are reached.

I just wrote this Procedure so people can see that I can actually script a bit, however I got lazy, and there was to many bugs for me to fix, so I gave up.

If anyone continues on this Procedure, I would like credit, it could be used to make Procedures such as FollowPlayer; and many more.

Here is the Procedure:
[PHP]Procedure FollowPlayerToBank(WhichBank : string; MaxAttempts : integer);
var TheBank: string;
var TotalTries, PlayerColor: integer;
begin
if WhichBank = 'feb' then TheBank := 'fally east';
if WhichBank = 'fwb' then TheBank := 'fally west';
if WhichBank = 'vwb' then TheBank := 'varrock west';
if WhichBank = 'veb' then TheBank := 'varrock east';
if WhichBank = 'akb' then TheBank := 'al kharid';
if WhichBank = 'db' then TheBank := 'draynor';
if WhichBank = 'eb' then TheBank := 'edgeville';
TotalTries:=0
PlayerColor:=16711422

begin
repeat
ClickMMColor(PlayerColor);
Flag;
MMouse(259,170,278,185);
wait(200+random(200));
until(IsUpText('opti'));
begin
Mouse(259,170,278,185,False);
wait(400+random(400));
ChooseOption(x,y,'Follow');

repeat
case Random(3) of
0: TypeSend('can you take me to '+TheBank+' bank pls')
1: TypeSend('i need a free ride to '+TheBank+' bank pls')
2: TypeSend('can i have a free ride to '+TheBank+' bank please')
end;
Wait(500+random(500));
TotalTries := TotalTries+1;
until InChat('yep') or InChat('yup') or InChat('shure') or InChat('sure') or InChat('yeah') or InChat('yes') or InChat('ok') or (TotalTries=MaxAttempts)

if TotalTries=MaxAttempts then Writeln('Could not get a free ride, terminating script.');
TerminateScript;
end;
end;
end;[/PHP]

You need all this to succesfully run it:
[PHP]program CheesehunksProcedure;
{.include SRL\SRL.scar}
var OldLine, TheName, TheLine, NewLine: string;
//—————————————————————————-//
{*******************************************************************************
function InChat(Text : String) : Boolean;
By:WT-Fakawi
Description: Returns True if Text is in last Chat Message.
*******************************************************************************}
function InChat(Text : String) : Boolean;
begin
if (pos(Text, TheLine) <> 0) then
Result := True
else
Result := False;
end;

{******************************************************************************}

procedure GetChat;
begin
OldLine := TheLine;
TheName := lowercase(trim(GetTextAtEx(20, 415, 45, SmallChars, False, False, 0, 2, 0, 40, True, tr_NormalChars)));
TheLine := lowercase(trim(GetTextAtEx(20, 415, 45, SmallChars, False, False, 0, 2, 16711680, 40, False, tr_NormalChars)));
NewLine := TheLine;
end;

{******************************************************************************}

Procedure FollowPlayerToBank(WhichBank : string; MaxAttempts : integer);
var TheBank: string;
var TotalTries, PlayerColor: integer;
begin
if WhichBank = 'feb' then TheBank := 'fally east';
if WhichBank = 'fwb' then TheBank := 'fally west';
if WhichBank = 'vwb' then TheBank := 'varrock west';
if WhichBank = 'veb' then TheBank := 'varrock east';
if WhichBank = 'akb' then TheBank := 'al kharid';
if WhichBank = 'db' then TheBank := 'draynor';
if WhichBank = 'eb' then TheBank := 'edgeville';
TotalTries:=0
PlayerColor:=16711422

begin
repeat
ClickMMColor(PlayerColor);
Flag;
MMouse(259,170,278,185);
wait(200+random(200));
until(IsUpText('opti'));
begin
Mouse(259,170,278,185,False);
wait(400+random(400));
ChooseOption(x,y,'Follow');

repeat
case Random(3) of
0: TypeSend('can you take me to '+TheBank+' bank pls')
1: TypeSend('i need a free ride to '+TheBank+' bank pls')
2: TypeSend('can i have a free ride to '+TheBank+' bank please')
end;
Wait(500+random(500));
TotalTries := TotalTries+1;
until InChat('yep') or InChat('yup') or InChat('shure') or InChat('sure') or InChat('yeah') or InChat('yes') or InChat('ok') or (TotalTries=MaxAttempts)

if TotalTries=MaxAttempts then Writeln('Could not get a free ride, terminating script.');
TerminateScript;
end;
end;
end;

begin
SetupSRL;
FollowPlayerToBank('veb', 30);
end.[/PHP]

Thanks,
Cheesehunk.

phantombmx

2006-05-20 19:52:13

looks cool, this would be quite easy to do, except for finding out where your at that way you know when to stop.. you can ask them.. you could search for the text 'here ya go' or somethin like that.. looks cool ;)

Krazy_Meerkat

2006-05-20 20:26:50

Lol this would have to be the most annoying procedure ever. Good work doing it, but this is a very good way to get reported.

Cheesehunk

2006-05-20 20:33:11

From: Krazy_Meerkat
Lol this would have to be the most annoying procedure ever. Good work doing it, but this is a very good way to get reported.


Yep, I know:p

But if you did it right, it would be even better anti-ban because how often would anyone expect a macroer to interact with someone in this way?

I Pick Axes

2006-10-14 20:26:04

So what if I'm evil and I lead your script into the wildy and pk it? (Serious question.)

Mutant Squirrle

2006-10-14 23:25:18

lol yeah we could just maul your guy :spot:

Wizzup?

2006-10-15 03:45:00

From: I Pick Axes
So what if I'm evil and I lead your script into the wildy and pk it? (Serious question.)


SRL Logs out in wild.. FindNormalRandoms I thought.

I Pick Axes

2006-10-16 19:01:20

Scratch that then. We'll just lead you to the (insert dangerous monster) lair.

Cheesehunk

2006-10-16 19:19:38

Old thread. :p I could finish it now if I wanted..

Also, would it really matter? It would probably decrease your chances of being flagged, or unflag you. You might not get to a bank, but just don't use the procedure if you have valuable items with you. If its just a load of coal or something, it shouldn't matter. At least sometimes you will get to the bank.

Mr. Freeweed

2006-10-17 03:40:45

From: Cheesehunk
Old thread. :p I could finish it now if I wanted..

Also, would it really matter? It would probably decrease your chances of being flagged, or unflag you. You might not get to a bank, but just don't use the procedure if you have valuable items with you. If its just a load of coal or something, it shouldn't matter. At least sometimes you will get to the bank.


Sure your just looking for a freeride :stirthepot:

m0u53m4t

2006-12-08 18:07:23

I spose you could have this in a bone burier or summit, where it hitches a lift to the bank randomly if it has items like rubies/gold, then tele's back to lumby and starts again.