Search This Blog

Showing posts with label #updates. Show all posts
Showing posts with label #updates. Show all posts

Friday, June 23, 2017

I realize it has been a while but I wanted to bring the PyCrafters up to date. We got rid of that horrible GGServers account and restarted with AWS (amazon web service). The servers going down for days at a time with no reason why or no notification from the hosting company is over. I feel like such a weight has been lifted from our shoulders. The control of the new server is much better.
As of this morning I got the new security worked out and we can now run scripts from home in the Minecraft game again. Make sure you are using /lpy instead of /py so newer students don't break your script as it is running. 
If your local python script isn't running or throwing an error let me know and I will assign you a new security key.

So... YAY!!! Kate-Bot is back online! Feel free to go to the forum and read her code to see if you can add anything to her conversations.



Also wanted to mention that we upgraded to 1.11.2 and are now able to stay updated as Forge and RBJ are also updated.


The forum that _GrimmCreeper_  started for us is starting to take off. Feel free to join it and start asking questions that you need answers to.
Remember that we also go around the country teaching Python to children and there is also a place for normal Python questions there as well.

If you need the new IP address feel free to send in an e-mail to Kate or Victoria and they can reply with it.



Saturday, March 25, 2017

Minecraft Chat-bot built with Python

With the pollChat() option in the rbj mod I created a chat-bot named after our assistant in the office Kate. Meet <Kate-Bot> she will go by other names when you need her help. 
She is a work in progress mainly by myself and the students that want to get involved. I have instructions on easy how to's to get started in adding to the project.

To connect to the server you need to enter the IP of our server in the () of Minecraft.connect() or leave blank to use in your game.
It was easy to watch the chat go by with:

while True:
    chat = mc.events.pollChatPosts()
    print(chat)

It would print:
ChatEvent(ChatEvent.POST, 788319, hello)

I couldn't help but want to clean the return up.

chat = mc.events.pollChatPosts()
        if len(str(chat)) > 23:
            log.append(chat)
            ncha=str(chat)
            ncha1 = ncha[35:]
            ncha2 = ncha1[:-2]
            print(ncha2)

We have some students that call out for 'server' to get the attention of Kate or one of us so I thought about building a response to the single string 'server'
so with the following if statement, KateBot was born.

if ncha2 == 'server'"
    mc.postToChat('Please leave a message and server will get back with you')

Since that point I wanted to make her more interactive and fun to talk to so I have a never ending job of testing and trying new responses to questions.

For instance I have a trigger word string, and a response list to choose from.
GREETING_KEYWORDS = ("hello", "hi", "greetings", "sup", "what's up",)
GREETING_RESPONSES = ["<Kate-Bot>'sup PyCrafter", "<Kate-Bot>hey", "<Kate-Bot>*nods*", "<Kate-Bot>Yay PyCraft!!!"]

Then my definition for the greeting:
def greeting():
    if ncha2.lower() in GREETING_KEYWORDS:
        return mc.postToChat(random.choice(GREETING_RESPONSES)) 

So I welcome any submission to the katebot code foundation by either suggesting a trigger and response to it or writing a definition like:


def KB():
    KB_NAMES =('kbot', '<kate-bot>', 'katebot', 'kate-bot', 'kb')
    KB_RESPONSES = ['<Kate-bot>Yo!!', '<Kate-bot>Can I help you?']
    if ncha2.lower() in KB_NAMES:
        return mc.postToChat(random.choice(KB_RESPONSES))

Tuesday, August 23, 2016

PyCraft updates.

Just a couple of quick things on the update for the PyCraft server.
One of the most fun things I do on this server isn't scripting.. but flying.. well gliding. we have a command block that gives out elytra to anyone. Reason for this is because we have a script that is ran more than any other and that is /py jump. jump puts you 260 blocks in the air and with a elytra you can hit space bar and glide all over the area. When you get close to the bottom you can hit 't' and then up and do it all over again. One thing that annoyed us was when the elytra wore out and you would fall to your death. (All items in inventory are kept).
With the .80 update we can now not die when we fall. We just shake it off and go get a new elytra.

Another update is the not dying when you spawn a script around you.. you will not suffocate in a wall. Remember that if you create a structure out of an unbreakable block you can always use one of the other students jump scripts or the main jump script which I might change the name to glide.



All changes to this update are:

Mod:
  • changed passwords.dat filename to raspberryjammod_passwords.dat
  • added raspberryjammod_permissions.dat control file to protect selected areas of the map [alpha quality; designed for servers]
  • added options to disable in-wall and fall damage
Scripts:
  • added a lot of block names to mcpi/block.py, supporting most blocks through Minecraft 1.10.2
  • deprecated mc.py and mcturtle.py in favor of mine.py and mineturtle.py, which are the same as except blocks are referred to as block.BLOCKNAME instead of BLOCKNAME
  • added RGBA and material data availability to Block structure; the RGB data is typically an average RGB value of a side-face; the alpha is mostly made up; the material data is made to support Visual Python
  • added dithering and color rendering utilities; see earth.py and dither.py for examples on how to use; these are designed to use blocks from 1.10.2
  • added support for running many scripts in Visual Python without Minecraft [alpha quality]; on Linux/OSX/Cygwin, after installing Visual Python, you can do: MCPI_VPYTHON=1 python scriptname.py On Windows, you can do: set MCPI_VPYTHON=1 python scriptname.py



The next update will deal with users running scripts from home after they have changed their userName.