This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
gezepi's profile picture

Maniac Storage - Sort, Retrieve, Craft, etc...

Started by gezepi, 04 January 2014 - 10:22 PM
gezepi #1
Posted 04 January 2014 - 11:22 PM
Hello ComputerCraft Forums!

I've been working for a long time on a system that stores items, retrieves them for you and can craft new items. I call it Maniac Storage. These basic functions can be utilized for other things such as keeping the inventory of a machine filled with a certain item type. I developed it on a server I host for some friends so a lot of the functionality is from ideas of theirs (you know who you are). We always joke about only allowing maniacs onto our server, so that is why this is the Maniac Storage system.

I've made a demonstration video which is pretty comprehensive as far as what features it shows.
[media]http://www.youtube.com/watch?v=eOt_ET025UM&feature=youtu.be[/media]

I'll break down what each program does here:
SpoilersortMaster
SpoilerCommunicates with the sorter turtle. Looks at stacks of items in a chest and pushes them into an adjacent tesseract which leads to the turtle. Stacks of 10 or might items have preference over smaller stacks. Will also send more than one stack if there are multiple in the chest (of the same item type).

sorter
SpoilerReceives items from sortMaster and stores them in the location specified. Uses an item tesseract to receive items. Will request stacks of fuel from fuelSupply so that it will always be mobile. Sends its status to queue which then prints it to the users HuD.

retriever
SpoilerReceives requests for items (up to 960) from termInterface, gbInterface, and crafter. Travels to the destination specified and sends items back via item tesseract. Sends status to queue which is printed to the HuD and refuels wirelessly (fuelSupply).

termInterface
SpoilerDisplays an interface on a computer so the user can request items from the wall. Search terms can be typed and the list of items displayed will be pruned to match. Sends item requests to queue which then sends them to retriever.

gbInterface
SpoilerDisplays an interface on a HuD so the user can request items from the wall. Sends item requests to queue which then sends them to retriever.
To request 10 Iron Ingot:
  1. Type "$$Iron" into the chat box
  2. A list of all items containing "Iron" in their name will be displayed
  3. If Iron Ingots are number 6 in the list, type "$$6" into the chatbox
  4. The user will be prompted for the amount to be retrieved
  5. Type "$$10" into the chat box
  6. The retriever will fetch 10 Iron Ingot and send them to the current drop off destination
  7. Go back at any time by typing "$$" into the chatbox

queue
SpoilerReceives requests from other programs and sends them to the retriever. If the turtle is already fetching something, the request will be added to the queue which is displayed on the HuD. Also displays status of retriever and sorter turtles.

crafter
SpoilerAllows the user to create crafting recipes, save them for later, load them and make up to 64 of that recipe. Sends item requests to queue.

Installation
Installing the system is a little more involved than downloading a program and running it. I'm working on a video that walks through the process but in the mean time please take a look at the code which is on my pasteBin page:
http://pastebin.com/u/gezepi

Future Improvements
I'm going to be focusing on fixing bugs people find and perhaps making the installation easier so these are more of long term goals.
Spoiler
  • Item counts - keep track of what comes in/what goes out
  • Auto craft low items - if, say, torches are low it will craft more of them
  • Multiple turtles for sorting, retrieving - would speed things up a bit
  • Multiple walls - would be a bit more compact and faster
  • Complete recipe list - perhaps from NEI or elsewhere
  • Send item craft requests to crafter

Current Bugs
I've tried to remove as many as possible but some still exist.
Spoiler
  • Storing many stacks of an item sometimes fails to drop all of them off
  • Occasionally fails to get a GPS location
  • Probably more that I can't think of, but honestly it's been working pretty well on my server

License
Feel free to use this and modify it to fit your use just please leave some mention of me in the code.

Feedback
I'm excited to hear what the community thinks and would love to hear suggestions!
Jim #2
Posted 05 January 2014 - 04:42 AM
Hm, if this doesn't include turtles, then you are in the wrong section bro.
wieselkatze #3
Posted 05 January 2014 - 03:04 PM
From what I have seen in the video: Wow. This is just amazing!

(I can imagine this will be quite a mess on the rednet broadcast channel, hehe :P/> )

