Jump to content


Photo

8BitMMO PRG_L

PRG_L

This topic has been archived. This means that you cannot reply to this topic.
17 replies to this topic

#1 AlexINF

AlexINF

    All the good things have an end.

  • Members
  • PipPipPip
  • 913 posts

Posted 09 March 2016 - 07:09 PM

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:

  1. Very easy to learn.
  2. 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.


#2 T h e E p i c P i x e l

T h e E p i c P i x e l

    Advanced Member

  • Members
  • PipPipPip
  • 171 posts

Posted 09 March 2016 - 09:16 PM

seems like this would be great for building! This is amazing, we need more creative stuff like this! :D btw language is not spelled lenguage, sorry i have OCD XD


s7rk2q5.gif


#3 RobbyZ

RobbyZ

    Administrator

  • Developer
  • 1331 posts

Posted 09 March 2016 - 09:33 PM

Sounds useful - especially for helping to run minigames and such (I know some, like, spleef require a lot of manual set up each run)



#4 AlexINF

AlexINF

    All the good things have an end.

  • Members
  • PipPipPip
  • 913 posts

Posted 11 March 2016 - 09:23 PM

Sounds useful - especially for helping to run minigames and such (I know some, like, spleef require a lot of manual set up each run)

Thanks! :D


Here, have an example code to auto-build a 2x2 cube.

<Set the coords for the cube>
x=10
y=10
z=0

<Do a brick shortcut>

b="brick"

loop 2{
placeblock(b, x, y, z)

x=x+1 <Now it will place the block right next to the other>

placeblock(b, x, y, z)

y=y-1

placeblock(b, x, y, z)

x=x-1

placeblock(b, x, y, z)

z=z+8
y=y+1

} <Now do it again, but adove the square we did before>

Huh, I like this, I'm gonna write more!

This is a program that responds you when you say "Hi"

forever {
if lastmsg()=="Hi" or lastmsg()=="hi" or lastmsg()=="Hi!" or lastmsg()=="hi!" {
say("Hello!")
}
}

How about a... 2D Building? Let's do one!

b="brick"
x="del"

w=5 <Width and height>
h=5
build=[b,b,b,b,b,
       b,x,x,x,b,
       b,x,x,x,b,
       b,x,x,x,b,
       b,b,x,b,b]

x1=10 <x pos>
y1=10 <y pos>
z1=10 <z pos>

i=1
loop #build{
if build[i]=="del" {
nuke(x1, y1, z1)
else:
placeblock(build[i], x1, y1, z1)
}
i=i+1
x1=x1+1
if x1 == w { <If we finished a wall, continue with the next>
x1=10
y1=y1-1
}
}


#5 Terrarian

Terrarian

    Advanced Member

  • Members
  • PipPipPip
  • 99 posts

Posted 12 March 2016 - 05:05 AM

Did you add support for operation shorthands (++, +=, ect) yet? I would be an idiot and just use them anyway I guess, but it's still nice to know :P


bOJpS3V.gif

 

"If it doesn't work, try again.

If it still doesn't work, try a different way or work on a different idea.

When you solve the original problem in the different project, apply, test, and improve."

 

   ~ Me on how to succeed. Whether it be in programming, math, or life.


#6 AlexINF

AlexINF

    All the good things have an end.

  • Members
  • PipPipPip
  • 913 posts

Posted 12 March 2016 - 08:14 AM

Did you add support for operation shorthands (++, +=, ect) yet? I would be an idiot and just use them anyway I guess, but it's still nice to know :P

That would be great. I'll implement the += and the -=.



#7 Kalaris

Kalaris

    Lord of the Kitty Cats

  • Members
  • PipPipPip
  • 195 posts

Posted 13 March 2016 - 05:33 AM

It would be very easy to spam long and tedious messages, though.


2196ow0.jpg


#8 AlexINF

AlexINF

    All the good things have an end.

  • Members
  • PipPipPip
  • 913 posts

