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 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 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.
---
This is a child of the SendKeys command. TypeSend, however, actually types the text as if it were a human (letter by letter).
Use TypeSend instead of SendKeys. It will make auto-typing undetectable.
---
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
This will click on the stats tab.
---
Sets the run option true or false (on or off).
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.
---
If it finds the Bank Screen open, it deposits everything in your inventory.
---
Closes the Bank Screen.
---
This spins the map until the Compass points to the direction you say.
Code:
n = North
s = South
e = East
w = West
Makes the compass (map) face north.
---
This command makes Scar spin the screen until it's perfectly faced north. This one takes a bit longer than MakeCompass command.
---
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.
This will click the fourth slot (upper right slot).
---
This command moves an item from one slot to another.
This would make Scar the item in Inventory slot 1 to Inventory slot 28.
---
Checks if the Inventory is full.
SCAR Code:
if InventoryFull = true then
//do whatever
---
Checks if the Inventory is Empty.
SCAR Code:
if InvEmpty = true then
//do whatever
---
This will count the amount of items in the Inventory with the given color number.
SCAR Code:
if CountItemColor(1251123) < 10 then
//do whatever
---
Drops the item in the indicated slot number.
That will drop the item in slot number 5 (row 2 column 1).
---
Drops everything in your inventory.
---
This command drops everything from the first Slot number you indicate to the Second slot number you indicate.
This example will drop everything from the fifth Slot to the tenth Slot.
---
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.
---
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.