Jump to content

Auto Item Smelter (Basic, UNDER 50 LINES) | Efficient way to smelt lots of items

turtle utility lua

1 reply to this topic

#1 interface212

  • New Members
  • 1 posts

Posted 17 April 2017 - 11:04 AM

Auto Item Smelter (Basic, UNDER 50 LINES)

This started as a 250+ line program I made to smelt items from one chest into another, but then I started getting rid of alot of the functionality to drastically reduce it's line count and efficiency, it's now under 50 lines and has support for a variable amount of furnaces and different fuels.

If one furnace is done before the other however it cannot re-task it until all the furnaces are done which I cannot see an easy way to do without timers and tables containing how much time each one has left etc...

Pastebin: https://pastebin.com/x7FVCisU



#2 eniallator

  • Members
  • 56 posts

Posted 24 April 2017 - 09:04 PM

First of all, nice program - looks good.

Next, since Lua does not have significant whitespace, the code can be minified to 1 line e.g using this minifier so having the program under 50 lines isn't necessarily good. For instance most of the time you trade readability for shorter code which isn't that great of a coding practice since code readability is pretty essential for working in teams (if you ever do).

Anyways, like i said it's a good program and for this instance it's quite readable so good job there. However you might want to skip a line every so often e.g if you want to see my code - here's my collision file from my game.

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users