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

[LUA] Advanced sorting trouble(Interactive Sorter)

Started by W00dyR, 13 May 2013 - 11:00 AM
W00dyR #1
Posted 13 May 2013 - 01:00 PM
SOLVED

Hey guys, I've been working on a sorting system which uses the interactive sorter massively :P/>

For those unfamiliar with it: http://www.computerc...peripherals-32/

Pretty much the script grabs my sorting data from my website (blanked out) which provides the information as such:


1 Stone 0
2 Grass 0
3 Dirt 0
4 Cobblestone 0

The first thing is the item ID, the second the name, and the 3rd the direction it should be moved in (by the interactive sorter). Now my problem is, whenever I have items pulled from a chest, into the sorter, using an "Autarchic Gate" from the Buildcraft 3 mod (energy pulser setting) the sorter cannot keep up. I set up some test messages and made it print when it has a match, not a match, and just when it messes up somehow. Now I havent got the last one yet, but when I put an item in, it SAIS it sorted it correctly, which, should make it move into the right direction, but that doesn't happen. It prints the message "Yesss" once, then spams the screen with "Nooo" (as many times as there are items in the script it grabbed from my website) and sorts the items into direction "3" (where it should go if its not a match). Now it spawns "Nooo" because it doesn't find a match with any of the other items, but thats not the problem. I can even make it print the right direction with a simple print(itemtable.loc) and it just wont sort it into that direction.

I was wondering if there is any way to make this system more reliable and make it keep up instead of it failing and not managing to sort anything right at all.

The script:


---
kurruk #2
Posted 13 May 2013 - 06:09 PM
Just use s.sort(direction) you don't need the id or the amount. I have make a storage system with them too and that is how i do it.
W00dyR #3
Posted 13 May 2013 - 06:17 PM
Just use s.sort(direction) you don't need the id or the amount. I have make a storage system with them too and that is how i do it.

I know I don't need them. But I want to use them, so I can sort different items, in different, custom, directions. I don't want all of my items to go into 1 direction :P/> And I use the amount because it is linked with other scripts which use the amount.
W00dyR #4
Posted 13 May 2013 - 07:14 PM
After trying to study but getting distracted: I got it working perfect.

Thanks for everyones usefull replies :)/>