If you'd like to I can help you making a nice GUI for advanced computers ;)/>
wieselkatze #4
Posted 05 January 2014 - 04:20 PM
Hm, if this doesn't include turtles, then you are in the wrong section bro.

Have you even watched any part of the video?
gezepi #5
Posted 05 January 2014 - 06:51 PM
From what I have seen in the video: Wow. This is just amazing!

(I can imagine this will be quite a mess on the rednet broadcast channel, hehe :P/> )

If you'd like to I can help you making a nice GUI for advanced computers ;)/>

Thanks for the encouragement :)/>

I started using rednet.broadcast for convenience but I'm concerned the programs will get flooded for requests that are not for them. I just thought of a way to switch it to rednet.send today. This would help ease congestion, right?

Sure, if you'd like to make a fancy GUI all it really has to do is load the item table (for location data) and send a request to the queue server.

I keep putting off making a tutorial video on how to set it up because of small tweaks I make, but maybe I should just make one and add notes to the video where any changes have been made.
Jim #6
Posted 07 January 2014 - 06:51 AM
Hm, if this doesn't include turtles, then you are in the wrong section bro.


Have you even watched any part of the video?

Nope, this is why I said "if".
Edited on 07 January 2014 - 05:52 AM
wieselkatze #7
Posted 07 January 2014 - 10:28 AM
The thing I meant to say is: Why do you doubt if there is turtle content when you don't even know anything about the post?

@gezepi:Check you inbox ;)/>
xXLeNinjaXx #8
Posted 10 January 2014 - 08:01 PM
How to Setup Please?

EDIT: i allways get an error 393 Expected String
Edited on 10 January 2014 - 07:08 PM
wieselkatze #9
Posted 11 January 2014 - 04:45 AM
The item terminal actually got an update (that's the one erroring) I'll ask gezepi today to update his link
xXLeNinjaXx #10
Posted 11 January 2014 - 11:32 AM
Thanks

EDIT: Maybe you guys could add an install launcher that downloads everything you need to each one?
Edited on 11 January 2014 - 10:39 AM
unobtanium #11
Posted 11 January 2014 - 11:45 AM
Really well designed! Stay with it and add more features! :D/>
This also let me think about an old concept of mine. Because this Deep Storage Unit Setup is quite expensive, isnt it?
Edited on 11 January 2014 - 02:41 PM
xXLeNinjaXx #12
Posted 11 January 2014 - 11:57 AM
UNOBTANIUM does it work for you?
unobtanium #13
Posted 11 January 2014 - 03:41 PM
I didnt checked it, i just watched the video :S
wieselkatze #14
Posted 11 January 2014 - 03:44 PM
Already working on a new version with new features, stay tuned ;)/>
xXLeNinjaXx #15
Posted 11 January 2014 - 04:14 PM
Think im going too far 50 floors + waiting for storage (19x31) (All Made By Turtles)


Too Much?

Or Too Little?
gezepi #16
Posted 11 January 2014 - 06:39 PM
I've been working on the install video but keep running into issues with the downloader/installer and have to fix them as I go. I won't be at my computer for a couple days so unfortunately I won't be able to get it finished quite yet. Wish I had a more substantive update but real life sometimes gets in the way of things ;)/>
xXLeNinjaXx #17
Posted 11 January 2014 - 07:07 PM
We Can Wait as long as you do it :)/>
gezepi #18
Posted 19 March 2014 - 03:01 AM
We Can Wait as long as you do it :)/>

Well, I've certainly put that to the test.

Startup file download:
http://pastebin.com/ZzHfdqdA

This might be considered resurrecting a dead thread, but I have some new info to put here.

I just finished making a video that walks through the installation process for this system. It also includes some upgrades since the last time I posted about it. I'm not that happy with the quality o the video, but hey, it's better to release something than nothing. And if it can help somebody that wants to set this up do it, then good.

Here's the video:
Spoiler[media]http://youtu.be/a2fKuAfXDow[/media]

New features:
  • Easier installation (trust me, it was a lot harder last time I posted)
  • Turtle programs that take advantage of the system
  • dutyCycle program
  • topOff program
