Posted 07 June 2014 - 09:10 PM
Pastebin: http://pastebin.com/G50HBmnV
I just found this plugin and I started playing with it today. I made a turtle that digs a mine by spiraling in given a specified length. It ends up looking something like this (with 15 as the input):
It leaves two walls between each row for efficiency when the player checks for anything it missed. Golng up one at the end of its spiral is an unintended consequence, but nothing I'm worried about. ;)/>
The reason I have the initial message saying "(less than 64)" for length is because I gave that as a very rough estimate for how far the turtle can go with a full stack of torches before running out. Looking at the API I think it'd be pretty easy to go as far as the user wants, assuming they stay in the same chunk load. If anyone knows of a good way of calculating exactly how many torches would be needed for a given input please let me know. The spiral turns this into a tricky question, but it's a fun thing to try and figure out.
My question is about the variables. I declared 'n' as a local and count as a global (at the top). Was it necessary to pass n every time? And is it standard to place global variables at the top? I've never used LUA before and I'm curious about common syntax/usage. :)/>
Bonus Question: Is there any chance of the plugin expanding into item numbers in the future? That is, turtles being able to check for specific item numbers around them or in their own inventories without having that item already with them? It'd be a very powerful addition. :)/>
I just found this plugin and I started playing with it today. I made a turtle that digs a mine by spiraling in given a specified length. It ends up looking something like this (with 15 as the input):
It leaves two walls between each row for efficiency when the player checks for anything it missed. Golng up one at the end of its spiral is an unintended consequence, but nothing I'm worried about. ;)/>
The reason I have the initial message saying "(less than 64)" for length is because I gave that as a very rough estimate for how far the turtle can go with a full stack of torches before running out. Looking at the API I think it'd be pretty easy to go as far as the user wants, assuming they stay in the same chunk load. If anyone knows of a good way of calculating exactly how many torches would be needed for a given input please let me know. The spiral turns this into a tricky question, but it's a fun thing to try and figure out.
My question is about the variables. I declared 'n' as a local and count as a global (at the top). Was it necessary to pass n every time? And is it standard to place global variables at the top? I've never used LUA before and I'm curious about common syntax/usage. :)/>
Bonus Question: Is there any chance of the plugin expanding into item numbers in the future? That is, turtles being able to check for specific item numbers around them or in their own inventories without having that item already with them? It'd be a very powerful addition. :)/>