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

Confused about lists

Started by ammybinks, 15 September 2013 - 03:02 PM
ammybinks #1
Posted 15 September 2013 - 05:02 PM
"Title:" Confused about lists
I have been building a program to send me items from my AE Network to my ender chest using MiscPeripherals ME Bridge and Chat Box. And I want to be able to say "send me stone", and as far as I know the ME Bridge will only take Item IDs rather than names, so I would have to have a reference to convert the string "stone" to the integer 1 to send to the Bridge. I'd rather not have to write a separate function for each item due to there being 1000s of items in FTB(which is what I'm using). So my thought would be that I could use tables to have the ID linked to the name. But I am still a bit confused with the general workings of tables, so can you edit tables while in the program? And how would you go about linking them up and pulling them out of the table as required? And can you hard wire the values in so that even if the program closes the table will still be saved?

Help with any one of these would be much appreciated.
Thanks :)/>
Bubba #2
Posted 15 September 2013 - 05:54 PM
Check out this thread. You can convert item names into ids.
ammybinks #3
Posted 15 September 2013 - 06:33 PM
That's great, but is there a way to integrate this into multiplayer without editing the server files? That would be alot of typing otherwise, and adding an entirely new mod just to find those IDs. I was thinking possibly a procedural system where whenever you add a new item you could pass the command to add it to the list.