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

Thread: Using SRL In Your Script

  1. #1
    Join Date
    Dec 2006
    Location
    SC
    Posts
    692
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Using SRL In Your Script

    Using SRL In Your Script
    by WhoCares357



    Table of Contents

    <Intro>
    <Including SRL>
    <Most Used Functions>



    <Intro>

    To say it in big-people words: I will bestow my knowledge of incorporating SRL functions upon thou. The title says it all. I will show you a few functions that you can use with the SRL, as well as some anti-randoms. If you have already perfected yourself in using Scar functions to auto in RuneScape, this will help you.




    <Including SRL>

    Before you use any of these following functions and procedures, you must learn how to tell Scar to use the include. This is very simple:

    SCAR Code:
    program ILoveSRL;

    {.include SRL\SRL.Scar}

    begin
      SetupSRL; //Must have this as the first thing in the main loop
    //Rest of script
    end.

    Just place {.include SRL\SRL.Scar} after the program Name. Another thing you always need is the command SetupSRL in the main loop. This will trigger the variables and other things needed for the functions and commands you will use. Always have SetupSRL as the first command in your main loop if you are using SRL.



    <Most Used Functions>


    SCAR Code:
    MMouse(x, y, xrandom, yrandom);

    This procedure simply moves the mouse to x, y. xrandom and yrandom are for randomizing the mouse stop area. For instance, if I had:

    SCAR Code:
    MMouse(0, 0, 2, 2);

    Scar would move the mouse to anywhere from 0-1 for the x coordinate and 0-1 for the y coordinate.

    ---
    SCAR Code:
    Mouse(x, y, xrandom, yrandom, button);

    This command is similar to MMouse, except that it actually clicks the mouse. An example of this would be:

    SCAR Code:
    Mouse(0, 0, 1, 1, true);

    Scar will click 0-1 for the x coordinate and 0-1 for the y coordinate. It will click the left mouse button.
    Code:
    true – left mouse button
    false – right mouse button
    MMouse and Mouse are pretty undetectable by RuneScape. Use them instead of MoveMouse and ClickMouse.

    ---
    SCAR Code:
    TypeSend(text);

    This is a child of the SendKeys command. TypeSend, however, actually types the text as if it were a human (letter by letter).

    SCAR Code:
    TypeSend('I love SRL.');

    Use TypeSend instead of SendKeys. It will make auto-typing undetectable.

    ---
    SCAR Code:
    GameTab(GameTab);

    This function clicks the tab you tell it to. Tab number 1 is the tab in the uppermost left corner (Combat Tab). The tab numbers increase by 1 each time you go over to the right. (2=Stats). Once you reach the end (Magic Book) the next number is the one in the lower left corner (Clan Chat). It keeps going right until number 15 (last tab number).

    Taken directly from the SRL Script:

    Code:
    // * GameTab 1  = Fightmode
    // * GameTab 2  = Statistic
    // * GameTab 3  = Quest
    // * GameTab 4  = Inventory (see Inventory.scar)
    // * GameTab 5  = Wield
    // * GameTab 6  = Prayer
    // * GameTab 7  = Mage
    // * GameTab 8  = Add Friend
    // * GameTab 9  = Del Friend
    // * GameTab 10 = ClanChat
    // * GameTab 11 = Run/Tools
    // * GameTab 12 = Emotes
    // * GameTab 13 = Music
    // * GameTab 14 = LogOut
    // * GameTab 15 = Summoning
    SCAR Code:
    GameTab(2);

    This will click on the stats tab.

    ---
    SCAR Code:
    SetRun(Run);

    Sets the run option true or false (on or off).

    SCAR Code:
    SetRun(true);

    That will turn on run.

    ---
    SCAR Code:
    OpenBank(WhichBank, ChangeCompass, ChangeAngle);

    This command simply opens the Bank Screen. You need to set three options. The first is which bank. Here is the list from the SRL file (note these may have changed since I last updated the tutorial):

    'feb' (Falador East Bank)
    'fwb' (Falador West Bank)
    'veb' (Varrock East Bank)
    'vwb' (Varrock West Bank)
    'db' (Draynor Bank)
    'akb' (Al-Kharid Bank)
    'lb' (Lumbridge Bank)
    As for the other two options, I'd recommend that you set both to true. It makes it easier to find the bank screen.

    ---
    SCAR Code:
    DepositAll;

    If it finds the Bank Screen open, it deposits everything in your inventory.

    ---
    SCAR Code:
    CloseBank:

    Closes the Bank Screen.

    ---
    SCAR Code:
    MakeCompass(Direction);

    This spins the map until the Compass points to the direction you say.

    Code:
    n = North
    s = South
    e = East
    w = West
    SCAR Code:
    MakeCompass('n');

    Makes the compass (map) face north.

    ---
    SCAR Code:
    PerfectNorth;

    This command makes Scar spin the screen until it's perfectly faced north. This one takes a bit longer than MakeCompass command.

    ---
    SCAR Code:
    UseItem(Inventory);

    This will left click on the item specified. The items are numbered by slots. Top left slot would be 1 and it would go to the right until the last one in the row. Then it will count from the left of the next row.

    SCAR Code:
    UseItem(4);

    This will click the fourth slot (upper right slot).

    ---
    SCAR Code:
    DragItem(inv1, inv2);

    This command moves an item from one slot to another.

    SCAR Code:
    DragItem(1, 28);

    This would make Scar the item in Inventory slot 1 to Inventory slot 28.

    ---
    SCAR Code:
    InventoryFull;

    Checks if the Inventory is full.

    SCAR Code:
    if InventoryFull = true then
      //do whatever

    ---
    SCAR Code:
    InvEmpty;

    Checks if the Inventory is Empty.

    SCAR Code:
    if InvEmpty = true then
      //do whatever

    ---
    SCAR Code:
    CountItemColor(Color);

    This will count the amount of items in the Inventory with the given color number.

    SCAR Code:
    if CountItemColor(1251123) < 10 then
      //do whatever

    ---
    SCAR Code:
    DropItem(Item);

    Drops the item in the indicated slot number.

    SCAR Code:
    DropItem(5);

    That will drop the item in slot number 5 (row 2 column 1).

    ---
    SCAR Code:
    DropAll;

    Drops everything in your inventory.

    ---
    SCAR Code:
    DropTo(Slot1, Slot2);

    This command drops everything from the first Slot number you indicate to the Second slot number you indicate.

    SCAR Code:
    DropTo(5, 10);

    This example will drop everything from the fifth Slot to the tenth Slot.

    ---
    SCAR Code:
    TimeRunning;

    This function finds the amount of time the script has been running. This is useful in progress reports.

    SCAR Code:
    WriteLn('Time since start: ' + TimeRunning);

    This would WriteLn the amount of time the script has been running.

    ---
    SCAR Code:
    GetUpText;

    This procedure checks the words in the upper left corner of the screen. This is useful for double-checking that what you are about to click is a rock (tree, monster, etc.).

    SCAR Code:
    if FindColorSpiral(x, y, Color, x1, y1, x2, y2) then
    begin
      MMouse(x, y, 1, 1);
      if GetUpText = 'ock' then
        Mouse(x, y, 1, 1, true);
    end;

    This example would first look for a color spiral. If it fond the color spiral it would move the mouse there. Scar would then check if the text in the upper left corner of the screen has the letters 'ock' in it. If it does, it will click the color spiral.



    There are many more functions, but these are the most useful/used.

  2. #2
    Join Date
    Mar 2007
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    good tut for the beginner. also its best if you add how to do the multi players soon because that is like one of the main things about srl. other then that great tut

  3. #3
    Join Date
    Mar 2007
    Posts
    69
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thank you so much! i really needed something like this. Now i can attempt a very simple script. Thank you very much.

  4. #4
    Join Date
    Apr 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    this really helps alot, i been following all your tuts and there all awsome!

  5. #5
    Join Date
    Jun 2006
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for the great tut, really helped understand the SRL Commands without opening the files
    http://www.fenjer.com/adnan/SRL/23/4...and%20Scar.png

    One of te old members from Kaitnieks

  6. #6
    Join Date
    Apr 2007
    Location
    Finland
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

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

    Default

    THANK YOU! Very easy + simple tut for me ++rep!


    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!

  8. #8
    Join Date
    Dec 2006
    Location
    SC
    Posts
    692
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for the comments guys. I made an error on one of the commands. Fixed now .

  9. #9
    Join Date
    Apr 2007
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank you very much i have not been able to use srl in my scripts for the simple fact that i have not understood it. Again thank you so very much.
    I'm Just a Noob Trying to Become Good
    http://www.fenjer.com/adnan/SRLStats/99776.png

    I have been a Scripter for 6 years...but i have never been a GOOD Scripter...

  10. #10
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Tnx this is just what i needed for my script

  11. #11
    Join Date
    May 2007
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i think its awesome, i learned some stuff here n there, although open bank dusnt work too well -.-

  12. #12
    Join Date
    Jun 2007
    Posts
    8
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for taking the time to do this.

    Having lurked in the forums for a couple of weeks it would appear I am already beyond retirement age for tinkering with SCAR and SRL and should not even think about starting. Bah, humbug I say.

    Having looked through some good scripts and digested some good tutorials (like this one) curiosity has got the better of me and I am ready to spend the odd lunch hour whipping up something useful for my son instead of giving away more unpaid time to the company

  13. #13
    Join Date
    Sep 2007
    Location
    Greece
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Excelent Just What I Wanted !!! Should Link It To Your Other Guides Too . Took Me A While To Find It

  14. #14
    Join Date
    Sep 2007
    Posts
    415
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    this guide did teach me what i was doing wrong on my other script, but i still don't know how to use the "skill" SRL's =(

  15. #15
    Join Date
    Dec 2006
    Location
    SC
    Posts
    692
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by drizzt View Post
    this guide did teach me what i was doing wrong on my other script, but i still don't know how to use the "skill" SRL's =(
    Open Scar and go to C:\Program Files\Scar (version)\includes\SRL\SRL\SRL. Check through the different files (especially the ones in the folder "core") and on the top of each .scar file, they list all the scar functions/procedures. To figure out what the function/procedure does, go down to the procedure name and it will have a description next to it.

  16. #16
    Join Date
    Mar 2007
    Posts
    1,223
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    thanks this gona help me a lot!

  17. #17
    Join Date
    Sep 2007
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lol dont quite understand, but then again im not that smart

  18. #18
    Join Date
    Oct 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank you! I am about to get to work on some of my first scripts (auto-fletcher and auto-stringer) and I needed to learn some of this stuff to help get me going! Thanks!

  19. #19
    Join Date
    Aug 2007
    Posts
    42
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    great guide man

  20. #20
    Join Date
    Jun 2007
    Location
    NSW, Australia.
    Posts
    541
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice tut, ++ rep.
    Quote Originally Posted by RAM View Post
    I sam sofa king wee todd did ! ~RAM
    My SRL Army Blog.


  21. #21
    Join Date
    Aug 2007
    Posts
    327
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nice guide, i am well on my way to making my first powerminer now

  22. #22
    Join Date
    Apr 2007
    Location
    Adelaide, Australia
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Just what I needed I didn't even know half of those SRL functions lol. ++rep
    Are YOU into things to do with gaming consoles, glitches, mods or just meeting new people?
    Join Se7ensins and learn how to do the above!
    http://www.fenjer.com/adnan/SRLStats/824.png

  23. #23
    Join Date
    Feb 2008
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    very nice and very handy!!!
    +rep for you

  24. #24
    Join Date
    Jun 2007
    Location
    Liverpool ,Nsw,Australia
    Posts
    740
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nice tut someone should sticky rep++
    Quote Originally Posted by Darkmage View Post
    I got 2 questions'
    #1. When i run the script will it automatically pick up the mouse and move?

  25. #25
    Join Date
    Oct 2006
    Posts
    1,190
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    wow gj Nice tut helped me understand the SRL Commands



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
  •