Page 5 of 5 FirstFirst ... 345
Results 101 to 120 of 120

Thread: Simplistic Beginners Guide To RS3 Scripting

  1. #101
    Join Date
    Jul 2015
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    I hope I'm not grave digging. This is a crazy amazing guide to writing scripts for RS3. I am actually interested in writing RSPS scripts, but this still provides a great base for me to start something. This helped me understand the structure of the pascal language, which is pretty cool and resembles modern languages. Can't w8 to finish reading this guide, then your AIO, and then hopefully setting up an environment where I can run a RSPS client and bot on it :]

  2. #102
    Join Date
    Oct 2007
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Sweet tutorial. Gonna help me a bunch when I am going to get back to scripting in the future .
    Woot woot.

  3. #103
    Join Date
    May 2013
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    24 Post(s)

    Default

    program test;

    procedure practiceBox();
    var
    settingsButton: TBox; // Declare TBox variable
    begin
    settingsButton := intToBox(735, 80, 750, 100);
    mouseBox(settingsButton, MOUSE_LEFT);
    wait(4000);
    mouseBox(intToBox(630, 105, 640, 115), MOUSE_LEFT); // Notice how I made the box inside the mouseBox function
    end;

    begin
    practiceBox();
    end.


    Error: Unknown declaration "mouseBox" at line 8
    Compiling failed.
    __________________________________________________ __________________________________________________ ________________________________
    tried this too no good and i took out the MOUSE_MOVE because it will say Unknown declaration "MOUSE_MOVE"

    program new;

    procedure practiceMouse();
    begin
    movemouse(200, 200, 5, 5); <<<<< line 5
    wait(3000);
    movemouse(50, 50);
    wait(3000);
    writeLn('We just right clicked');
    wait(3000);
    movemouse(300, 30);
    end;

    begin
    practiceMouse();
    end

    Error: Too many parameters found at line 5
    Compiling failed

  4. #104
    Join Date
    Aug 2014
    Location
    Australia
    Posts
    932
    Mentioned
    53 Post(s)
    Quoted
    495 Post(s)

    Default

    Quote Originally Posted by maxlvs View Post
    -snip-
    Firstly, please use [simba] tags around code, like this:

    [simba]YOUR CODE HERE![*simba]

    Replace the asterisk (*) with a forward slash (/).

    Secondly, you need to include the SRL-6 library, like so:

    Simba Code:
    program example;
    {$I SRL-6/SRL.simba}

    // code here

    begin
      // code here
    end.

    This is demonstrated in The Mayor's tutorial with the following snippet:

    Simba Code:
    program new;
    {$DEFINE SMART}
    {$I SRL-6/SRL.simba}

    procedure practiceMouse();
    begin
      mouse(200, 200, MOUSE_MOVE);
      wait(3000);
      mouse(50, 50, MOUSE_MOVE);
      wait(3000);
      fastClick(MOUSE_RIGHT);
      writeLn('We just right clicked');
      wait(3000);
      mouse(300, 30, MOUSE_MOVE);
    end;

    begin
      clearDebug();
      setupSRL();
      practiceMouse();
    end.

    I suggest you carefully read the tutorial and follow it step by step, ensuring that your code looks just like The Mayor's code.

    Good luck!
    Last edited by Incurable; 10-29-2015 at 06:02 AM.



    New to scripting? Procedures & Functions for Beginners
    Do you use your computer at night? Just get f.lux

  5. #105
    Join Date
    May 2013
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    24 Post(s)

    Default

    that wont work

    this pops up in a new tab


    Error: Duplicate declaration "mbOk" at line 30
    Compiling failed.


    (*
    Globals
    =======

    The globals file holds any variables used throughout multiple files in SRL.

    The source for this file can be found `here <https://github.com/SRL/SRL-6/blob/master/lib/core/globals.simba>`_.

    *)

    {$f-}

    const
    VK_ENTER = {$IFDEF LINUX}10{$ELSE}VK_RETURN{$ENDIF};

    (*
    var MessageBox
    ~~~~~~~~~~~~~~

    Variables that store Simba's MessageBox function parameters. Makes it easier to
    use rather than just remembering values.

    Example:

    .. code-block:: pascal

    MessageBox('Test!', 'Test', mbOkCancel);
    *)
    var
    mbOk = 0;
    mbOkCancel = 1;
    mbAbortRetryIgnore = 2;
    mbYesNoCancel = 3;
    mbYesNo = 4;
    mbCancelRetry = 5;

    mrYes = 6;
    mrNo = 7;

    (*
    var Colors
    ~~~~~~~~~~

    Convenient colors for scripters to use. Used mainly for SMART debugging.

    Example:

    .. code-block:: pascal

    smartImage.drawBox(minimap.getBounds(), false, clFuchsia);
    *)
    var
    clWhite = 16777215;
    clBlack = 0;
    clRed = 255;
    clGreen = 32768;
    clBlue = 16711680;
    clPurple = 8388736;
    clYellow = 65535;
    clAqua = 16776960;
    clOrange = 26367;
    clFuchsia = 16711935;
    clTeal = 8421376;
    clNavy = 8388608;
    clGray = 8421504;
    clLime = 65280;
    clMaroon = 128;
    clSilver = 12632256;
    clPink = 11772650;

    (*
    Constant: Events
    ~~~~~~~~~~~~~~~~

    Integer constants of all the events called througout SRL.

    Example:

    .. code-block:: pascal

    SRL_Events[RS_UPDATE] := @SixHourFix;

    *)
    const
    EVENT_COUNT = 5;
    EVENT_RS_UPDATE = 0;
    EVENT_LOGOUT = 1;
    EVENT_LOGIN = 2;
    EVENT_PLAYER_NEXT = 3;
    EVENT_ANTIBAN = 4;

    (*
    Variable: SRL_Events
    ~~~~~~~~~~~~~~~~~~~~

    Events that are called throuhgout SRL. These events can be set in any script
    so custom procedures can be called in certain areas of SRL.

    Example:

    .. code-block:: pascal

    SRL_Events[RS_UPDATE] := reloadCurrentClient;

    *)
    var
    SRL_Events: array[0..(EVENT_COUNT - 1)] of procedure;



    Error: Duplicate declaration "mbOk" at line 30
    Compiling failed.
    Last edited by maxlvs; 10-29-2015 at 06:30 AM.

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

  7. #107
    Join Date
    Aug 2014
    Location
    Australia
    Posts
    932
    Mentioned
    53 Post(s)
    Quoted
    495 Post(s)

    Default

    Quote Originally Posted by maxlvs View Post
    -snip-
    Again, please post the code in [simba] tags as I showed you. Also do as Clarity asked so that we can see what the problem is.



    New to scripting? Procedures & Functions for Beginners
    Do you use your computer at night? Just get f.lux

  8. #108
    Join Date
    May 2013
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    24 Post(s)

    Default

    see if i could talk to someone over skype there would not be such a problem i used the code that incurable posted

    program new;
    {$DEFINE SMART}
    {$I SRL-6/SRL.simba}

    procedure practiceMouse();
    begin
    mouse(200, 200, MOUSE_MOVE);
    wait(3000);
    mouse(50, 50, MOUSE_MOVE);
    wait(3000);
    fastClick(MOUSE_RIGHT);
    writeLn('We just right clicked');
    wait(3000);
    mouse(300, 30, MOUSE_MOVE);
    end;

    begin
    clearDebug();
    setupSRL();
    practiceMouse();
    end.

  9. #109
    Join Date
    May 2013
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    24 Post(s)

    Default

    see if i could talk to someone over skype there would not be such a problem i used the code that incurable posted

    program new;
    {$DEFINE SMART}
    {$I SRL-6/SRL.simba}

    procedure practiceMouse();
    begin
    mouse(200, 200, MOUSE_MOVE);
    wait(3000);
    mouse(50, 50, MOUSE_MOVE);
    wait(3000);
    fastClick(MOUSE_RIGHT);
    writeLn('We just right clicked');
    wait(3000);
    mouse(300, 30, MOUSE_MOVE);
    end;

    begin
    clearDebug();
    setupSRL();
    practiceMouse();
    end.


    and most of these guides are way outdated like you cant use mouse you have to use movemouse or clickmouse and you cant use

    this mouse(x, y, ranX, ranY, mouseAction); or
    this mouse(100, 100, 5, 5, MOUSE_MOVE) or
    this fastClick(MOUSE_LEFT); etc...

    other says unknown meaning of "MOUSE_MOVE" or to many parameters and highlights both of the 5's

    and the page messed up and when i clicked out of the page and i clicked back to edit my post but it posted another one
    Last edited by maxlvs; 10-29-2015 at 06:20 PM.

  10. #110
    Join Date
    Apr 2014
    Location
    United Kingdom
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    16 Post(s)

    Default

    Thanks for this amazing beginners guide! Really useful for someone that has never completed any coding before.

    Very helpful! It's great as well that you've explained every single phrase/piece of code you've written, really helps understand this 'new language'.

    However one thing I've noticed that hasn't truly been mentioned is the spacing. Is this for a visual understanding or does it have a technical purpose? Furthermore it took me a while to realise using TAB to shift the text won't work, has to actually be a space, they just move the text an equivalent distance which was originally confusing.

  11. #111
    Join Date
    Feb 2013
    Location
    The Boonies
    Posts
    203
    Mentioned
    9 Post(s)
    Quoted
    70 Post(s)

    Default

    Quote Originally Posted by TheMilkTree View Post
    Thanks for this amazing beginners guide! Really useful for someone that has never completed any coding before.

    Very helpful! It's great as well that you've explained every single phrase/piece of code you've written, really helps understand this 'new language'.

    However one thing I've noticed that hasn't truly been mentioned is the spacing. Is this for a visual understanding or does it have a technical purpose? Furthermore it took me a while to realise using TAB to shift the text won't work, has to actually be a space, they just move the text an equivalent distance which was originally confusing.
    When the code is compiled, it ignores any white space entirely. It's all visual (you could write an entire script on one line... but... please... don't)

    Bottom-line, standards and spacing and whatnot is to help readability, which is pretty crucial for us humans.

  12. #112
    Join Date
    Dec 2011
    Location
    GODKasi's cave.
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Thanks a lot Mayor, this literally saved me a couple of hours.

  13. #113
    Join Date
    Dec 2015
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    thank you for this, i cant wait to start scripting

  14. #114
    Join Date
    Oct 2016
    Posts
    19
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Looking forward to making my first script thanks for this.

  15. #115
    Join Date
    Apr 2014
    Location
    United Kingdom
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    16 Post(s)

    Default

    A lot of the OSRS guides are quite old now, so assuming you change the colours/locational stuff, how applicable is this to OS?

  16. #116
    Join Date
    Apr 2014
    Location
    United Kingdom
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    16 Post(s)

    Default

    After literally a year and a half i've finally made it through all of this guide! I'm a bit slow... Was very helpful indeed, understood so much. Thanks Mayor!

  17. #117
    Join Date
    Dec 2016
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Awesome, thx a lot for this!

  18. #118
    Join Date
    May 2017
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Hi is this still relevant?

  19. #119
    Join Date
    May 2017
    Location
    UK
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Thanks for this, really helped me get up and running in the world of simba :-)

  20. #120
    Join Date
    Feb 2018
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Hi guys I can't get the findObject function to work correctly - it just doesn't find the color and that boolean keeps returning a false. I used ACA remake from here.
    Here is my code:
    Code:
    program new;
    {$DEFINE SMART}
    {$I SRL-6/SRL.simba}
    
    procedure clickBansh();
    var
      x, y: integer; //we need to declare these variables since findObject outputs/requires these
    begin
      if mainscreen.findObject(x, y, 5467487, 11, ['anshee'], MOUSE_RIGHT) then
      begin
        chooseOption.select(['ttack Banshee']);
        wait(randomRange(4000,8000));
        clickBansh();
      end;
        clickBansh();
    end;
    
    begin
      clearDebug();
      setupSRL();
      clickBansh();
    end.
    end.
    here is the debug log:
    -- TRSMainScreen.findObject(): False
    -- TRSMainScreen.findObject()
    ---- No colors found

    this repeats.


    Oh yah - I wanted to use this to simply attack Banshees in the security stronghold.
    Last edited by hunterofagoodtime; 03-12-2018 at 05:05 PM.

Page 5 of 5 FirstFirst ... 345

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
  •