First, ZeroBrane Studio is superb. Simple to install, use, has a good editor, run your programs with a click. Only problem of course, any CC api calls will fail since they don't exist. - http://studio.zerobrane.com/
So, make a new file, call it minecraft.lua or whatever you like. At the top of any CC program you are working on, add:
require "minecraft"
At the top, that will pull in the file.
Minecraft.lua can then have a stub for all the API calls you are going to use, like so:
http://pastebin.com/SPBTrBvp
I'm just printing out each api call, which lets me visualize in my head that the turtle is doing the right thing, but it wouldn't be too hard to actually output a 2d graphical representation instead if you wanted as well.
Then when you grab your code into your turtle, all you do is remove the requires line, and you are good to go
Really nice programming environment setup I've figured out
Started by jackmott, Oct 01 2015 01:19 PM
6 replies to this topic
#1
Posted 01 October 2015 - 01:19 PM
#2
Posted 01 October 2015 - 02:06 PM
Edit: oh, didn't notice that
Edited by Lupus590, 01 October 2015 - 03:05 PM.
#4
Posted 01 October 2015 - 02:18 PM
Indeed, the idea is that you use it to incorporate your stub file while testing code through the editor, then remove it when you're ready to "go live".
#5
Posted 01 October 2015 - 10:10 PM
Or better yet..
if require then require 'minecraft' end
#6
Posted 02 October 2015 - 02:01 PM
oooh nice
I'm also delving now into adding a little bit of simulation to the stubb, so things like getItemCount and .suck and .place actually work
pretty soon I'll have all of minecraft in the stubb =)
I'm also delving now into adding a little bit of simulation to the stubb, so things like getItemCount and .suck and .place actually work
pretty soon I'll have all of minecraft in the stubb =)
DemHydraz, on 01 October 2015 - 10:10 PM, said:
Or better yet..
if require then require 'minecraft' end
#7
Posted 03 October 2015 - 09:45 PM
At some point I had written a partial virtual turtle API. It would simulate (almost) everything about a turtle, including it's position, items, fuel, and facing. It didn't simulate the world though. I'll see if I can dig it up.
Edited by apemanzilla, 03 October 2015 - 09:46 PM.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











