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:
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.
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.