Procedures What is a Procedure? A procedure is a way to shorten repetitive scripts by making you not need to write every step when you want scar to do something. for example if you wanted to make a script that waited, clicked then displayed a message, it would look like this. Code (Text): program New; begiwait(5000); clickmouse(5,5, true); writeln('clicked'); end. but if you wanted it to repeat that 50 times, you would have a very long and confusing script. instead of doing that, you would use procedures. How do I make a procedure? To make a procedure you need a code like this Code (Text): program New; Procedure click; begin wait(5000); clickmouse(5,5, true); writeln('clicked'); end; begin click; end. "procedure tells scar that you are going to make a procedure. then you put the name. the name can only be one word, or else scar will give you an error. then you write what you want the procedure to do. in this case, scar waits 5 seconds, clicks the mouse, and displays a message. the "end;" tells scar that you are done with your procedure. then you put the name of your procedure in the script and scar runs the procedure. What are some advantages of procedures? A procedure is a much "cleaner" code than without them. It reduces all of the clutter in a script. this script, Code (Text): program New; begin wait(5000); clickmouse(5,5, true); writeln('clicked'); wait(5000); clickmouse(5,5, true); writeln('clicked'); wait(5000); clickmouse(5,5, true); writeln('clicked'); wait(5000); clickmouse(5,5, true); writeln('clicked'); wait(5000); clickmouse(5,5, true); writeln('clicked'); end. and this script Code (Text): program New; Procedure click; begin wait(5000); clickmouse(5,5, true); writeln('clicked'); end; begin click; click; click; click; click; end. are the same, just that the second one is much neater because it uses procedures. also, if you wanted to change the amount of time you wanted scar to wait, with procedures, you only have to change the value once, while normally, you have to change every time it appears in the script.
the other guide is on variables. and once i submit a program or two, i am going to apply to be a programmer.