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

open Peripherals and jabba barrel mod

Started by viking_petz, 24 August 2015 - 08:07 AM
viking_petz #1
Posted 24 August 2015 - 10:07 AM
Hi


I am new to the entire programing and forum using so Please bear with mee




I am trying to make a control room in my world where i want to read how much marterial i have at my holding bay in the cellar.




I want to use te get stored items command in lua it brings me alot of information but when i try to write a program it returns some kind of table and its random number



is there anyone that have a program already written that can take care of it and send information trough wired modem



Petz


Ps sorry if there is a thread already for the subjekt
Lyqyd #2
Posted 24 August 2015 - 03:35 PM
Moved to Ask a Pro.
KingofGamesYami #3
Posted 24 August 2015 - 04:23 PM
Use textutils.serialize and print that result instead of printing the table.


local tbl = whateverwayyougetthetable()
print( tbl ) --#prints table: #####
print( textutils.serialize( tbl ) ) --#prints the contents
viking_petz #4
Posted 24 August 2015 - 05:58 PM
King of Games Yami


You are awesome thanks

it works Next thing

Now i get all the information from the table like

mod_id
raw Name
Max size
dmg
qty
id
ore dict
display name
and name

is it possible to print only display name

and qty and prefferbel in that sequense.


there will proberly be more questions later. hope i will not be a nauseance

that code will that be able to print all tables ?? more for future coding ?

i want to try out sending the information from each computer instorage room and send it to a local computer in control room…
this i am gonna play around with and then ask question for this subjekt later


Have a nice eveing peps..

petz
H4X0RZ #5
Posted 24 August 2015 - 09:45 PM
//Offtopic

Are you German by any chance? I don't know any other language writing subject as "Subjekt".(maybe it's just bad spelling though)
Edited on 24 August 2015 - 07:46 PM
KingofGamesYami #6
Posted 24 August 2015 - 09:50 PM

print( tbl.display_name ) --#pretty sure it won't have a space in it, instead an underscore
print( tbl.qty )

--#Alternatively:
print( tbl[ "display_name" ] )
print( tbl[ "qty" ] )

Here's a tutorial on using tables

Textutils.serialize will be able to print any table as long as it does not contain functions. If it does, and you attempt to use textutls.serialize, you will get the error "Attempt to serialize type function".
viking_petz #7
Posted 27 August 2015 - 03:39 PM
Nope not german..

But Danish.



So i have gotten so fare.


a computer on the barrel sending information about name of content and the amount


In the receiving end a computer making a list but can i make a loop that makes the information or shall i have to code every single barrel to their uniq computer id ?


OFF Topic Oh and one important one.. is it possible to make computers being pushed my pistons and sticky pistons ( for a control panel for my secret entreance)

the code is on paste bin

code on the receiving computer = n75FBjsk i am coding every single code to the specifik id of a barrel its just a lot of repertitin. but i rather do that to have control over the order of things than having it easy with writing.

code on sending computer = iESQgcYB the id i am sending to will be the computer in head central



Plans or the future is to make a control room where i can get information on whats in the barrels and having a message telling me if i am low or not on a predifined amount. (individual to each barrel so coal can be one part and diamonds another another definations.

a progress chart of the different machines prefferbel in % (macherators furnaces etc) control of my upcomming neuclear plant.

something that tels mee amount of power used per day min craft day or similar and amount of eu in the rfsu on each floor in my facility.

and as much as i can put computers to use in.

Computer controlled doors in my mansion