Posted 13 March 2016 - 10:55 AM

It would be very easy to spam long and tedious messages, though.

Fixed; Lenth of the messages are now less than 30 letters



#9 Terrarian

Terrarian

    Advanced Member

  • Members
  • PipPipPip
  • 99 posts

Posted 13 March 2016 - 07:43 PM

This is a legitimately good idea! Other than the message spam or syntax errors breaking things, it doesn't seem very abusable :D.

 

Also,  just an idea, how about adding support like:

var MyFunction = function(Args) {/*Stuff*/};  // JavaScript style

void inline Idea(string Text) {return Text;} // C++ Style

// Idea for what the PRG_L function could be below NOTE: I'm assuming ";" are needed :P

new function MyFunction2(<Whatever you add before a variable> Text) {say(Text);}; <New language idea style>

for the lazy people like me who functionize everything used more than ~3 times lol


bOJpS3V.gif

 

"If it doesn't work, try again.

If it still doesn't work, try a different way or work on a different idea.

When you solve the original problem in the different project, apply, test, and improve."

 

   ~ Me on how to succeed. Whether it be in programming, math, or life.


#10 AlexINF

AlexINF

    All the good things have an end.

  • Members
  • PipPipPip
  • 913 posts

Posted 13 March 2016 - 09:47 PM

This is a legitimately good idea! Other than the message spam or syntax errors breaking things, it doesn't seem very abusable :D.

Cannot spam messages -- There are a limit of 7 messages per min


var MyFunction = function(Args) {/*Stuff*/};  // JavaScript style

void inline Idea(string Text) {return Text;} // C++ Style

// Idea for what the PRG_L function could be below NOTE: I'm assuming ";" are needed :P

new function MyFunction2(<Whatever you add before a variable> Text) {say(Text);}; <New language idea style>

for the lazy people like me who functionize everything used more than ~3 times lol

True Terrarian; I forgot the define function! Adding it now.

Also, no ";" nedded.


BTW, Changed

if something:
...
else:
...
end

to

if something {
...
else:
...
}


#11 Terrarian

Terrarian

    Advanced Member

  • Members
  • PipPipPip
  • 99 posts

Posted 13 March 2016 - 11:56 PM

It's got everything it probably needs to have. I'm gonna go make a reference website page that isn't part of a forums lol.

Even though it doesn't have ">=" or things like that, you could just use something like..

if X==34 {
   <This would be empty>
else:
   <What you would want the "!=" to do>
}

Also, do functions have to have 2 arguments?

 

 

EDIT: Made the reference site that isn't part of a forums  :D  Link: http://darkrifts.wix...!prgl-ref/jfcdk


Edited by Terrarian, 14 March 2016 - 01:21 AM.

bOJpS3V.gif

 

"If it doesn't work, try again.

If it still doesn't work, try a different way or work on a different idea.

When you solve the original problem in the different project, apply, test, and improve."

 

   ~ Me on how to succeed. Whether it be in programming, math, or life.


#12 AlexINF

AlexINF

    All the good things have an end.

  • Members
  • PipPipPip
  • 913 posts

Posted 14 March 2016 - 03:08 PM

Also, do functions have to have 2 arguments?

No need to. it's just an example.


It's got everything it probably needs to have. I'm gonna go make a reference website page that isn't part of a forums lol.

Even though it doesn't have ">=" or things like that, you could just use something like..

if X==34 {
   <This would be empty>
else:
   <What you would want the "!=" to do>
}

Also, do functions have to have 2 arguments?

 

 

EDIT: Made the reference site that isn't part of a forums  :D  Link: http://darkrifts.wix...!prgl-ref/jfcdk

Also, I can't see the page... It's blank.



#13 Terrarian

Terrarian

    Advanced Member

  • Members
  • PipPipPip
  • 99 posts

Posted 14 March 2016 - 11:38 PM

