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

Watch stored energy / worn

Started by GalactusX, 18 September 2012 - 11:02 AM
GalactusX #1
Posted 18 September 2012 - 01:02 PM
Hi mens!!!

I wonder if there is any way ComputerCraft, to see and record how much energy passes through a cable and / or is accumulated in an accumulator via ComputerCraft, I would create a program to make it easier to control the power supplied by on my server admins to users, in order to collect taxes for the energy expended to make the server a little roll playing.

Thanks for your attention
KaoS #2
Posted 18 September 2012 - 01:13 PM
try this MOD, use the IC2 sensor, I am not sure if it can sense how much current is travelling through the cable but maybe you can
GalactusX #3
Posted 18 September 2012 - 01:16 PM
the server where I play has this mod, but I still not clarified very well with all items there are endless XD
anyway, I'll try, and if I do, I'll share it with everyone. There are so many things I do not like where to start ..
KaoS #4
Posted 18 September 2012 - 01:27 PM
place a computer, place a sensor controller behind it, place a blank transmitting card in the controller and click new and then encode, the transmitter card will change colour, take it out and place a sensor with the transmitter card in it and an IC2 sensor card, also rename the sensor. then you use the ccSensors API to connect to the sensor and get the data, if you do not know how then feel free to ask
GalactusX #5
Posted 18 September 2012 - 01:34 PM
I hate to even ask, sorry for my ignorance, I have only been playing minecraft 2 weeks, and 1 at the industrial / ComputerCraft, but I like to experiment …
I read every post, every forum, and have not found anything regarding this topic, and learned to control a tortoise, a monitor, and communicate RedNet use and / or control other items, but in terms of control energy expended, used or accumulated, nothing
KaoS #6
Posted 18 September 2012 - 01:39 PM
What are you using to get energy? a nuke reactor, solar panels, furnace generator, geotheral power or bio gen? are you trying to auto deactivate your reactor when the storage is full? what is the plan here?
GalactusX #7
Posted 18 September 2012 - 01:54 PM
Well, my intention is to help my server admins to be able to control the energy supplied by the solar and nuclear cental, to see data on a monitor and then, to collect a "tax" for the energy spent by each user in his plot, in this way, it would give a more realistic server :)/>/>

I have more or less made ​​the interface to display data on multiple monitors in real time, with the distribution of menus to access the data / address spending power players, but of course, I need to know how acount the energy expended by those users .

It may seem very complicated life, but if I do something for someone, I like to do well, or die trying XD

could also be used by other users to control your spending in their homes if they have no plot in the city / spawn point
KaoS #8
Posted 18 September 2012 - 02:00 PM
what I would recommend is a prepaid system, they pay for 32K HV EU and you charge up enough MFSUs to hold hat power and tell them to enjoy, when I get home I will take a look at the IC2 sensor and see if I can work something out
GalactusX #9
Posted 18 September 2012 - 02:06 PM
Thank you very much for the help, I am investigating with what you said …
I have a survival map full of machines, computers and other artilujios, seems to have mounted a Media Markt store XD
KaoS #10
Posted 18 September 2012 - 02:15 PM
cool, the way I would do it is use many MFSUs in series, set them to output redstone when they are full, they always full up from the front to the back. set up a gate for it by placing a HV transformer after and before it, when you give redstone power to a transformer it flips, it then conducts in the opposite direction and reverses the transforming effect. because you will only be sending power in one direction when it is supplied with redstone signal it will stop the current

you link both transformers to one redstone wire with a not gate on one so that only one can be on and the other off. now it can only charge or release at a time so you cannot accidentally give them extra

place wires from each MFSU all linking into a bundled cable for one PC, include another wire to the controller for your gate

the computer knows how much power they have bought so it toggles the gate to charging mode and waits until enough wires have power to indicate that the specified number if MFSUs are charged, it then flips the gate again and you're ready to go
GalactusX #11
Posted 18 September 2012 - 02:30 PM
okey, and also learned to control from a computer bundled cables and enable / disable them as seemeth me, now I can only, or put 1 storage per user (would be the easiest), or set up a mechanism, by which, when a line accumulator receives the destination is full, cut the power, and record how many times he has had to completely fill your tank, this way would lead to better control of spending for each user, without having to wait or ask by their energy expenditure.

I hope I can carry out my little project :)/>/>
KaoS #12
Posted 18 September 2012 - 02:33 PM
exactly, I will still check if CCSensors can check current and get back to you though

I would put 2 storages per user so you can auto swap over when the first one needs to recharge
KaoS #13
Posted 19 September 2012 - 11:04 AM
I checked on my side, I'm running tekkit so I can't guarantee that I am on the latest CCSensors pack but on mine I could get the storage details of MSFUs and other storage packs. I can also get details on nuke reactors but cannot get current through a wire. sorry
Cranium #14
Posted 19 September 2012 - 05:03 PM
You can use a little math-jiggery to detect the amount of energy that will leave one of the MFSUs, then when it is NEAR empty, you can create the "bill", and then refill the MFSU completely using some other method.
KaoS #15
Posted 19 September 2012 - 05:18 PM
Yeah, that was the backup plan, but use 2 separate MFSUs so you can keep the flow constant while one is being emptied
GalactusX #16
Posted 20 September 2012 - 02:55 AM
Well, I can finally controlled the terminology in order to read the sensors efficiently (after watching many videos and browse more deeply about the forum), now I have, create a menu and most efficient hard for me to find a way able to "save" the data when the server is reset, because the server where I am, but has the odd minor fault is reset every 1 hour, to prevent massive lag.

How should do to save and read data correctly?
and, if possible, to save data in a table and re-load?

My idea is to create one overall menu to assign the sensors, and the other to display sensor data in question, in one computer program that would be assigned, and in another, which reads the data and displays, so there is no to close 20 times one computer session to see if the data is properly stored.

I aspire to be much knowing so little, but if I demand I can never evolve and improve myself :)/>/>
KaoS #17
Posted 20 September 2012 - 06:10 AM
post you current code and the table you make with your info and I will modify it to save to files
GalactusX #18
Posted 20 September 2012 - 10:48 AM
Well, thanks for the help, I'll fix some problems in my code (and leave it nice, because I have everything with blots and annotations, will try to put my text in English for better understanding of the world)

I hope not cause laughter of my poor knowledge of the language LUA :)/>/>
KaoS #19
Posted 20 September 2012 - 10:54 AM
haha, you have made 14 posts so far, no-one expects you to be a genius just yet
GalactusX #20
Posted 22 September 2012 - 07:43 AM
After spending a few days polishing the odd bug, here I show my work, I know it still has a long way, especially short code and learn to properly use tables and record and retrieve data. This is only the distribution of menus.

Sorry if something is not understood, I use the goole translator, appreciate any correction, thank you very much

http://pastebin.com/WvMMu8JP