76 posts
Posted 28 April 2014 - 06:29 PM
Hi all, I have been looking into using CC for a few things, and one of those things is a fluid counter, Im on FTB Ultimate and as such have miscperipherals at my disposal.
I have not been able to get this to work yet, hoping someone can help me figure out what im doing wrong.
http://pastebin.com/Hh5gqpfv/it is a modification of
this using the nuclear information reader
i am getting an attempt to index error at line 72 which is when the program tries to send the information to another computer via rednet messaging
the only thing I can think it could be is that my if/elseif/then statements that change the transmit channel are not being held for line 72 to use.
please help.
Edited on 28 April 2014 - 04:39 PM
8543 posts
Posted 28 April 2014 - 06:41 PM
The error in this case means you aren't wrapping the modem successfully. Your code has both the modem and a redstone output on the left side, which is impossible. Fix the modem wrapping statement to use the side the modem is actually on, or iterate the sides and autodetect where it is.
1852 posts
Location
Sweden
Posted 28 April 2014 - 06:57 PM
The error in this case means you aren't wrapping the modem successfully. Your code has both the modem and a redstone output on the left side, which is impossible. Fix the modem wrapping statement to use the side the modem is actually on, or iterate the sides and autodetect where it is.
Well that's actually false, Yes it may be like this in the current state that it's impossible the way he's doing it, but it isn't impossible since you can use wired modems, and I'm not sure about the redstone output though but there may be some way.
And the way Lyqyd meant with iterating through the sides
function findModem()
for _, side in pairs( rs.getSides() ) do
if peripheral.getType( side ) == "modem" then
return side
end
end
end
Edited on 28 April 2014 - 05:04 PM
8543 posts
Posted 28 April 2014 - 07:50 PM
What on earth are you talking about? You can't output redstone on a side that already has a peripheral. Wired modems don't change that at all.
1852 posts
Location
Sweden
Posted 28 April 2014 - 09:04 PM
What on earth are you talking about? You can't output redstone on a side that already has a peripheral. Wired modems don't change that at all.
Well I thought there might be a way with some peripheral or something, But don't blame me too much since I was kinda tired when I posted that and it's never good to post when you're tired :P/>
1281 posts
Posted 28 April 2014 - 09:07 PM
Even if there is, there's no peripheral that connects via cable, which is then called via the side of the modem though… It'd be something like "peripheral_0".
Edited on 28 April 2014 - 07:07 PM
76 posts
Posted 29 April 2014 - 02:01 PM
thanks for that, didnt realise that lol, now im getting the same problem at line 19, ive changed a couple of things so heres the new code
http://pastebin.com/QhNMetLeit might be worth my while if you could just have a quick nosey at the whole lot
thanks in advance
1281 posts
Posted 29 April 2014 - 03:34 PM
That would mean that data is nil. Idk what nir.get(1) returns, but chances are it dosen't return 4 variables.
76 posts
Posted 30 April 2014 - 10:15 AM
its a nuclear information reader grabbing info from a liquid sensor card it has 4 variables, 1-UUID (Cards name) 2-Status (for debug more than anything) 3- Title (you can name certain cards) and 4- Sensor info (Table)
this prgram checks the level of fluid in a tank, and if its below a preset amount (25%) it sends a redstone signal (turning on a Tesseract to refill) it also sends the information to a central computer used to keep an eye on all fluid levels that I monitor (Lava, Oil, Fuel and water). I will eventually be trying to link all of this into a banking system, charging people for using the infrastructure that I supply, and as such effectively starting a realistic town scenario, people will pay rent (calculated per irl day) they will pay for fuel (if they need it) and oil (also if they need it) as well as lava (again, if they need it) and even power, based on consumption.
76 posts
Posted 02 May 2014 - 07:34 AM
Ok this is getting annoying, I am now not getting any error messages, but the program just terminates instantly, this is supposed to run in a constant loop.
I hate Ultimate not having openPeripherals, would make life so much easier, it seems that miscPeripherals has really limited support, from both the devs and from public. I thought it would be just a simple swap over, change a couple of values and bobs your mothers brother, but this is now no longer fun…
if you want to test this out on your system and try and fault find, the server program is found
here and my most recent upload is still
hereThanks
76 posts
Posted 02 May 2014 - 09:23 AM
I figured out what was causing all my problems, A) there was no loop initialised, I just slapped a while true do after assigning my variables and B)/> the line that checks if the level had changed was throwing a concatinating error if the level hadnt changed, so deleted it and just made it sleep for half a second, its all working now, just gotta pull it down from pastebin to all my computers running the program lol
thanks for your help guys