Let me know what you think! I'll try to help with any bugs that people have but please be as specific as possible. There are a lot of programs in this thing and it's sometimes hard to pin a problem down when it happens on my own computer.
Verox #19
Posted 19 March 2014 - 08:21 AM
I'm currently in the middle of setting this up and wow what can I say? It's amazing just to even look at. The only thing I'm worried about at the moment is the speed of sorting, I have a quarry set up that mines extremely large amounts of ore and I'm just worried that it'll get logged up so I'm just wondering roughly how fast, in your experience, the sorter actually sorts items and if it's possible to send ores to another tesseract to be processed and eventually sorted.
gezepi #20
Posted 19 March 2014 - 02:51 PM
Thanks, it ended up being a much larger ecosystem than I ever intended so I hope it ends up working on your server.
I've found that if you remove cobblestone from the equation (by having a tesseract right next to the dsu for it) that it can keep up with a quarry. Keep in mind though that the larger the wall of items, the longer it will take to get around it. This isn't a big deal if all of the quarry items (dirt, gravel, ores, etc) are all near each other. So when you first start feeding items into this thing you might want to do it deliberately and think about what goes next to what.
Verox #21
Posted 20 March 2014 - 02:48 AM
Ah yeah that's what I was planning on doing anyway, the only real problem is that the CC version I'm using doesn't like the shared folder so I have to figure out a way for all the computers and turtles to have the same tables.
gezepi #22
Posted 20 March 2014 - 06:13 AM
Yeah, that's something I haven't quite figured out either. I've been using a DOS batch file to simplify updating the items.tbl file, so you could make one that transferred it to all the required folders. It would be a nuisance to set up but nice to have. In the future I'd like to have a computer that just replies to requests about where items are, what frequencies are what, etc. That way there would only need to be one copy of all that and all the rest would have access to it. Lots of upgrades in mind, but they are slow to come about and even slower to be close to polished.
Verox #23
Posted 20 March 2014 - 11:41 AM
I don't know how I'd go about making a DOS batch file to do all that so I'll probably figure out a way or just do it manually (ugh).

The most interesting part of trying to get this entire system set up is redesigning my processing area for ores and the like. It's been fun and I'm finally started to place the DSU's for the wall… Even with all the ores in the world it takes forever to set this system up haha.
Edited on 20 March 2014 - 10:45 AM
xXLeNinjaXx #24
Posted 26 May 2014 - 05:19 PM
WOW, what can i say this is just amazing what you know :D1
xXLeNinjaXx #25
Posted 27 May 2014 - 12:57 AM
Hey man mabey in your next video you could turn up your mic or get a new one? too quiet <_</>
skwerlman #26
Posted 27 May 2014 - 04:29 AM
Now that 1.6 is out, I'm gonna try and get sortMaster, fuelSupply, termInterface, gbInterface, queue, and crafter to run on a single computer, all at once.

gezepi, I'll send you the resulting code to release if you'd like. (it'll only work in CC1.6, though, since it'll use tabs)
xBlizzDevious #27
Posted 29 May 2014 - 03:51 AM
That is amazing! With your system, would it be possible to implement multiple turtles? You'll need some sort of anti-collision code, but it would greatly increase the speed that your system runs at. You could instead have "sections" of the wall that a turtle deals with or something like that. IE. the wall is 30 wide and 60 high, you could have 18 turtles each covering a 10x10 area each or something like that. It would probably cause more issues than it'd be worth though.

But let's say you have 5 turtles working on the whole wall, you could have some sort of implementation to your queue so that if turtle 1 is doing something, then turtle 2 will be sent to the job. You could also implement an efficiency algorithm so it'll calculate how far each turtle will have to go to and then send the one that is closest.

Damn, you've put a lot of effort into that. Haha. I love it! It's just way too slow for the sort of system I build and is why I was thinking of that. Still, at tens to hundreds of items per second, I think even 10 turtles on a wall would struggle.
gezepi #28
Posted 01 June 2014 - 05:56 PM
Thanks for the kind words, and looking back at the video I realize it's really quite bad so sorry about that.

As for multiple turtles, I do have that running now. It doesn't try to optimize which turtle goes where, but it speeds everything up a lot. Only problem is I need to fix my goto function so it doesn't crash when they start colliding with each other. Shouldn't be too bad, I just haven't put the time into it.

There are some big upgrades in the works but, as always, they are slow coming. Next time I think I'll make a pdf of how to set it up so the parts that need to be seen are actually legible.