Darkrifts Website for Whatever
PRG_L Reference (8bitmmo Specific)
"If" Statements
Syntax: "If <condition> {
<Code here>
else:
<Otherwise>
}
Conditions:
"==" - Equal to (5=="5" returns false)
">" - First greater than second
"<" - First less than second
"X in Y" - True if X is in Y (Substring/item)
For these conditions, use the else area and make the condition its Else:
"!=" - Not equal to (Else of "==")
"<=" - Less than or equal to (Else of ">")
">=" - Greater than or equal (Else of "<")
Variables
Declaring a function:
def Func(<Arguments>) {
<Code here>
}
Declaraing a variable:
Name=<Integer>
OR
Name=<string>
NOTE: 5 IS NOT EQUAL TO "5"
Lists:
Name=[<Data>]
OR
Name=[] - Makes a list
Name.append(X) - Adds X to Name
Name.remove(X) - Removes X from Name
Name[X] - Returns item X in Name
NOTE: Lists start at 1, not 0
#Name - Returns length of Name
Arithmatic
X+Y <Add>
X-Y <Subtract>
X*Y <Multiply>
X/Y <Divide>
X**Y <X ^ Y>
X//Y <Y root of X>
X+=Y <X=X+Y>
X-=Y <X=X-Y>
Comments
Built in Functions
say(String): Says String in chat
go(X, Y): Goes to a place following a line
placeblock(Block, X, Y, Z): Places a Block block at (X, Y, Z) Block can be "brick", "cement", "snow", or "road"
nuke(X, Y, Z): Breaks block at (X, Y, Z)
inv: Returns a list of inventory (Only returns known items stated above)
lastmsg(): Returns last message in chat
placed(X, Y, Z): Returns block placed at (X, Y ,Z) NOTE: Must be a known block.
Comments are surrounded in angle brackets <Like HTML tags>
Loops
There is no "for" command but you can use:
loop <NumOfTimes> {
<Code>
}
OR
forever {
<code to run forever>
}