Ares
2006-06-04 14:26:06
If not done already, download the SCAR program: http://www.forums.drewley.net/showthread.php?p=199#post199
Ok, to get you going, this tutorial will help you setup your first script, a classical autotyper.
1. First things first, open a new page up…
2. Insert this in line 1:
3. Press enter to get onto the next line. Type in:
4.Press enter twice until you get to line 4; now type in:
5. You should now have this:
6. Next thing, after line 4 type in:
"message:= 'Message here' " is setting the value of "message", this is going to be the message which the autotyper will type.
"end;" is the command to end the procedure.
7. Press enter twice… Make sure you space out your scripts, it becomes easier to manage.
Then type in this code:
-"Begin", again tells the script to begin the procedure.
-"Sendkeys(message)" this is telling to script to type in the message of "Message" which the user has set in the setup procedure.
-"+chr(13)" means to add key "enter" after the message.
-"end;" again tells the script to end the procedure.
8. After that, again press enter twice. Then insert this code:
"setup;" is calling the setup procedure, we place this outside the repeat(loop) so it doesn't cause the cript to malfunction.
"repeat" tells the script to repeat the code underneath for a set amount of time, it is stopped by "until()".
"type;" is telling us to run the type procedure, because its underneath the "repeat" function this procedure will be looped.
"wait(2000)" tells the script to pause for 2 seconds (1000=1sec, 4000=4 secs etc).
"until(false)" tells the script when to stop repeating, "false" means is continuous and doesn't stop until maunally done.
"end." is the final end command, its always witha "." insteda of ";" because it means the script should stop there.
9. Now you hould have this code:
Tips:
1. "//" allows you to add comment into the script, these are normally use for instructions within a script. These only work for single line comments.
2. A list of "chr()" can be found in one of the test scripts when you install scar (pm for more help)
3. Always space out your script. Even use indenting if possible (just press tab after enter)
Hope this helps, Post any comments or if ive missed bits oout just post em here.
Ok, to get you going, this tutorial will help you setup your first script, a classical autotyper.
1. First things first, open a new page up…
2. Insert this in line 1:
Program Autotyper; This is the name of your script; you can set this to what ever you want, but make it relivent if you plan on sharing your script.3. Press enter to get onto the next line. Type in:
var message: string;This is telling the script to create a changeable srting(text) value. "Message" can be chnaged to what ever you want, just make sure you remmeber what the value is for.4.Press enter twice until you get to line 4; now type in:
Procedure setup;, this tells the script to start a new procedure or task, i always call my first one "setup" as it normally is the part of the script which the user has to modify/ setup, hence the name.5. You should now have this:
line1: Program Autotyper;
line2: var message: String;
line3:
line4: Procedure setup;
6. Next thing, after line 4 type in:
line5: begin
line6: message:= 'Message here' // Enter your message inbetween the "s.
line7: end;
The "Begin" command tells the script to begin the procedure. "message:= 'Message here' " is setting the value of "message", this is going to be the message which the autotyper will type.
"end;" is the command to end the procedure.
7. Press enter twice… Make sure you space out your scripts, it becomes easier to manage.
Then type in this code:
Procedure typing;
begin
sendkeys(message + chr(13));
end;
-"procedure type" thats the name of the procedure.-"Begin", again tells the script to begin the procedure.
-"Sendkeys(message)" this is telling to script to type in the message of "Message" which the user has set in the setup procedure.
-"+chr(13)" means to add key "enter" after the message.
-"end;" again tells the script to end the procedure.
8. After that, again press enter twice. Then insert this code:
begin
setup;
repeat
typing;
wait(2000)
until(false)
end.
Because this is the main loop procedure we do not need to put "procedure bluh;"."setup;" is calling the setup procedure, we place this outside the repeat(loop) so it doesn't cause the cript to malfunction.
"repeat" tells the script to repeat the code underneath for a set amount of time, it is stopped by "until()".
"type;" is telling us to run the type procedure, because its underneath the "repeat" function this procedure will be looped.
"wait(2000)" tells the script to pause for 2 seconds (1000=1sec, 4000=4 secs etc).
"until(false)" tells the script when to stop repeating, "false" means is continuous and doesn't stop until maunally done.
"end." is the final end command, its always witha "." insteda of ";" because it means the script should stop there.
9. Now you hould have this code:
Program autotyper;
var message: String;
procedure setup;
begin
message:= 'Message here' // Insert message inbetween "s
end;
procedure typing;
begin
sendkeys(message +chr(13));
end;
begin
setup;
repeat
typing;
wait(2000)
until(false)
end.
Tips:
1. "//" allows you to add comment into the script, these are normally use for instructions within a script. These only work for single line comments.
2. A list of "chr()" can be found in one of the test scripts when you install scar (pm for more help)
3. Always space out your script. Even use indenting if possible (just press tab after enter)
Hope this helps, Post any comments or if ive missed bits oout just post em here.