Using SRL In Your Script

Discussion in 'Archives' started by WhoCares357, Apr 4, 2007.

Using SRL In Your Script
  1. Unread #1 - Apr 4, 2007 at 7:35 PM
  2. WhoCares357
    Joined:
    Jan 21, 2007
    Posts:
    608
    Referrals:
    1
    Sythe Gold:
    0

    WhoCares357 Forum Addict

    Using SRL In Your Script

    Using SRL In Your Script
    by WhoCares357



    Table of Contents

    <Intro>
    <Including SRL>
    <Most Used Functions>
    <Anti-Randoms>



    <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:

    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>


    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:

    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.

    ---
    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:

    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.

    ---
    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).

    Code:
    TypeSend(‘I love SRL.’);
    Use TypeSend instead of SendKeys. It will make auto-typing undetectable.

    ---
    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 (Friend’s List). It keeps going right until number 13 (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 = LogOut (See Login.scar)
    GameTab 11 = Tools
    GameTab 12 = Run/Emotes
    GameTab 13 = Music
    Code:
    GameTab(2);
    This will click on the stats tab.

    ---
    Code:
    SetFightMode(FightMode);
    This function sets the Fight Mode to the number you tell it.

    Code:
    1   2
    3   4
    Put 1 for the fight mode in the upper left hand corner. 2 for top right corner. 3 for bottom left. 4 for bottom right.

    Code:
    SetFightMode(2);
    Will set the fight mode to the one in the top right corner.

    ---
    Code:
    SetRun(Run);
    Sets the run option true or false (on or off).

    Code:
    SetRun(true);
    That will turn on run.

    ---
    Code:
    OpenBank;
    This command simply opens the Bank Screen.

    ---
    Code:
    DepositAll;
    If it finds the Bank Screen open, it deposits everything in your inventory.

    ---
    Code:
    CloseBank:
    Closes the Bank Screen.

    ---
    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
    Code:
    MakeCompass(‘n’);
    Makes the compass (map) face north.

    ---
    Code:
    PerfectNorth;
    This command makes Scar spin the screen until it’s perfectly faced north. This one takes a bit longer than MakeCompass command.

    ---
    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.

    Code:
    UseItem(4);
    This will click the fourth slot (upper right slot).

    ---
    Code:
    DragItem(inv1, inv2);
    This command moves an item from one slot to another.

    Code:
    DragItem(1, 28);
    This would make Scar the item in Inventory slot 1 to Inventory slot 28.

    ---
    Code:
    InventoryFull;
    Checks if the Inventory is full.

    Code:
    if InventoryFull = true then
    //do whatever
    ---
    Code:
    InvEmpty;
    Checks if the Inventory is Empty.

    Code:
    if InvEmpty = true then
    //do whatever
    ---
    Code:
    CountItemColor(Color);
    This will count the amount of items in the Inventory with the given color number.

    Code:
    if CountItemColor(1251123) < 10 then
    //do whatever
    ---
    Code:
    DropItem(Item);
    Drops the item in the indicated slot number.

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

    ---
    Code:
    DropAll;
    Drops everything in your inventory.

    ---
    Code:
    DropTo(Slot1, Slot2);
    This command drops everything from the first Slot number you indicate to the Second slot number you indicate.

    Code:
    DropTo(5, 10);
    This example will drop everything from the fifth Slot to the tenth Slot.

    ---
    Code:
    TimeRunning;
    This function finds the amount of time the script has been running. This is useful in progress reports.

    Code:
    WriteLn(‘Time since start: ‘ + TimeRunning);
    This would WriteLn the amount of time the script has been running.

    ---
    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.).

    Code:
    if FindColorSpiral(x, y, Color, x1, y1, x2, y2) then
    MMouse(x, y, 1, 1);
    if GetUpText = ‘ock’ then
    Mouse(x, y, 1, 1, true);
    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.

    ---
    Code:
    PopUp(Option)
    This function is very useful. After you right click an item, use this function to click a specific option.

    Code:
    Mouse(x, y, 1, 1, false);
    Wait(100);
    PopUp(‘Open Bank’);
    There are many more functions, but these are the most useful/used.




    <Anti-Randoms>

    SRL has many anti-random functions. I will show you a few most common ones. You will have to search yourself for the more complicated ones.

    I’ll start with an example of a anti-random procedure.

    Code:
    procedure AntiRandom;
    begin
      FindTalk; //looks for a few letters from characters name (Nick) for randoms
      FindNormalRandoms; //looks for normal randoms and solves (mime, plant, etc.)
      FindLamp(‘mining’); //if finds the lamp, presses the skill (for xp)
       if FindFight then //if finds that you’re in a fight
        begin
         RunAwayDirection(‘n’); //runs north (s, w, e)
         Wait(10000+random(2000)); //waits
         RunBack; //runs back
        end;
    end;
    The tags by each anti-random function describe the anti-random function (Sorry, I got a bit lazy here).


    I hope this helped you. I might add on some mutli-character instructions later.
     
< Create Your Own Commands | Unmatched Beginner's Guide to Scripting Scar (Hands On) >

Users viewing this thread
1 guest


 
 
Adblock breaks this site