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

Retrieving Wrong Data From A Table

Started by GamerNebulae, 30 August 2013 - 01:55 PM
GamerNebulae #1
Posted 30 August 2013 - 03:55 PM
Hello everyone!

I made a program for keeping track of my steel tanks that hold oil and fuel. If fuel gets below 90 percent and there is a sufficient supply of oil, it will make fuel. The problem is is that the data sometimes picks out the wrong data. The code is here: http://pastebin.com/pxNmD63q

Is there any way to prevent that? The strange thing is, it does it every other 2 times. I put a print in there and I would get these results (examples):

325675: 400000
367587: 400000
19: 20

The last values can represent the pressure and capacity of the valve of the steel tank. The mod used is OpenPeripherals and I used Wired Modems to connect to the steel tank valves.
CCJJSax #2
Posted 31 August 2013 - 04:01 PM
I'm probably going to be wayyyy off here. But I want to at least try and help since there hasn't been much response here.

but by the way you describe it with "it does it every other 2 times" hints to me as a syntax error. I ran into a similar issue where it wasn't calling a simple function at all and was getting lost. They way I fixed it was changed it from a function and put it in the main chunk, but that seems like it won't help you…. Maybe you can try to redefine some variables..

These are the best things I can think of. I'm still relatively new to LUA, so forgive me lol