Updates to the scripts in github…

If you download the scripts from the github, I’ve made a change to ALL the existing scripts and I’ll apply this to all scripts going forward.

When testing the python scripts I often run the scripts on a machine different than where I run Minecraft Pi Edition. I do this so I can debug the scripts (using pycharm) and I find it easier. Until now though this requires me to edit each script to pass the remote IP address into the create API.

To make this easier going forward — I’ve created a new “server.py” file which can be edited by the user to specify if they are connecting to a remote server. If you don’t do this or understand what this means, don’t worry — this won’t impact you. If you also run scripts on different machines – edit the “address” variable in server.py to easily switch back and forth and avoid having to edit each individual script.

Two other changes:

  1. I’ve added “#!/usr/bin/env python” to the top of each script
  2. I’ve done a “chmod +x *.py” to set the executable bit on each py script

So what this means is where before you had to type:

python script.py

you can now type

./script.py

All of this will save me time — and hopefully for you too!

Advertisements

2 thoughts on “Updates to the scripts in github…

  1. You could just edit your local copy of minecraft.py in the API. (Search for “def create”, and change “localhost” to whatever the IP of your Raspberry Pi is.) I am assuming that you have a copy of the API on your non-Raspberry Pi machine.

    • Yeah, that’s another great solution. I don’t like changing the mcpi files themselves hence I added the import server reference… but either way works great!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s