Hello all!
I've been thinking of making something related to 8bitmmo and code.
And I thought... Why I don't do a programming language for 8bitmmo?
Great idea!
I'm working on something made on python to read the language.
For now... You can write a program and give it to me on-game, so I can do the things that are on the program.
"Hello world" program:
say("Hello world!")
Benefits:
- Very easy to learn.
- You can do auto-things instantly!
NOTE: The program hasn't got a "sword" command because bots would be made.
2nd NOTE: You need a basic understanding of some programming language, such as Python.
COMMANDS:
To execute a command, just do:
command(args)
say command:
Comments something to the chat. Max comments per minute: 7.
The limit of the lenth of the message is 30 letters.
Syntax:
say("string")
go command:
Goes to a place on the map following a line.
go(x, y)
placeblock command:
Places something on a location. You can do /loc to see your current location.
Syntax:
placeblock("block", x, y, z)
1The "block" argument can be:
"brick": A red brick.
"cement": A cement block.
"snow": A snow block.
"road": A road block.
More to come!
nuke command:
Destroys a block on a x, y and z.
Syntax:
nuke(x, y, z)
inv list:
Returns the inventory on a list with only known items.1
Syntax:
inv
More commands to come!
Learn (Step 1: Loops and conditional statements):
To make a loop (A code that repeats x times), do the following statement:
loop number_of_times{ (Code goes here) }
And if you want to make an infinite loop:
forever { <code> }
To make a conditional statement (A code that only executes if something happens), Do the following statement:
if something_happens { (Do something) else: (Do another thing) }
The conditionals are:
arg1==arg2 - Returns True if both arguments are equal
arg1>arg2 - Returns True if arg1 is higher than arg2
arg1<arg2 - Returns True if arg2 is higher than arg1
arg1 in arg2 - Returns True if arg1 is in arg2 (If it's a substring or an item of arg2)
ARGUMENTS:
lastmsg() - Returns the last message on chat.
placed(x,y,z) - Returns the block placed on that coordinates (Only can be one of those: 1)
LENTH:
To return the lenth of a string or a list, do:
#list_or_string
LISTS:
To make a list, just do:
name=[]
Now, you can append things to the list by doing this:
name.append(something)
And remove items with
name.remove(item)
To return an item, just do
name[item]
COMMENT:
To do a comment, just do...
<text>
BUT! Don't put the comment on a string, because it will be counted as part of the string!
INTEGERS:
Integers are numbers that aren't part of a string.
number=11 <This is an integer> string="11" <This isn't>
This are the operations you can do with them:
a+b <Self-explanatory> a-b <Self-explanatory> a*b <Gives a multiplied by b> a/b <Gives a divided by b> a**b <Gives a^b> a//b <Gives the (b) root of a. Example: 3//2 is the square root of 3>
If you want to set a variable to its own number plus other, you can do +=.
If you want to set a variable to its own number minus other, you can do -=.
Define function:
To define your own function, do the following:
def name(arg1,arg2) { <Code goes here> }
I repeat: If you want to run a command, post it here and I will verify and run it in-game.
Edited by AlexINF, 13 March 2016 - 09:49 PM.