Bam Bam
2007-04-25 12:47:50
Ive tested it and it worked well for me.
Shouldn't have many bugs if any, its a rather simple script.
Shouldn't have many bugs if any, its a rather simple script.
program FriendScript;
{.include SRL\SRL.SCAR}
const
StartPlayer = 0;
var
i: integer;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
CurrentPlayer := StartPlayer;
NumberOfPlayers(HowManyPlayers);
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;
function exists(Name: string): boolean;
begin
result := false; //Assumed failure
if(not(GetCurrentTab = 8))then
GameTab(8);
if(FindInventoryText(capitalize(Name)))then
begin
WriteLn('Player ' + Name ' is already on friends list!');
result := true;
end;
end;
procedure AddFriend(Name: string);
begin
if(not(loggedin))then
exit;
if(Exists)then
Exit;
if(not(Capitalize(Players[i].Name) = capitalize(Players[CurrentPlayer].Name)))then
begin
Mouse(590, 435, 20, 10, true);
while(not(FindText(x, y, 'add', UpChars, MCX1, MCY1, MCX2, MCY2)))do
WWait(250 + random(250));
TypeSend(Name);
end;
end;
begin
ActivateClient;
SetupSRL;
DeclarePlayers;
repeat
if(not(loggedin))then
LoginPlayer;
WWait(5000 + random(5000));
FindNormalRandoms;
for i := 0 to howmanyplayers - 1 do
begin
if(not(loggedin))then
break;
Wait(100);
Addfriend(Players[i].Name);
WWait(1000 + random(500));
end;
FindNormalRandoms;
NextPlayer(false);
until(not(loggedin))
end.