Results 1 to 8 of 8

Thread: iCode's Very 1st Script!

  1. #1
    Join Date
    Jul 2013
    Posts
    91
    Mentioned
    0 Post(s)
    Quoted
    44 Post(s)

    Red face iCode's Very 1st Script!

    I have just started scripting and I decided to script a few private server bots just to start getting used to scripting and these are the few I just created:


    My RSPS Magic Log Cutter-
    *This script just cuts magic logs atm, I am trying to figure out how to implement banking and/or dropping logs, as well as fixing the timing so it doesn't just keep clicking the tree (which on some rsps's stops you from chopping the tree)
    Code:
    program RSPSCutter;
    {$i srl/srl.simba}
    
    const
      LOGS = 100;
    
    Procedure ClickTree;
    var
      X,Y:Integer;
    begin
    repeat
      if FindColorTolerance(X, Y, 14678264, 1, 5, 760, 480, 1) or
      FindColorTolerance(X, Y, 12187896, 1, 5, 760, 480, 1)then
      begin
          mmouse(x, y,1,1);
          wait(250);
          ClickMouse(X, Y, mouse_Left)
          wait(10000+random(5000));
      end;
    until (LOGS > 100);
    end;
    Begin
    SetupSRL;
    MouseSpeed := 15;
    ClickTree;
    end.
    My Login Code:
    *This script will login to a few different rsps's and you can change the click coords to customize for any server login screen. I can then put this as a procedure at the beginning of any of my scripts as a login feature hopefully.
    **Credits to hoodz for base
    Code:
    program iCodeLogin;
    
    {$I srl/srl.simba}
    
    var
      X,Y:Integer;
    
    const
    
    USERNAME = 'Username';
    PASSWORD = 'password';
    
    function IsLoggedIn: boolean;
    begin
    if findcolortolerance(x, y, 1448008, 494, 451, 611, 522, 15) then
    begin
    result := true
    end
    else
    begin
    result := false
    end;
    end;
    
    procedure LoggingIn;
    begin
      Wait(200);
      movemouse(659, 313);
      writeln('entering username');
      Wait(200);
      clickmouse(x, y, mouse_left);
      count := 0;
      repeat
        Inc(count);
        PressKey(VK_Back);
      until count > 25;
      Wait(250);
      sendkeys(USERNAME, 0, 0);
      Wait(1000);
      writeln('entering password');
      movemouse(650, 269);
      Wait(200);
      clickmouse(x, y, Mouse_left);
      Wait(200);
      count := 0;
      repeat
        PressKey(VK_Back);
        Inc(count);
      until count > 25
      sendkeys(PASSWORD, 50, 25);
      writeln('logging in');
      Wait(1000);
      movemouse(576, 396);
      Wait(1000);
      ClickMouse(x, y, mouse_left);
      Wait(8000);
      writeln('logged in!')
    end;
    Last edited by icode; 08-08-2013 at 04:27 PM.

  2. #2
    Join Date
    Feb 2012
    Location
    DON'T PM ME ASKING FOR STUFF
    Posts
    2,170
    Mentioned
    38 Post(s)
    Quoted
    423 Post(s)

  3. #3
    Join Date
    Jul 2013
    Posts
    91
    Mentioned
    0 Post(s)
    Quoted
    44 Post(s)

    Default

    Quote Originally Posted by xtrapsp View Post
    Congrats on your first script.

    Have a read of these
    Thank you! That first link will help me to clean up my scripts and make them readable.

  4. #4
    Join Date
    Sep 2012
    Location
    Netherlands
    Posts
    2,752
    Mentioned
    193 Post(s)
    Quoted
    1468 Post(s)

    Default

    Uh i wrote IsLoggedIn and LoggingIn ?

  5. #5
    Join Date
    Jul 2013
    Posts
    91
    Mentioned
    0 Post(s)
    Quoted
    44 Post(s)

    Default

    Quote Originally Posted by hoodz View Post
    Uh i wrote IsLoggedIn and LoggingIn ?
    I gave you credit.

  6. #6
    Join Date
    Sep 2012
    Location
    Netherlands
    Posts
    2,752
    Mentioned
    193 Post(s)
    Quoted
    1468 Post(s)

    Default

    Quote Originally Posted by icode View Post
    I gave you credit.
    Alright

  7. #7
    Join Date
    Jul 2013
    Posts
    91
    Mentioned
    0 Post(s)
    Quoted
    44 Post(s)

    Default

    Quote Originally Posted by hoodz View Post
    Alright
    Yup, also would you know how to make my woodcutter drop logs and then repeat? so it cuts and powerchops? I can't seem to get it to work right. :/

    Another thing is it clicks the tree again after a little bit and it stops me from chopping.

  8. #8
    Join Date
    Sep 2012
    Location
    Netherlands
    Posts
    2,752
    Mentioned
    193 Post(s)
    Quoted
    1468 Post(s)

    Default

    Quote Originally Posted by icode View Post
    Yup, also would you know how to make my woodcutter drop logs and then repeat? so it cuts and powerchops? I can't seem to get it to work right. :/

    Another thing is it clicks the tree again after a little bit and it stops me from chopping.
    Pixelshift: how many pixels change in a certain box. (If your character makes an animation it should turn into a higher number)

    For dropping logs you should use dtm. If it finds the dtm of your log then it should drop it (move mouse to it, rightclick, a little sleep, than it moves the mouse a little bit down (to drop) than it clicks.
    (You dont use this on real rs since you click always on the same coordinate!)

    If it doesnt find the dtm then exit the procedure

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
  •