Welp, I tried the page (Including from the link) and it works for me, so idk what the problem there is :P

Can't say I didn't try to make it work lol.


bOJpS3V.gif

 

"If it doesn't work, try again.

If it still doesn't work, try a different way or work on a different idea.

When you solve the original problem in the different project, apply, test, and improve."

 

   ~ Me on how to succeed. Whether it be in programming, math, or life.


#14 Terrarian

Terrarian

    Advanced Member

  • Members
  • PipPipPip
  • 99 posts

Posted 15 March 2016 - 09:30 PM

Welp, here's a program for you to try and make work....

cmdHi="Hello"
cmdEmote=":P, :D, ;-;, ect..."
cmdInv="ERROR"
say("UseBot up, !help for help.")

forever {
if lastmsg()=="!hi" {
say(cmdHi)
}
if lastmsg()=="!emote" {
say(cmdEmote)
}
if lastmsg()=="!info" {
say("Created by Terr/Darkrifts")
say("Compiled by AlexINF. V-1.0")
}
if lastmsg()=="!inv" {
say(cmdInv)
}
if lastmsg()=="!help" {
say("!hi, !emote, !info, !inv")
}
if "UseBot" in lastmsg() {
say("Im still here :D")
}
cmdInv=inv
}

I call it "UseBot", as in Use(less)Bot :P


bOJpS3V.gif

 

"If it doesn't work, try again.

If it still doesn't work, try a different way or work on a different idea.

When you solve the original problem in the different project, apply, test, and improve."

 

   ~ Me on how to succeed. Whether it be in programming, math, or life.


#15 bumchin

bumchin

    Advanced Member

  • Members
  • PipPipPip
  • 209 posts

Posted 17 March 2016 - 08:17 AM

Can you guys speak english not coding? XD


                                                   bumchin               furychin

 

 

 

                                 [17:46] <@EightBitMMO> [GLOBAL] <bumchin> selling kidney's 1k each

                                 [17:46] <@EightBitMMO> <Waldin> kidney0s?
                                 [17:47] <@EightBitMMO> <bumchin> The ones you harvest out of people >;D

#16 AlexINF

AlexINF

    All the good things have an end.

  • Members
  • PipPipPip
  • 913 posts

Posted 17 March 2016 - 02:49 PM

Welp, here's a program for you to try and make work....

cmdHi="Hello"
cmdEmote=":P, :D, ;-;, ect..."
cmdInv="ERROR"
say("UseBot up, !help for help.")

forever {
if lastmsg()=="!hi" {
say(cmdHi)
}
if lastmsg()=="!emote" {
say(cmdEmote)
}
if lastmsg()=="!info" {
say("Created by Terr/Darkrifts")
say("Compiled by AlexINF. V-1.0")
}
if lastmsg()=="!inv" {
say(cmdInv)
}
if lastmsg()=="!help" {
say("!hi, !emote, !info, !inv")
}
if "UseBot" in lastmsg() {
say("Im still here :D")
}
cmdInv=inv
}

I call it "UseBot", as in Use(less)Bot :P

Well done!



#17 Kralereth

Kralereth

    The Emerald Wizard

  • Members
  • PipPipPip
  • 1277 posts

Posted 17 March 2016 - 02:51 PM

Well done!

U could just like his post :/
FqAuPvV.jpgew5x0uL.png
"I'm just here to watch people die" -TheGreatOnion
"MY SIGT KEY BKORK" -Po2005
"could I end a helping hand?" -Ankos

#18 AlexINF

AlexINF

    All the good things have an end.

  • Members
  • PipPipPip
  • 913 posts

Posted 17 March 2016 - 03:11 PM

BTW, the page now works. I think it was an error of my computer.


U could just like his post :/

I WAS going to expand the post ( Look adobe )

 

 

I made a reference to PRG_L in my projects page, check it out:

 

My page -- http://alexinf.cf