Results 1 to 4 of 4

Thread: [beginner] Script Help

  1. #1
    Join Date
    Dec 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default [beginner] Script Help

    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.



    Code:
    program new;
    {$DEFINE SMART} 
    {$i srl-6/srl.simba}
    
    begin
      clearDebug();
      setupSRL();
      begin
      players
    end.
    
    begin
    Repeat
      writeLn ('started!');
      Wait(2500+Random(2500));
      if chatBox.findTextOnLines(['!Runeclan'], [1..5]) then
      TypeSendEx('//Yruenclanmsg here1 ',True);
      Wait(200+Random(300));
      TypeSendEx('//runeclanmsg here2',True);
      Wait(30000+Random(30000));
    
    until(false)
    if not (LoggedIn) then
    LoginPlayer;
     writeLn ('User logged out; relogged in');
    end.
    Thank you so much!!!

  2. #2
    Join Date
    Dec 2011
    Posts
    2,147
    Mentioned
    221 Post(s)
    Quoted
    1068 Post(s)

    Default

    Quote Originally Posted by the_overseer View Post
    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.

  3. #3
    Join Date
    Dec 2011
    Posts
    2,147
    Mentioned
    221 Post(s)
    Quoted
    1068 Post(s)

    Default

    Quote Originally Posted by the_overseer View Post
    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
      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;
    end.

    Not sure the exact logic you are going for, I took a guess when I cleaned it up. Some more stuff needs to be added I reckon (logging in for the first time, failsafes, etc.) before this works well.
    Last edited by Clarity; 08-10-2017 at 09:53 PM.

  4. #4
    Join Date
    Dec 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Clarity View Post
    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
      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;
    end.

    Not sure the exact logic you are going for, I took a guess when I cleaned it up. Some more stuff needs to be added I reckon (logging in for the first time, failsafes, etc.) before this works well.
    Thank you, I'll look for the login snippet and try it out again. I really appreciate you describing the changes. Cheers

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •