Originally Posted by
the_overseer
Hi, I wrote a script using the beginners guide but am having issues getting it to work properly. If anyone is willing to help, my script's only function is to search the RS3 chatbox for a predefined message (in this case, !Runeclan) and respond in my clan chat with a link to my clan Runeclan. I can't get this to work or even login and I'm not sure what I'm doing wrong. It compiles fine and runs until the login point. I'd be greatly appreciative if someone could look at this for me and help.
Thank you so much!!!
Commented:
Simba Code:
program new;
{$DEFINE SMART}
{$i srl-6/srl.simba}
begin
clearDebug();
setupSRL();
begin //delete, doesn't make sense, there's no matching end
players //not sure what this is, delete
end. //the end with a period is the last line of the script, should insert the loop + login failsafe before it
begin
Repeat
writeLn ('started!');
Wait(2500+Random(2500));
if chatBox.findTextOnLines(['!Runeclan'], [1..5]) then //maybe have it recognize alterations like !runeclan, !RuneClan, etc.
TypeSendEx('//Yruenclanmsg here1 ',True);
Wait(200+Random(300));
TypeSendEx('//runeclanmsg here2',True);
Wait(30000+Random(30000));
until(false) //until false means this loop repeats infinitely, the code after it will never execute
if not (LoggedIn) then
LoginPlayer;
writeLn ('User logged out; relogged in');
end.
Cleaned up:
Simba Code:
program new;
{$DEFINE SMART}
{$i srl-6/srl.simba}
begin
clearDebug();
setupSRL();
writeLn ('started!');
repeat
Wait(2500+Random(2500));
if chatBox.findTextOnLines(['!Runeclan'], [1..5]) then
begin
TypeSendEx('//Yruenclanmsg here1 ',True);
Wait(200+Random(300));
TypeSendEx('//runeclanmsg here2',True);
end;
Wait(30000+Random(30000));
if not (LoggedIn) then
begin
LoginPlayer;
writeLn ('User logged out; relogged in');
end;
until false; //until false means this loop repeats infinitely, the code after it will never execute
end.