Tutorial for Anyone :) Even if your 12 and can read..
4 posters
:: RAHBot :: Tutorials and Guides
Page 1 of 1
Tutorial for Anyone :) Even if your 12 and can read..
COMMENTS
; This is a comment
Anything with a semicolon in front of it gets ignored when the script runs.
WHITESPACE
Added whitespace along the same line has no effect on the script. For example, these commands are all the same:
goto(:label:)
goto (:label:)
goto( :label: ) ;This is a comment
ifAt( x , y)
ifAt (x,y)
STRINGS AND STRING CONCATENATION
Strings
Any strings must have quotation marks around them. Names of items, objects, and NPC's are not considered strings, and will cause an error if delimited by quotation marks. Here are some examples:
print(Hi there!) <- This would cause an error
print("Hi there!") <- The correct way
attack("man") <- wrong way
attack(man) <- right way
Concatenation
The addition "+" charcter is the string concatenation operator. Here is an example:
print("hello " + "there!") output: Hello there!
print("Nice to meet you " + $var4) output: Nice to meet you [value of $var4]
LABELS
Labels look like this:
:label:
use them with goto(:label:) commands to control the flow of your script.
IF...COMMANDS
IF... commands can be followed by any other SINGLE command, so long as it's not another if....command
ifAt(x, y) goto(:label:) <-CORRECT
ifAt(x, y) say("I've Arrived!") <-CORRECT
ifAt(x, y) say("I've Arrived!") goto(:label:) <-WRONG
if... commands must be on the same line. Use them to control the flow of your script.
LOGICAL NOT OPERATOR
Simply placing the word "not" in any of your script commands reverses its logic. Here is an example:
ifAt(x, y) goto(:label:)
would become
ifNotAt(x, y) goto(:label:)
AUTO COMPLETE OPERATOR
Sometimes you want your script to perform an action, and wait until that action is completed before moving on. Use the autocomplete operators for this.
. <- Adding a '.' period to the end of your command will cause the command to execute ONCE, and wait until completion before continuing.
.. <- Adding a '..' double period to the end of your command will cause the command the keep on executing until completion.
Without the auto-complete operator
:WALKTOBANK:
walkTo(x, y)
wait(1000,2000)
ifNotAt(x, y) goto(:WALKTOBANK:)
goto(:label:)
would become
With the auto-complete operator
:WALKTOBANK:
walkTo(x, y). <- notice the auto complete operator here. This would click just ONCE, and wait until your player reaches x, y
goto(:label:)
openDoor(x, y).. <- notice the auto complete operator here. This would keep on clicking until your player reaches x, y
goto(:label:)
COMMAND ARGUMENTS
You have the choice of using either ID's or full names as the command arguments. Either of these two statements are equivalent:
useOnInvItem(logs, knife)
useOnInvItem(13, 14)
VARIABLES
There are 10 variables you can use in your scripts to store user input: $var0-$var9.
Variables must be written with a dollar sign "$" in front of their name. Here is an example:
getInput($var1, "What type of NPC would you like to attack?")
attack($var1)
OR
getOption($var2, "Please select the type of rock to mine", "Iron", "Coal")
ifVarEqual(0, $var2) goto(:MINEIRON:)
ifVarEqual(1, $var2) goto(:MINECOAL:)
HAPPY SCRIPTING!
; This is a comment
Anything with a semicolon in front of it gets ignored when the script runs.
WHITESPACE
Added whitespace along the same line has no effect on the script. For example, these commands are all the same:
goto(:label:)
goto (:label:)
goto( :label: ) ;This is a comment
ifAt( x , y)
ifAt (x,y)
STRINGS AND STRING CONCATENATION
Strings
Any strings must have quotation marks around them. Names of items, objects, and NPC's are not considered strings, and will cause an error if delimited by quotation marks. Here are some examples:
print(Hi there!) <- This would cause an error
print("Hi there!") <- The correct way
attack("man") <- wrong way
attack(man) <- right way
Concatenation
The addition "+" charcter is the string concatenation operator. Here is an example:
print("hello " + "there!") output: Hello there!
print("Nice to meet you " + $var4) output: Nice to meet you [value of $var4]
LABELS
Labels look like this:
:label:
use them with goto(:label:) commands to control the flow of your script.
IF...COMMANDS
IF... commands can be followed by any other SINGLE command, so long as it's not another if....command
ifAt(x, y) goto(:label:) <-CORRECT
ifAt(x, y) say("I've Arrived!") <-CORRECT
ifAt(x, y) say("I've Arrived!") goto(:label:) <-WRONG
if... commands must be on the same line. Use them to control the flow of your script.
LOGICAL NOT OPERATOR
Simply placing the word "not" in any of your script commands reverses its logic. Here is an example:
ifAt(x, y) goto(:label:)
would become
ifNotAt(x, y) goto(:label:)
AUTO COMPLETE OPERATOR
Sometimes you want your script to perform an action, and wait until that action is completed before moving on. Use the autocomplete operators for this.
. <- Adding a '.' period to the end of your command will cause the command to execute ONCE, and wait until completion before continuing.
.. <- Adding a '..' double period to the end of your command will cause the command the keep on executing until completion.
Without the auto-complete operator
:WALKTOBANK:
walkTo(x, y)
wait(1000,2000)
ifNotAt(x, y) goto(:WALKTOBANK:)
goto(:label:)
would become
With the auto-complete operator
:WALKTOBANK:
walkTo(x, y). <- notice the auto complete operator here. This would click just ONCE, and wait until your player reaches x, y
goto(:label:)
openDoor(x, y).. <- notice the auto complete operator here. This would keep on clicking until your player reaches x, y
goto(:label:)
COMMAND ARGUMENTS
You have the choice of using either ID's or full names as the command arguments. Either of these two statements are equivalent:
useOnInvItem(logs, knife)
useOnInvItem(13, 14)
VARIABLES
There are 10 variables you can use in your scripts to store user input: $var0-$var9.
Variables must be written with a dollar sign "$" in front of their name. Here is an example:
getInput($var1, "What type of NPC would you like to attack?")
attack($var1)
OR
getOption($var2, "Please select the type of rock to mine", "Iron", "Coal")
ifVarEqual(0, $var2) goto(:MINEIRON:)
ifVarEqual(1, $var2) goto(:MINECOAL:)
HAPPY SCRIPTING!
zunder- New user
- Posts : 48
Join date : 2011-04-06
Re: Tutorial for Anyone :) Even if your 12 and can read..
why are u reposting this stuff thats already here stickied and also comes with the bot? seems u just copy and pasted the txt files.
password- New user
- Posts : 220
Join date : 2011-01-19
Re: Tutorial for Anyone :) Even if your 12 and can read..
jRah wrote:New addition are highlited in GREEN
COMMENTS
; This is a comment
Anything with a semicolon in front of it gets ignored when the script runs.
WHITESPACE
Added whitespace along the same line has no effect on the script. For example, these commands are all the same:
goto(:label:)
goto (:label:)
goto( :label: ) ;This is a comment
ifAt( x , y)
ifAt (x,y)
STRINGS AND STRING CONCATENATION
Strings
Any strings must have quotation marks around them. Names of items, objects, and NPC's are not considered strings, and will cause an error if delimited by quotation marks. Here are some examples:
print(Hi there!) <- This would cause an error
print("Hi there!") <- The correct way
attack("man") <- wrong way
attack(man) <- right way
Concatenation
The addition "+" charcter is the string concatenation operator. Here is an example:
print("hello " + "there!") output: Hello there!
print("Nice to meet you " + $var4) output: Nice to meet you [value of $var4]
LABELS
Labels look like this:
:label:
use them with goto(:label:) commands to control the flow of your script.
IF...COMMANDS
IF... commands can be followed by any other SINGLE command, so long as it's not another if....command
ifAt(x, y) goto(:label:) <-CORRECT
ifAt(x, y) say("I've Arrived!") <-CORRECT
ifAt(x, y) say("I've Arrived!") goto(:label:) <-WRONG
if... commands must be on the same line. Use them to control the flow of your script.
LOGICAL NOT OPERATOR
Simply placing the word "not" in any of your script commands reverses its logic. Here is an example:
ifAt(x, y) goto(:label:)
would become
ifNotAt(x, y) goto(:label:)
AUTO COMPLETE OPERATOR
Sometimes you want your script to perform an action, and wait until that action is completed before moving on. Use the autocomplete operators for this.
. <- Added a '.' period to the end of your command will cause the command to execute ONCE, and wait until completion before continuing.
.. <- Added a '..' double period to the end of your command will cause the command the keep on executing until completion.
Without the auto-complete operator
:WALKTOBANK:
walkTo(x, y)
wait(1000,2000)
ifNotAt(x, y) goto(:WALKTOBANK:)
goto(:label:)
would become
With the auto-complete operator
:WALKTOBANK:
walkTo(x, y). <- notice the auto complete operator here. This would click just ONCE, and wait until your player reaches x, y
goto(:label:)
openDoor(x, y).. <- notice the auto complete operator here. This would keep on clicking until your player reaches x, y
goto(:label:)
COMMAND ARGUMENTS
You have the choice of using either ID's or full names as the command arguments. Either of these two statements are equivalent:
useOnInvItem(logs, knife)
useOnInvItem(13, 14)
VARIABLES
There are 10 variables you can use in your scripts to store user input: $var0-$var9.
Variables must be written with a dollar sign "$" in front of their name. Here is an example:
getInput($var1, "What type of NPC would you like to attack?")
attack($var1)
OR
getOption($var2, "Please select the type of rock to mine", "Iron", "Coal")
ifVarEqual(0, $var2) goto(:MINEIRON:)
ifVarEqual(1, $var2) goto(:MINECOAL:)
HAPPY SCRIPTING!
Lattes- New user
- Posts : 73
Join date : 2011-04-10
Re: Tutorial for Anyone :) Even if your 12 and can read..
... the point of quoting only? thats so retarded.
password- New user
- Posts : 220
Join date : 2011-01-19
Re: Tutorial for Anyone :) Even if your 12 and can read..
^To show that it's the exact same?
Lattes- New user
- Posts : 73
Join date : 2011-04-10
Re: Tutorial for Anyone :) Even if your 12 and can read..
It's true. I was 12 when I started to script. Learning java now
wtf- New user
- Posts : 86
Join date : 2010-12-08
Location : in ur pants :D
Similar topics
» Tutorial Section
» [Tut]Advanced Scripting Tutorial
» Simple Proxy Tutorial
» [Tutorial] Basic Scripting - Part 1
» thelol1's tutorial on AFK training/botting 1% chance of ban, safest way
» [Tut]Advanced Scripting Tutorial
» Simple Proxy Tutorial
» [Tutorial] Basic Scripting - Part 1
» thelol1's tutorial on AFK training/botting 1% chance of ban, safest way
:: RAHBot :: Tutorials and Guides
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|