|
Squigglyo’s Scar FAQs
1. Gerneral
1.1. Q. Where can I download current ‘clean’ versions of Scar?
A. www.poonscape.com has a clean and current version.
1.2. Q. Why is the Scar icon a bulldozer?
A. Quote from Kaitnieks – ‘Why do with a shovel what you can do with a bulldozer’
1.3. Q. What does the ‘Open From Web’ button do?
A. That button will open a box that will load a list of free scripts from the internet. Just open it and then you can use the script.
*Note*Some computer networks cannot download these scripts
1.4. Q. How do I start and stop the script?
A. There are 2 buttons in scar that will do this. The ‘Play’ button is a green arrow and the ‘Stop’ button is a Red Square.
Also, the start a script using the keyboard press Ctrl + Alt + R and to stop it Ctrl + Alt + S. This will work even is the focus isn’t on Scar.
1.5. Q. How do I get a colour?
A. Next to the ‘Stop’ button there is a Colour Picker, either click this or press Ctrl + P and you will open the Colour Picker.
The colour picker is a rectangular shaped box. The numbers next to the word mouse are the coordinates of where the mouse currently is, the number next to the word colour is the colour underneath the mouse pointer and the square box is the actual colour you are looking at.
Once you click the mouse, scar will place all this information in the rectangular box at the bottom of scar.
Eg: Color Picked: 16777215 at (313,454)
The big number is the colour, simply copy that and paste it where you need it.
1.6. Q. How do I tell Scar where to auto?
A. Have Scar and the window you want to auto on both viewable. Then, drag the crosshair icon on scar (the icon that is most to the right) onto the window you are autoing on.
An error message may appear saying ‘Scar doesn’t work well with SUN JAVA VM….’ Ignore this, scar will still work the same.
1.7. Q. How can I see what line the script is up to while it’s going?
A. Scar has a feature called ‘Trace Script’, this will basically highlight each line as scar runs thru it. Although the script will still run at the same speed so it is hard to watch it perfectly.
1.8. Q. What is Silent Mouse?
A. If the ‘Silent Mouse’ option is on, whenever a script makes the mouse move and/or click, your mouse pointer will not actually move. This is highly detectable in RS 2, but was great for RS Classic, because you could run several autoing programs at once.
1.9. Q. Can I use Scar to change the title of a window?
A. You sure can. After telling scar which window you are autoing on, simply click on the ‘Client’ drop down bar and then ‘Specify Client Title…’ A box will open and you need to type in what you want the title to be. Once you’ve typed it in, press to ‘Ok’ button and your title has been changed.
2. Scripting
2.1. Q. How do I include files into the script I am making?
A. To include an add on script you must first place the script you wish to use in the same location as your script
Then you must tell your script to use it, this is achieved by using this code
{.include Squig.txt}
This code needs to go in your script under the line which starts the program
Eg: Program New;
Then, in your main procedure you need to set up the script by using this code
SetupSquig;
Now Squig is in your script.
Heres a list of some popular add on scripts and there loading procedure names.
|
File Name |
Include |
Setup |
Creator |
|
Squig |
{.include Squig.txt} |
SetupSquig; |
Squigglyo |
|
Osi |
{.include Osi.txt} |
SetupOsi; |
Odie5563 |
|
USS |
{.include Uss.txt} |
USSSetup; |
GenoDemoN |
|
BoxBreaker |
{.include BoxBreaker.txt} |
BoxOpenerSetup; |
killerbz |
|
BoxBreaker2 |
{.include BoxBreaker2.txt} |
BoxOpenerSetup; |
Akumara |
|
Library2 |
{.include Library2.txt} |
LoadLibrary (‘RS’); |
Mutant |
|
|
|
|
|
| |
2.2. Errors
*All question marks (?) can be any number/letter/word depending on where they are.
With errors, most of the time you will get told which line to look on.
If you cannot find the error then look at the previous lines.
Example
2.2.1. Line ?: [Error] (?:?): Unknown identifier ? in script
Line ?: [Error] will tell you what line.
[Error] (?:?): will tell you the location, first number is the line, second number is how many characters in the line till the error.
2.2.2. Line ?: [Error] (?:?): Unknown identifier ? in script
You have not declared ‘?’ as a variable yet.
Eg: String, integer, Boolean, etc.
2.2.3. --(error)-- SCAR was unable to find the client window
This means that you have specified a window to auto on and then closed it.
2.2.4. Line ?: [Error] (?:?): Semicolon (';') expected in script
This means that scar requires a semicolon at the line that it has the error on.
2.2.5. Line ?: [Error] (?:?): Assignment expected in script
This means that something is missing on the line that has the error.
Possibly you are missing a colon when you are giving a variable a value.
Eg: x:=10
2.2.6. Line ?: [Error] (?:?): Syntax error in script
This means that something is missing on the line that has the error.
Or you are trying to do something that Scar cannot do.
2.2.7. Line ?: [Error] (?:?): String error in script
This means that you are missing something in the line that has the error.
Possible errors could be not closing brackets when using text
Eg: ‘text’ not ‘text
2.2.8. [Error] (?:?): Close round expected
This means that you are missing a bracket in the line that has the error.
Eg: Number1:=(Number2 + Number3) not Number1:=(Number2 + Number3
2.2.9. [Error] (?:?): Identifier expected
The script needs something on that line. Possibly you have started a Begin/End statement and didn’t end it.
2.2.10. Include file ???.txt does not exist.
The include file you are trying to include does not exist or is not in the same folder as script you're executing.
2.2.11. [Error] (?:?): period ('.') expected
A period (.) Is needed at the line that has the error.
2.2.12. Line ?: [Error] (?:?): 'BEGIN' expected in script
The line needs a Begin in it. You have put code before a procedure has started.
3. CODE EXAMPLES
3.1. Q. What do basic procedures look like?
A. Here is a simple procedure that types in some text.
Procedure Hello;
Begin
Sendkeys(‘Hello’)
End;
3.2. Q. What are Variables?
A. A variable is a bit of code that can hold a value. Integers hold numbers, string hold words, Booleans hold true/false.
To create an integer you must use this code
Var Number : Integer;
Var Words : String;
Var TrueOrFalse : Boolean;
If you want the whole script to use a variable you must create it before any other procedure.
If you want just a certain procedure to use a variable then you can declare the variable after the procedure name but before the Begin.
3.3. Q. What are Constants?
A. The difference between constants and variables is that constants cannot ever be changed, but variables can.
To make a constant you must use this code.
Const
Constant1 = ‘Hello’;
Constant2 = 23423;
Constant3 = True;
As you can see, constants don’t need to be told wether they are integers or strings, etc. once you set a constant value you cannot change it.
3.4. Q. Writing things in the Scar box.
A. To right things into the box at the bottom of scar simply type
Writeln(‘Hello’)
Into your code. This will type the text Hello.
3.5. Q. Using the Report Box
A. To right things into the report box simple type this into your code.
AddToReport(‘Hello’)
That will add the word hello to your report box.
To clear the report box type
ClearReport;
3.6. Q. How do I use an integer as a string?
A. To write an integer as a string simply use IntToStr
Example
Writeln(IntToStr(Number1))
3.7. Q. How to I handle time?
A. Time is slightly difficult to figure out. The procedure GetSystemTime will get the amount of milliseconds since your computer turned on.
1000 Milliseconds is 1 Second
60000 Milliseconds is 1 Minuet
3600000 Milliseconds is 1 Hour.
So if we make a variable called Time1 and give it the value GetSystemTime
Time1:=GetSystemTime
Then later on in the script
Writeln(inttostr(time1/1000))
That will write the amount of seconds since the script started.
3.8. Q. How do I declare variables?
A. Var x as integer;
Var y as String;
Var z as Boolean;
An integer holds only numbers.
A string can hold numbers or letters but cannot be use in multiplications.
A Boolean can be True or False
To declare a variable that your whole script can use you must declare it above any of the procedures, near the top of your script.
To declare a variable that just a certain procedure can use you need to declare it after the procedure name but before the Begin.
3.9. Q. What is tolerance?
A. Tolerance is how different you want something to be.
When looking for text always make the tolerance 100.
Tolerance can be any where between 0 and 255.
3.10. Q. What are Coordinates?
A. The coordinates are where you move the mouse and click the mouse. The coordinates start at 0,0 which is the top right hand corner of the window going down till they reach the bottom left Eg: 700,600.
Telling the script to click the mouse at 10,6 will get the script to click near the top right hand corner.
3.11. Q. How do I move the mouse?
A. There are a couple of procedures that will allow you to do this.
Example
(you will need to declare x and y as variables and give them values)
MoveMouse(x,y)
MoveMouseSmooth(x,y)
MoveMouseSmoothEx(x,y,1,6,15,20,20)
You should use the MoveMouseSmoothEx procedure when moving the mouse in RS, the other are detectable.
3.12. Q. How do I click the mouse?
A. You will need to declare x and y as integers and give them values.
True means you will left click
False means you will right click
ClickMouse(x,y,true)
3.13. Q. How do I get Scar to type?
A. There are 2 ways you can do this
Sendkeys(‘Hello’)
SendKeysSilent(‘Hello’)
There isn’t much difference between the two, just that typing keys silently means that the window doesn’t need to be viewable, it will always type in there, while normally sending they keys will type in whatever window is open at the time.
3.14. Q. How do I look for colours?
A. There is a function called FindColor
You will need to dim x and y as integers.
You will need to either paste a colour to replace TheColor or dim it as an integer then give it a value.
FindColor(x,y,TheColor,0,0,700,400)
This will look for TheColor in the area given by the last 4 numbers.
Once found, the location of the colour will be put into x and y.
There is also a function called GetColor
TheColor:=GetColor(x,y)
That will give TheColor the exact colour at the coordinates given to GetColor.
3.15. Q. How do I use the random function?
A. To use the random function you must first have an integer to add the random too.
Example
Integer1:=random(10)
That will make Integer1 = 0 to 10
Integer1:=100+random(10)
That will make Integer1 = 100 to 110
Wait(random(10))
That will make script wait for = 0 to 10 milliseconds
This is good to use when waiting or moving the mouse so you don’t wait or click in the same place over and over again.
3.16. Q. How do I make my script wait?
A. To make your script wait you must use this code.
Wait(1000)
That will make your script wait for 1 second (1000 milliseconds)
A:=1000
Wait(a)
That will also make your script wait for 1 second.
3.17. Q. How do bitmaps work?
A. To use a bitmap, first off you must declare an integer.
Once you decide what image you would like to use you must insert it into the script. This can be done by clicking on the ‘Script’ drop down menu and then ‘Picture to String’. Now locate your picture and click ‘Open’.
Now if you look at the bottom of scar you will that your picture has been turned into a bunch of letters and numbers.
Example
Image1 := BitmapFromString(15, 10, '000000000000FFFFFFFFFFFFFFFFFF0000000000000000000000' + 'FFFFFFFFFFFF000000000000FFFFFFFFFFFF0000FFFFFFFFF'+ '000000FFFFFFFFFFFF000000000000000000FFFFFFFFF000000' + '000000FFFFFFFFFFFFFFFFFFFFFFFF000000000000000FFFFF' + 'FFFFFF000000000000FFFFFFFFFFFF000000000FFFFFFFFFF' );
Copy that and paste it somewhere into your script, anywhere will do as long as the procedure that it is in actually happens before you need the image.
Now that your image is in your script you might want to look for it in the window you are autoing in. This can be done with this procedure
FindBitmaptolerancein(Image1,x,y,x1,y1,x2,y2,100)
X and y are the location of where the image is found, and x1,y1,x2,y2 are the box to look in.
Example of how to check for a bitmap
Procedure Check;
Begin
If(FindBitmaptoleracein(image1,x,y,10,10,300,250,100)=true)then
Writeln(‘Found the picture’);
End;
3.18. Q. How do I check for text?
A. There are 2 functions that will look for text.
First you will need to put this bit of code in your script
Loadchars(‘’)
That will load all the RS letters.
The first procedure only looks in one place.
IsTextAt2(x,y,‘Text’,100)
The x and y are the coordinates of the text, the ‘text’ is the words you will see there and the last number is the tolerance.
*9,9 are the coordinates of the text in the top right hand corner in RS 2.*
This function looks in a box for the text.
IsTextinArea(x1,y1,x2,y2,x,y,’Text’)
X1,y1,x2 and y2 are the locations that the script should look in.
Example: if x1 and y1 = 0 and x2 and y2 = 10 then the box will be everything from the coordinates 0,0 to 10,10.
X and y are the variables that the location (if found) will be placed in.
Example: If you are looking in a box 0,0 to 10,10 and the word is found at 5,7 then x will equal 5 and y will equal 7.
‘Text’ is the text that you want to look for.
Keep in mind that IsTextinArea is slow and can slow a lot of scripts down.
Thanks for checking out my FAQ. If you want to contact me my email is lesser_demon_slayer@hotmail.com
My user name on Kaitnieks forums is Squigglyo.
|