Page 1 of 2 12 LastLast
Results 1 to 25 of 30

Thread: Idle Your Script Users @ IRC

  1. #1
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default Idle Your Script Users @ IRC

    I wrote/edited this quickly. Do not comment on my standards, etc, please.

    SCAR Code:
    program new;

    const
      IRCPlz          = True;      // Have SCAR connect and idle at SRL's irc room?
      SRLChatPlz      = False;     // Join #SRL ?
      IRCNickname     = '';        // The nickname you want to connect to IRC on. Leave it at default if you do not know how to IRC. No spaces can be in it, and this nickname will be public on the IRC, irc.freenode.net #SRL
      Botchans        = '#SRL,#fakechannel'; // chans to join. seperate by a comma, no space.

    var Sock_fd:integer;

    procedure SendData(buf: string);
    begin
      AddToReport('=> ' + buf);
      SendConnectionData(Sock_fd, buf + #10 + #13);
    end;

    procedure scriptterminate;
    begin
    SendData('QUIT :Leaving');
    end;

    // IRC Stuff. Thanks to Yakman and LeeLokHin.
    var
      line: string;
      nicke, host, command, channel, args: string;

    type
      BufferedReader = record
      buffer: string;
      pos, len: Integer;
      usesocket: boolean;
    end;

    var   reader, lineparse: BufferedReader;

    procedure FillReaderBuffer(var reader: BufferedReader);
    var
      buf: string;
    begin
      try ReadConnectionData(Sock_fd, buf); except end;
      try reader.pos:= 1; except end;
      try reader.len:= Length(buf); except end;
      try reader.buffer:= buf; except end;
    end;


    function Connect:Integer;
    var botnick,botnic:string;
    begin
      case random(10) of
        0: botnick := 'm'+Trim(TrimNumbers(TrimOthers(ircnickname)))+inttostr(random(999)); // So if they are a nub at IRC, it will not allow their username to begin with a number.
        1: botnick := 's'+Trim(TrimNumbers(TrimOthers(ircnickname)))+inttostr(random(999));
        2: botnick := 'c'+Trim(TrimNumbers(TrimOthers(ircnickname)))+inttostr(random(999));
        3: botnick := 'f'+Trim(TrimNumbers(TrimOthers(ircnickname)))+inttostr(random(999));
        4: botnick := 'w'+Trim(TrimNumbers(TrimOthers(ircnickname)))+inttostr(random(999));
        5: botnick := 't'+Trim(TrimNumbers(TrimOthers(ircnickname)))+inttostr(random(999));
        6: botnick := 'g'+Trim(TrimNumbers(TrimOthers(ircnickname)))+inttostr(random(999));
        7: botnick := 'x'+Trim(TrimNumbers(TrimOthers(ircnickname)))+inttostr(random(999));
        8: botnick := 'z'+Trim(TrimNumbers(TrimOthers(ircnickname)))+inttostr(random(999));
        9: botnick := 'i'+Trim(TrimNumbers(TrimOthers(ircnickname)))+inttostr(random(999));
      end;

      Result := OpenConnection('irc.freenode.net', 8001, 15000);
      if(Result < 0)then
      begin
        Writeln('Error connecting');
        Exit;
      end;
      ClearReport;
      SendData('USER ' + BotNick + ' 8 * :' + BotNick);
      SendData('NICK '+botnick);
      SendData('MODE '+botnick+' +i');
      SendData('MODE '+botnick+' +E');
      SendData('MODE '+botnick+' +C');
      SendData('MODE '+botnick+' +I');
      SendData('MODE '+botnick+' +Q');
      if SRLChatPlz then
        SendData('JOIN '+botchans+',#SRL')
      else
        SendData('JOIN '+botchans);
    end;

    function ReadNextSegment(var reader: BufferedReader; c1, c2: char): string;
    var
      f: Integer;
    begin
      repeat
      for f:= reader.pos to reader.len do
        if(reader.buffer[f] = c1)or(reader.buffer[f] = c2)then
          begin
          Result:= Copy(reader.buffer, reader.pos, f - reader.pos);
          reader.pos:= f + 1; //skip the char your just read
          Exit;
          end;
      //Didnt find the char, fill the buffer from socket
      if(reader.usesocket)then
        FillReaderBuffer(reader)
      else
        Break;
      until(False);

      //if we get to here, it means we arnt using the socket, and the buffer is empty
      Result:= #0; //nul means error
    end;

    function ReadNextLine(var reader: BufferedReader): string;
    var
      line: string;
      c: char;
    begin
      try line:= ReadNextSegment(reader, #10, #13); except end;
      try
      c:= reader.buffer[reader.pos];
      except
      exit;
      end;
      //sometimes line breaks come in twos
      if(c = #13)or(c = #10)then
        reader.pos:= reader.pos + 1;
      Result:= line;
    end;

    function ReadRest(var reader: BufferedReader):string;
    begin
      Result:= Copy(reader.buffer, reader.pos, reader.len - reader.pos + 1);
      reader.pos:= reader.len;
    end;

    procedure ircwake; //keep alive the connection :D
    var watwat: Integer;
    begin
      SetTimeout(2500, 'ircwake');
      //marktime(watwat);

     // while timefrommark(watwat) < 200 do
      begin
        line:= ReadNextLine(reader);
        addtoreport('<= ' + line);

        lineparse.buffer:= line;
        lineparse.pos:= 1;
        lineparse.len:= Length(line);
        lineparse.usesocket:= false;

        if(line[1] = ':')then //we've got a nick and host
          begin
          lineparse.pos:= 2;
          nicke:= ReadNextSegment(lineparse, '!', #0);
          host:= ReadNextSegment(lineparse, ' ', #0);
          end;
        command:= ReadNextSegment(lineparse, ' ', #0);
        channel:= ReadNextSegment(lineparse, ' ', #0);
        args:= ReadRest(lineparse);

        //if(args <> '')then
          //if(args[1] = ':')then
            //delete(args, 1, 1);

        if(command = 'PING')then
          begin
          line[2] := 'O';
          SendData(line);
          end else
        if(command = 'KICK')then
          begin
          SendData('JOIN '+botchans);
          end else exit;
        end;
    end;


    procedure Main;
    begin
      Sock_fd := Connect;
      if(Sock_fd < 0)then
      begin
        Writeln('Failed to connect');
        Exit;
      end;
      reader.usesocket:= true;
      FillReaderBuffer(reader);

    //  marktime(watwat);

      ircwake;

      //FreeConnection(sock_fd);
    end;

    begin main; while true do wait(10) end.
    Put this into the script somewhere. Now, just call Main; before OR after SetupSRL;

    Now, your script users are idle in IRC, and it can give you a live-time status on how popular your script is, without SRL-Stats

    I doubt this will be added into SRL, but it would be cool. Would be nice for RemoteControl, etc.


    Enjoy, and comment.
    ~ Harry
    Last edited by Harry; 10-11-2010 at 01:31 AM.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  2. #2
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Its a shame you are trollin' with the #hy71194 crap.

    Good idea though.

    Also #srl will make for a lot of unneeded connections. Make a new channel maybe?
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  3. #3
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by Nava2 View Post
    Its a shame you are trollin' with the #hy71194 crap.

    Good idea though.
    Oh darn it, I forgot to remove that part out for the public release, thanks, edited.

    Also #srl will make for a lot of unneeded connections. Make a new channel maybe?
    Idlers are good, and do not harm the chan in any way
    Last edited by Harry; 05-11-2009 at 09:08 AM.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  4. #4
    Join Date
    May 2008
    Location
    127.0.0.1
    Posts
    705
    Mentioned
    1 Post(s)
    Quoted
    6 Post(s)

    Default

    /offtopic NAVATWO GET RID OF THAT AVATAR NOW
    <Wizzup> And he's a Christian
    <Wizzup> So he MUST be trusted
    ___________________________________________
    <Wizzup> she sounds like a dumb bitch

  5. #5
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    Quote Originally Posted by Rubix Cube View Post
    /offtopic NAVATWO GET RID OF THAT AVATAR NOW
    please do ... no offense :S

    and gj Harry.

    Though i don't use IRC lolz.

  6. #6
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by ~~Joker~~ View Post
    please do ... no offense :S

    and gj Harry.

    Though i don't use IRC lolz.
    Come on IRC more It is fun sometimes.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  7. #7
    Join Date
    Sep 2006
    Location
    Canada
    Posts
    1,124
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    So we put this in a script and it basically logs on to SRL's IRC channel and idles?

    Also pro avatar Nava2.

  8. #8
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by Capricorn View Post
    So we put this in a script and it basically logs on to SRL's IRC channel and idles?

    Also pro avatar Nava2.
    Yeah, the more idlers the better. Also, it complies with the SRL scripting regulations, as long as you put a boolean in your script to make them choose if they want to have it connect to IRC or not.

    And adblock nava2's avatar = win.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  9. #9
    Join Date
    Jan 2007
    Location
    Kansas
    Posts
    3,760
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Not harmful unless we max out the channel...

    This, finally, I find to actually be a cool and good idea. Just do it in a channel such as #SRL-ScriptStats or #SRL-Stats


  10. #10
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    There is no "channel peak" at freenode. ##ubuntu has over 1000 users in it.

    And thanks, but using a different channel would be easier for Jagex to ban IPs. Such as, no one except the autoers would join there, making little denyability against them.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  11. #11
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Updated teh lolcode :3


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  12. #12
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Why is it good to have idlers?

    T~M

  13. #13
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  14. #14
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    It's to tell how many people are using your script.

  15. #15
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  16. #16
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Yes, I am hoping to expand it, so you can RC your army, etc.

    Updated it moar.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  17. #17
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    Quote Originally Posted by Harry View Post
    Yes, I am hoping to expand it, so you can RC your army, etc.
    That is actually genius, then do the normal !action <action> and it will effect the script.

    Good job.

  18. #18
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by Richard View Post
    That is actually genius, then do the normal !action <action> and it will effect the script.

    Good job.
    Thanks, glad someone likes this idea


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  19. #19
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  20. #20
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Glad you like


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  21. #21
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  22. #22
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    Harry, I really like the idea behind this.

    If you expand it/make it somewhat like an alternative to RC, I'll make it an include in the \misc folder.

  23. #23
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by EvilChicken! View Post
    Harry, I really like the idea behind this.

    If you expand it/make it somewhat like an alternative to RC, I'll make it an include in the \misc folder.
    Well, all you would need to do would be to read the command behind it, then act on the command.

    For example, if args = 'SUPER-SECRET-COMMAND' then ..

    etc.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  24. #24
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    I know.
    I'm just too busy to finish your work atm.

    And, could this be relevant?

  25. #25
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Nah, RScript is just a bot program, for commands like !ge <item>, etc. They do not macro RS.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

Page 1 of 2 12 LastLast

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
  •