Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Updating of scripts
- Introduction to scripting
- - Basics and types
- - Initial procedures/functions
- - Variables, constants, records
- - Modularity
- - Basic macroing/SRL procedures/functions
- - Mouse related
- - Keyboard related
- - TPA based object finding
- - Symbols, bitmaps and DTM's
- - Memory leaks
- - debugging
- - Writeln's
- - Try..except/finally
- - updating old scripts
- - SRL
- - SCAR
- - Ask
- Introduction to scripting
- This tutorial should hopefully take from being a leecher to a small contributor to the forums and this introduction aims to set standards for the rest of the tutorial.
- First of all, I fully encourage you not to follow it. I hope to create an interest in scripting where by you want to learn by playing with the language rather than reading what I say as what I say can get very dull.
- I do not plan on teaching you how to make macroing scripts. Instead, I plan on giving you logical skills, basic scripting skills and basic Scar & SRL knowledge. This should allow you to produce scripts, but will focus on fixing scripts.
- - Basics
- A script, at the least, only requires 2 lines:
- [scar]begin
- end.[/scar]
- begin is the start of a grouped section of code and end shows the closing of this grouped code. If then end is followed by a . then it means that this is the end of the script - nothing else will be run when it gets this far and any code beneath it is ignored. Usually an end will have a ; after it.
- A popular optional is to have a program name, which is set by doing
- [scar]program MyFirstScript;[/scar]
- but it does nothing and only affects one other thing that is quite unimportant now. There are rules to what it can be, but mainly no spaces - more depth will be given later.
- For types, there is a handful of main ones. Booleans are either true or false. A real life example, "Is my foot on fire" - it either is or isn't. Chars are single letters - they can anything from 'a' to '~' or ones you can't directly see (like the enter character). Strings are just a load of characters joined together, like 'hello' or 'oh hey there!'. Integers are whole numbers, such as 7 or 42 or 69. Extended numbers are numbers that don't have to be whole, such as 4.2 and 8.007 (it can also be a whole number).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement