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

Nuclear Reactor Touch Pannel Errors

Started by KingFlowy, 18 September 2013 - 12:28 PM
KingFlowy #1
Posted 18 September 2013 - 02:28 PM
Hey, today I saw this YouTube Video:
http://www.youtube.com/watch?v=3Y_AOYnumyE
I set up everything like in the Video described but im getting some Errors. Maybe some one can help me?

Errors:
From the Console (attached to the monitor): bios:337: [string "startup"]:52: 'then' expected
From the Reactor Computer: bios:337: [string "startup"]:20: 'eof' expected

I hope some one can help me because I really love this touch panel.


Thx
~Flowy
Lyqyd #2
Posted 18 September 2013 - 03:43 PM
Split into new topic.

Please post the code you're using on both computers.
KingFlowy #3
Posted 18 September 2013 - 05:14 PM
Thanks for moving.
Im using the Codes the guy made(http://pastebin.com/szEgkENc & http://pastebin.com/zS6PnQsp), just changed the things to my Computer ID's, Monitor position, etc.

Im using this on a multiplayer Server. Is that a problem?

Reactor:
Spoilerrednet.open("right") – set rednet side
console = 591 – enter ID of computer attached to the touch screen
nir = 592 – enter ID of computer attached to the Nuclear information reader
maxTemp = 5000
temp = 1000
rctrStatus = "off"

while true do
a,b = rednet.receive()
if a == console then
if b == "on" then
rs.setOutput("back", true)
rctrStatus = "on"
break
elseif b == "off" then
break
end
end
end

while true do
if temp >= maxTemp then
rs.setOutput("back", false)
– elseif temp >= 7500 then
– rs.setOutput("back" ,false)
end
a,b = rednet.receive()
if a == nir then
temp = tonumber( B)/>
elseif a == console then
if b == "maxTemp" then
rednet.send(console, "ping")
id, message = rednet.receive()
message = tonumber(message)
–if message < 7500 and
if id == console then
maxTemp = message
rednet.send(console, "true")
else
rednet.send(console, "false")
end
elseif b == "on" then
if temp < maxTemp then
rs.setOutput("back", true)
rednet.send(console, "true")
rctrStatus = "on"
print("On received")
else
rednet.send(console, "false")
end
elseif b == "off" then
rs.setOutput("back", false)
rednet.send(console, "true")
rctrStatus ="Off"
end
end
end



Console
Spoilerrednet.open("back") – Set Modem poition
mon = peripheral.wrap("left") –set Monitor Position
mon.setBackgroundColor(colors.black)
temp = 1
reactor = "Querying"
maxHeat = 1
output = "Querying"
timeLeft = "Querying"
tempPercent = "Querying"
adjustTemp = 5000
x,y = mon.getSize()
rednet.broadcast("ping")
reactorCom = 593 –enter reactor computer ID
maxStorageL = "1"
energyL = "1"
nir = 592 – enter Nuclear information reader ID



function display()
mon.setTextColor(colours.black)
if reactor == "false" then
mon.setBackgroundColor(colors.green)
rectr = "OFF"
elseif reactor == "true" then
mon.setBackgroundColor(colors.lime)
rectr = "ON"
else
rectr = "QRY"
mon.setBackgroundColor(colors.gray)
end
p = 1
for i = 1,3 do
mon.setCursorPos(x-5, p)
mon.write(" ")
p = p + 1
end
p = 0
mon.setCursorPos(x-4, 2)
mon.write(rectr)
mon.setBackgroundColor(colours.black)
mon.setTextColor(colors.lime)
mon.setCursorPos(x/3+1, y-2)
mon.write("Reactor Temp: "..tempPercent.."%")
mon.setCursorPos(1, y-1)
mon.write("0%")
mon.setCursorPos(x/2, y-1)
mon.write("50%")
mon.setCursorPos(x-3, y-1)
mon.write("100%")
if tempPercent == "Querying" –[[or tempPercent == 0 ]] then
mon.setCursorPos(1, y)
mon.write("Temprature Unknown… Querying")
elseif tempPercent/2 < 1 then
mon.setCursorPos(1, y)
mon.setBackgroundColor(colors.lime)
mon.write(" ")
mon.setBackgroundColor(colors.black)
else
for i = 1, tempPercent, 2 do
p = p + 1
mon.setCursorPos(p,y)
if p < x/4 then
mon.setBackgroundColor(colors.lime)
mon.write(" ")
mon.setBackgroundColor(colors.black)
elseif p < x/2 then
mon.setBackgroundColor(colors.green)
mon.write(" ")
mon.setBackgroundColor(colors.black)
elseif p < x/4*3 then
mon.setBackgroundColor(colors.orange)
mon.write(" ")
mon.setBackgroundColor(colors.black)
elseif p <= x then
mon.setBackgroundColor(colors.red)
mon.write(" ")
mon.setBackgroundColor(colors.black)
end
end
p = 0
end
end


local result
result = fs.exists("shutTemp")
if result == true then
file = io.open("shutTemp", "r")
shutTemp = file:read()
file:close()
elseif result == false then
shutTemp = 1000
end

local result
result = fs.exists("rctrStatus")
if result == true then
file = io.open("rctrStatus", "r")
reactor = file:read()
file:close()
if reactor == "true" then
rednet.send(reactorCom, "on")
elseif reactor == "false" then
rednet.send(reactorCom, "off")
end
elseif result == false then
rednet.send(reactorCom, "off")
end
while true do
display()
event, param1, param2, param3 = os.pullEvent()
if event == "rednet_message" then
if param2 == "heat" then
rednet.send(nir, "ping")
a,b = rednet.receive(.5)
temp = b
elseif param2 == "reactorPoweredB" then
rednet.send(nir, "ping")
a,b = rednet.receive(.5)
reactor = tostring( B)/>
file = fs.open("rctrStatus", "w")
file.write( B)/>
file:close()
elseif param2 == "maxHeat" then
rednet.send(nir, "ping")
a,b = rednet.receive(.5)
maxHeat = b
elseif param2 == "output" then
rednet.send(nir, "ping")
a,b = rednet.receive(.5)
output = b
elseif param2 == "timeLeft" then
rednet.send(nir, "ping")
a,b = rednet.receive(.5)
timeLeft = b –*0.00277778
elseif param2 == "energyL" then
rednet.send(nir, "ping")
a,b = rednet.receive(.5)
energyL = b
energyL = tonumber(energyL)
if energyL > 10000000 then
energyL = 10000000
end
elseif param2 == "maxStorageL" then
rednet.send(nir, "ping")
a,b = rednet.receive(.5)
maxStorageL = b
elseif param2 == "isSteam" then
rednet.send(nir, "ping")
a,b = rednet.receive(.5)
isSteam = b
end
mon.clear()
mon.setCursorPos(1,1)
mon.setTextColor(colors.lime)
if reactor == "true" then
mon.write("Reactor: ")
mon.setTextColor(colors.lime)
mon.write("ON")
mon.setTextColor(colors.lime)
elseif reactor == "false" then
mon.write("Reactor: ")
mon.setTextColor(colors.green)
mon.write("OFF")
mon.setTextColor(colors.lime)
else
mon.write("Reactor: "..reactor)
end
mon.setCursorPos(1,3)
tempPercent = temp / maxHeat
tempPercent = tempPercent*100
tempPercent = math.floor(tempPercent)
mon.write("Reactor Temp: "..temp.."c")
mon.setCursorPos(1,5)
mon.write("EU Output: "..output)
mon.setCursorPos(1,7)
mon.write("Fuel: "..timeLeft)
mon.setCursorPos(1,9)
mon.write("Shutdown Temp: "..shutTemp)
mon.setCursorPos(21, 1)
mfsuE = tonumber(energyL)
mfsuEL = tonumber(maxStorageL)
if mfsuE == mfsuEL then
mon.write("MFSU: 100%")
else
mfsuPercent = mfsuE / mfsuEL
mfsuPercent = mfsuPercent*100
mfsuPercent = math.floor(mfsuPercent)
mon.write("MFSU: "..mfsuPercent.."%")
end
mon.setCursorPos(21, 3)
mon.write("EU: "..mfsuE)
elseif event == "monitor_touch" then
if param2 > x-6 and param3 < 4 then
if reactor == "false" then
rednet.send(reactorCom, "on")
elseif reactor == "true" then
rednet.send(reactorCom, "off")
end
j,k = rednet.receive()
if j == reactorCom and k == "false" then
for i = 1,4 do
mon.setBackgroundColor(colors.red)
mon.clear()
mon.setTextScale(4)
mon.setTextColor(colors.black)
mon.setCursorPos(1, 2)
mon.write("OVERHEATING!")
os.sleep(.5)
mon.clear()
mon.setTextColor(colors.red)
mon.setBackgroundColor(colors.black)
mon.setCursorPos(1, 2)
mon.write("OVERHEATING!")
os.sleep(.5)
end
end
mon.setTextScale(1)
mon.setBackgroundColor(colors.black)
mon.setTextColor(colors.lime)
rednet.broadcast("ping")
elseif param3 == y then –and param2 * 2 * 100 < 7500 then
adjustTemp = param2 * 2 * 100
mon.setCursorPos(param2, param3)
mon.setBackgroundColor(1)
mon.write(" ")
mon.setBackgroundColor(colors.black)
rednet.send(reactorCom, "maxTemp")
id, message = rednet.receive()
if id == reactorCom then
adjustTemp = tostring(adjustTemp)
rednet.send(reactorCom, adjustTemp)
id, message = rednet.receive()
if message == "true" and id == reactorCom then
shutTemp = adjustTemp
file = fs.open("shutTemp", "w")
file.write(shutTemp)
file:close()
elseif message == "false" and id == reactorCom then
mon.setCursorPos(1,y)
for i = 1,x do
mon.write(" ")
end
mon.setCursorPos(1,y)
mon.write("Max Temp Failed To Update!")
end
end
end
end
end

~Flowy
kreezxil #4
Posted 18 September 2013 - 10:06 PM
take out
 --[[or tempPercent == 0 ]] 
from line 51 on the computer program. It is probably not an entirely legal comment on your version of craftOS.

Based on the code I'm seeing I'm having a hard time believing you that there is an error on line 20 of the reactor program. Can you please run it and verify that line 20 is the culprit still then pastebin to us that code, don't show us the original code from the original author, we need to see your code. If you don't know you can use the pastebin command to put your code on pastebin and it will give you a link at the prompt you can copy here. Use
pastebin put <program>
.
KingFlowy #5
Posted 19 September 2013 - 07:30 AM
take out
 --[[or tempPercent == 0 ]] 
from line 51 on the computer program. It is probably not an entirely legal comment on your version of craftOS.

Based on the code I'm seeing I'm having a hard time believing you that there is an error on line 20 of the reactor program. Can you please run it and verify that line 20 is the culprit still then pastebin to us that code, don't show us the original code from the original author, we need to see your code. If you don't know you can use the pastebin command to put your code on pastebin and it will give you a link at the prompt you can copy here. Use
pastebin put <program>
.

Hey, Thx for answering. Console works now fine, great.
But Reactor Computer still not. Yes it is line 20.
But is it maybe because I did not filled up the Reactor since now? Because I just wanted everything to work first.

I can't pastebin because im using it on a multiplayer Server which doesn't support it…

Thx for helping
~Flowy
kreezxil #6
Posted 19 September 2013 - 01:25 PM
take out
 --[[or tempPercent == 0 ]] 
from line 51 on the computer program. It is probably not an entirely legal comment on your version of craftOS.

Based on the code I'm seeing I'm having a hard time believing you that there is an error on line 20 of the reactor program. Can you please run it and verify that line 20 is the culprit still then pastebin to us that code, don't show us the original code from the original author, we need to see your code. If you don't know you can use the pastebin command to put your code on pastebin and it will give you a link at the prompt you can copy here. Use
pastebin put <program>
.

Hey, Thx for answering. Console works now fine, great.
But Reactor Computer still not. Yes it is line 20.
But is it maybe because I did not filled up the Reactor since now? Because I just wanted everything to work first.

I can't pastebin because im using it on a multiplayer Server which doesn't support it…

Thx for helping
~Flowy
So it's not possible to get your admin to consider enabling it? It is enabled on my world which is blacklisted ie Public, look in my sig.

Ok, I copy and pasted your reactor code into my notepad++, set it to lua and discovered some things right off bat.
  1. we need to use local declaration for variable initialization unless we are needing those variables to be accessible to other programs running on the computer. You have
    console = 591 -- enter ID of computer attached to the touch screen	
    	nir = 592 -- enter ID of computer attached to the Nuclear information reader	
    	maxTemp = 5000	
    	temp = 1000	
    	rctrStatus = "off"	
    	
    so let's instead try
    local console = 591 -- enter ID of computer attached to the touch screen	
    	local nir = 592 -- enter ID of computer attached to the Nuclear information reader	
    	local maxTemp = 5000	
    	local temp = 1000	
    	local rctrStatus = "off"	
    	
    The primary reason for doing that is to prevent accidental overriding of craftOS specific functions, programs and data that are essential for the proper operating of your programs.
  2. This is not on line 20 but I think it is the cause of all of your problems. Look on line 29 and tell me what you see? You should see a capital B where you should have a lowercase b. That can easily throw that error and your computercraft is confused because it is looking for a declaration of B and that's why it is throwing that error at line 20.
  3. One thing that will help to fix problems like these in the future is to not use short named variables. Let's consider that you are also not capturing enough variables with
    rednet.receive()
    as can be seen by this information from the wiki. senderID, message, distance-to-sender (or nil if using redpower bundled cable instead of a modem). What I suggest that instead of use
    a,b=rednet.receive()
    that you use instead
    ID,msg,distance = rednet.receive()
    that way it will be easier for you to debug the program in the future because you are using a self-documenting coding style. Also, if you want to throw out one of the variables use an underscore in place of it's name such that
    ID,msg,_ = rednet.receive()
    is valid. Similarly if you know that ID is constant you could throw it out too with
    _,msg,_=rednet.receive()
    thus eliminating what you have to test for and therefore making your logic cleaner.
KingFlowy #7
Posted 19 September 2013 - 02:35 PM
take out
 --[[or tempPercent == 0 ]] 
from line 51 on the computer program. It is probably not an entirely legal comment on your version of craftOS.

Based on the code I'm seeing I'm having a hard time believing you that there is an error on line 20 of the reactor program. Can you please run it and verify that line 20 is the culprit still then pastebin to us that code, don't show us the original code from the original author, we need to see your code. If you don't know you can use the pastebin command to put your code on pastebin and it will give you a link at the prompt you can copy here. Use
pastebin put <program>
.

Hey, Thx for answering. Console works now fine, great.
But Reactor Computer still not. Yes it is line 20.
But is it maybe because I did not filled up the Reactor since now? Because I just wanted everything to work first.

I can't pastebin because im using it on a multiplayer Server which doesn't support it…

Thx for helping
~Flowy
So it's not possible to get your admin to consider enabling it? It is enabled on my world which is blacklisted ie Public, look in my sig.

Ok, I copy and pasted your reactor code into my notepad++, set it to lua and discovered some things right off bat.
  1. we need to use local declaration for variable initialization unless we are needing those variables to be accessible to other programs running on the computer. You have
    console = 591 -- enter ID of computer attached to the touch screen	
    		nir = 592 -- enter ID of computer attached to the Nuclear information reader	
    		maxTemp = 5000	
    		temp = 1000	
    		rctrStatus = "off"	
    		
    so let's instead try
    local console = 591 -- enter ID of computer attached to the touch screen	
    		local nir = 592 -- enter ID of computer attached to the Nuclear information reader	
    		local maxTemp = 5000	
    		local temp = 1000	
    		local rctrStatus = "off"	
    		
    The primary reason for doing that is to prevent accidental overriding of craftOS specific functions, programs and data that are essential for the proper operating of your programs.
  2. This is not on line 20 but I think it is the cause of all of your problems. Look on line 29 and tell me what you see? You should see a capital B where you should have a lowercase b. That can easily throw that error and your computercraft is confused because it is looking for a declaration of B and that's why it is throwing that error at line 20.
  3. One thing that will help to fix problems like these in the future is to not use short named variables. Let's consider that you are also not capturing enough variables with
    rednet.receive()
    as can be seen by this information from the wiki. senderID, message, distance-to-sender (or nil if using redpower bundled cable instead of a modem). What I suggest that instead of use
    a,b=rednet.receive()
    that you use instead
    ID,msg,distance = rednet.receive()
    that way it will be easier for you to debug the program in the future because you are using a self-documenting coding style. Also, if you want to throw out one of the variables use an underscore in place of it's name such that
    ID,msg,_ = rednet.receive()
    is valid. Similarly if you know that ID is constant you could throw it out too with
    _,msg,_=rednet.receive()
    thus eliminating what you have to test for and therefore making your logic cleaner.

No, the server Owner will not activate pastebin. :(/>

1 - Didn't work… :(/>
2 - it is a small b…
3 - I have to say that I'm not good in CC. The whole Code is by the YouTuber him self.

I hope you have an other Idea to help… :(/>
KingFlowy #8
Posted 19 September 2013 - 03:11 PM
Spoiler
take out
 --[[or tempPercent == 0 ]] 
from line 51 on the computer program. It is probably not an entirely legal comment on your version of craftOS.

Based on the code I'm seeing I'm having a hard time believing you that there is an error on line 20 of the reactor program. Can you please run it and verify that line 20 is the culprit still then pastebin to us that code, don't show us the original code from the original author, we need to see your code. If you don't know you can use the pastebin command to put your code on pastebin and it will give you a link at the prompt you can copy here. Use
pastebin put <program>
.
Hey, Thx for answering. Console works now fine, great.
But Reactor Computer still not. Yes it is line 20.
But is it maybe because I did not filled up the Reactor since now? Because I just wanted everything to work first.

I can't pastebin because im using it on a multiplayer Server which doesn't support it…

Thx for helping
~Flowy
So it's not possible to get your admin to consider enabling it? It is enabled on my world which is blacklisted ie Public, look in my sig.

Ok, I copy and pasted your reactor code into my notepad++, set it to lua and discovered some things right off bat.
  1. we need to use local declaration for variable initialization unless we are needing those variables to be accessible to other programs running on the computer. You have
    console = 591 -- enter ID of computer attached to the touch screen	
    				nir = 592 -- enter ID of computer attached to the Nuclear information reader	
    				maxTemp = 5000	
    				temp = 1000	
    				rctrStatus = "off"	
    				
    so let's instead try
    local console = 591 -- enter ID of computer attached to the touch screen	
    				local nir = 592 -- enter ID of computer attached to the Nuclear information reader	
    				local maxTemp = 5000	
    				local temp = 1000	
    				local rctrStatus = "off"	
    				
    The primary reason for doing that is to prevent accidental overriding of craftOS specific functions, programs and data that are essential for the proper operating of your programs.
  2. This is not on line 20 but I think it is the cause of all of your problems. Look on line 29 and tell me what you see? You should see a capital B where you should have a lowercase b. That can easily throw that error and your computercraft is confused because it is looking for a declaration of B and that's why it is throwing that error at line 20.
  3. One thing that will help to fix problems like these in the future is to not use short named variables. Let's consider that you are also not capturing enough variables with
    rednet.receive()
    as can be seen by this information from the wiki. senderID, message, distance-to-sender (or nil if using redpower bundled cable instead of a modem). What I suggest that instead of use
    a,b=rednet.receive()
    that you use instead
    ID,msg,distance = rednet.receive()
    that way it will be easier for you to debug the program in the future because you are using a self-documenting coding style. Also, if you want to throw out one of the variables use an underscore in place of it's name such that
    ID,msg,_ = rednet.receive()
    is valid. Similarly if you know that ID is constant you could throw it out too with
    _,msg,_=rednet.receive()
    thus eliminating what you have to test for and therefore making your logic cleaner.
OH MY GOSH!

I fixed it. I just took line 20 out and remove from line 19 to 17 1 space.
so I changed it from:
break
end
end
end
end

to:
break
end
end
end

-.-"

THX A LOT kreezxil for helping. You are awesome. ;)/>
kreezxil #9
Posted 19 September 2013 - 07:35 PM
No problem, any time mate.
KingFlowy #10
Posted 22 September 2013 - 10:03 PM
I got another Problem…. Everything worked fine now for some days. But since Yesterday when i Start mich Touch Panel Computer i get this Error:

startup:168: attempt to cancatenate string and nil

When I terminate the NIL Computer it works and is showing Querying like it should.
But when i start the NIL Computer after this, the Console Computer is showing the Error.
Any Ideas?

Codes for Console is in the first post.
Code for NIL Computer:
Spoilerrednet.open("back") –Set Position of the modem on the computer
nir = peripheral.wrap("bottom") –Set position of the NIR on the computer

temp = "Querying"
reactor = "querying"
reactorCom = 593 – enter ID of Computer attached to the Reactor
console = 591 – Enter ID of the Computer attached to the Touch Screen


while true do
dud1, dud2, card, info = nir.get(1)
for system, status in pairs(info) do
rednet.send(console, system)
ping = rednet.receive()
if ping == console then
status = tostring(status)
term.clear()
term.setCursorPos(1,1)
rednet.send(console, status)
end
if system == "heat" then
rednet.send(reactorCom, status)
end
end
dud1, dud2, card, info = nir.get(2)
for system, status in pairs(info) do
rednet.send(console, system)
ping = rednet.receive()
if ping == console then
status = tostring(status)
rednet.send(console, status)
end
end
os.sleep(2)
end
kreezxil #11
Posted 23 September 2013 - 12:00 PM
that error is telling you that in the file called "startup" on line 168, you are attempting to combine a string and a nil value.

that means now you are going to have to post your startup file. also please start using pastebin, it's annoying when the thread gets long and you have scroll lines and lines of code to read the newest replies. If you can't at least do that at least wrap it all in spoiler tags, just like you do for code but write the word spoiler instead of the word code.

Also if forum editor is nuking your formatting, you will have to take the time to put all indentation back in manually.
KingFlowy #12
Posted 23 September 2013 - 01:30 PM
that error is telling you that in the file called "startup" on line 168, you are attempting to combine a string and a nil value.

that means now you are going to have to post your startup file. also please start using pastebin, it's annoying when the thread gets long and you have scroll lines and lines of code to read the newest replies. If you can't at least do that at least wrap it all in spoiler tags, just like you do for code but write the word spoiler instead of the word code.

Also if forum editor is nuking your formatting, you will have to take the time to put all indentation back in manually.

Ok, thanks for the reply.
At first, I put some spoilers in, hope they are enough. ;)/>
What Code do you need? The Code from the startup of the Console Computer?

Thx
~Flowy
kreezxil #13
Posted 23 September 2013 - 02:55 PM
Yes, we will need the file that is complaining about the error in order for us to help you find what the cause of the problem is.
KingFlowy #14
Posted 23 September 2013 - 07:36 PM
Yes, we will need the file that is complaining about the error in order for us to help you find what the cause of the problem is.

Console Code (has the Error):
Spoilerrednet.open("back") – Set Modem poition
mon = peripheral.wrap("left") –set Monitor Position
mon.setBackgroundColor(colors.black)
temp = 1
reactor = "Querying"
maxHeat = 1
output = "Querying"
timeLeft = "Querying"
tempPercent = "Querying"
adjustTemp = 5000
x,y = mon.getSize()
rednet.broadcast("ping")
reactorCom = 593 –enter reactor computer ID
maxStorageL = "1"
energyL = "1"
nir = 592 – enter Nuclear information reader ID



function display()
mon.setTextColor(colours.black)
if reactor == "false" then
mon.setBackgroundColor(colors.green)
rectr = "OFF"
elseif reactor == "true" then
mon.setBackgroundColor(colors.lime)
rectr = "ON"
else
rectr = "QRY"
mon.setBackgroundColor(colors.gray)
end
p = 1
for i = 1,3 do
mon.setCursorPos(x-5, p)
mon.write(" ")
p = p + 1
end
p = 0
mon.setCursorPos(x-4, 2)
mon.write(rectr)
mon.setBackgroundColor(colours.black)
mon.setTextColor(colors.lime)
mon.setCursorPos(x/3+1, y-2)
mon.write("Reactor Temp: "..tempPercent.."%")
mon.setCursorPos(1, y-1)
mon.write("0%")
mon.setCursorPos(x/2, y-1)
mon.write("50%")
mon.setCursorPos(x-3, y-1)
mon.write("100%")
if tempPercent == "Querying" then
mon.setCursorPos(1, y)
mon.write("Temprature Unknown… Querying")
elseif tempPercent/2 < 1 then
mon.setCursorPos(1, y)
mon.setBackgroundColor(colors.lime)
mon.write(" ")
mon.setBackgroundColor(colors.black)
else
for i = 1, tempPercent, 2 do
p = p + 1
mon.setCursorPos(p,y)
if p < x/4 then
mon.setBackgroundColor(colors.lime)
mon.write(" ")
mon.setBackgroundColor(colors.black)
elseif p < x/2 then
mon.setBackgroundColor(colors.green)
mon.write(" ")
mon.setBackgroundColor(colors.black)
elseif p < x/4*3 then
mon.setBackgroundColor(colors.orange)
mon.write(" ")
mon.setBackgroundColor(colors.black)
elseif p <= x then
mon.setBackgroundColor(colors.red)
mon.write(" ")
mon.setBackgroundColor(colors.black)
end
end
p = 0
end
end


local result
result = fs.exists("shutTemp")
if result == true then
file = io.open("shutTemp", "r")
shutTemp = file:read()
file:close()
elseif result == false then
shutTemp = 1000
end

local result
result = fs.exists("rctrStatus")
if result == true then
file = io.open("rctrStatus", "r")
reactor = file:read()
file:close()
if reactor == "true" then
rednet.send(reactorCom, "on")
elseif reactor == "false" then
rednet.send(reactorCom, "off")
end
elseif result == false then
rednet.send(reactorCom, "off")
end
while true do
display()
event, param1, param2, param3 = os.pullEvent()
if event == "rednet_message" then
if param2 == "heat" then
rednet.send(nir, "ping")
a,b = rednet.receive(.5)
temp = b
elseif param2 == "reactorPoweredB" then
rednet.send(nir, "ping")
a,b = rednet.receive(.5)
reactor = tostring( B)/>
file = fs.open("rctrStatus", "w")
file.write( B)/>
file:close()
elseif param2 == "maxHeat" then
rednet.send(nir, "ping")
a,b = rednet.receive(.5)
maxHeat = b
elseif param2 == "output" then
rednet.send(nir, "ping")
a,b = rednet.receive(.5)
output = b
elseif param2 == "timeLeft" then
rednet.send(nir, "ping")
a,b = rednet.receive(.5)
timeLeft = b –*0.00277778
elseif param2 == "energyL" then
rednet.send(nir, "ping")
a,b = rednet.receive(.5)
energyL = b
energyL = tonumber(energyL)
if energyL > 10000000 then
energyL = 10000000
end
elseif param2 == "maxStorageL" then
rednet.send(nir, "ping")
a,b = rednet.receive(.5)
maxStorageL = b
elseif param2 == "isSteam" then
rednet.send(nir, "ping")
a,b = rednet.receive(.5)
isSteam = b
end
mon.clear()
mon.setCursorPos(1,1)
mon.setTextColor(colors.lime)
if reactor == "true" then
mon.write("Reactor: ")
mon.setTextColor(colors.lime)
mon.write("ON")
mon.setTextColor(colors.lime)
elseif reactor == "false" then
mon.write("Reactor: ")
mon.setTextColor(colors.green)
mon.write("OFF")
mon.setTextColor(colors.lime)
else
mon.write("Reactor: "..reactor)
end
mon.setCursorPos(1,3)
tempPercent = temp / maxHeat
tempPercent = tempPercent*100
tempPercent = math.floor(tempPercent)
mon.write("Reactor Temp: "..temp.."c")
mon.setCursorPos(1,5)
mon.write("EU Output: "..output)
mon.setCursorPos(1,7)
mon.write("Fuel: "..timeLeft)
mon.setCursorPos(1,9)
mon.write("Shutdown Temp: "..shutTemp)
mon.setCursorPos(21, 1)
mfsuE = tonumber(energyL)
mfsuEL = tonumber(maxStorageL)
if mfsuE == mfsuEL then
mon.write("MFSU: 100%")
else
mfsuPercent = mfsuE / mfsuEL
mfsuPercent = mfsuPercent*100
mfsuPercent = math.floor(mfsuPercent)
mon.write("MFSU: "..mfsuPercent.."%")
end
mon.setCursorPos(21, 3)
mon.write("EU: "..mfsuE)
elseif event == "monitor_touch" then
if param2 > x-6 and param3 < 4 then
if reactor == "false" then
rednet.send(reactorCom, "on")
elseif reactor == "true" then
rednet.send(reactorCom, "off")
end
j,k = rednet.receive()
if j == reactorCom and k == "false" then
for i = 1,4 do
mon.setBackgroundColor(colors.red)
mon.clear()
mon.setTextScale(4)
mon.setTextColor(colors.black)
mon.setCursorPos(1, 2)
mon.write("OVERHEATING!")
os.sleep(.5)
mon.clear()
mon.setTextColor(colors.red)
mon.setBackgroundColor(colors.black)
mon.setCursorPos(1, 2)
mon.write("OVERHEATING!")
os.sleep(.5)
end
end
mon.setTextScale(1)
mon.setBackgroundColor(colors.black)
mon.setTextColor(colors.lime)
rednet.broadcast("ping")
elseif param3 == y then –and param2 * 2 * 100 < 7500 then
adjustTemp = param2 * 2 * 100
mon.setCursorPos(param2, param3)
mon.setBackgroundColor(1)
mon.write(" ")
mon.setBackgroundColor(colors.black)
rednet.send(reactorCom, "maxTemp")
id, message = rednet.receive()
if id == reactorCom then
adjustTemp = tostring(adjustTemp)
rednet.send(reactorCom, adjustTemp)
id, message = rednet.receive()
if message == "true" and id == reactorCom then
shutTemp = adjustTemp
file = fs.open("shutTemp", "w")
file.write(shutTemp)
file:close()
elseif message == "false" and id == reactorCom then
mon.setCursorPos(1,y)
for i = 1,x do
mon.write(" ")
end
mon.setCursorPos(1,y)
mon.write("Max Temp Failed To Update!")
end
end
end
end
end

Nuclear Information Reader Code:
Spoilerrednet.open("back") –Set Position of the modem on the computer
nir = peripheral.wrap("bottom") –Set position of the NIR on the computer

temp = "Querying"
reactor = "querying"
reactorCom = 593 – enter ID of Computer attached to the Reactor
console = 591 – Enter ID of the Computer attached to the Touch Screen


while true do
dud1, dud2, card, info = nir.get(1)
for system, status in pairs(info) do
rednet.send(console, system)
ping = rednet.receive()
if ping == console then
status = tostring(status)
term.clear()
term.setCursorPos(1,1)
rednet.send(console, status)
end
if system == "heat" then
rednet.send(reactorCom, status)
end
end
dud1, dud2, card, info = nir.get(2)
for system, status in pairs(info) do
rednet.send(console, system)
ping = rednet.receive()
if ping == console then
status = tostring(status)
rednet.send(console, status)
end
end
os.sleep(2)
end

Reactor Code:
Spoilerrednet.open("right") – set rednet side
console = 591 – enter ID of computer attached to the touch screen
nir = 592 – enter ID of computer attached to the Nuclear information reader
maxTemp = 5000
temp = 1000
rctrStatus = "off"

while true do
a,b = rednet.receive()
if a == console then
if b == "on" then
rs.setOutput("back", true)
rctrStatus = "on"
break
elseif b == "off" then
break
end
end
end

while true do
if temp >= maxTemp then
rs.setOutput("back", false)
– elseif temp >= 7500 then
– rs.setOutput("back" ,false)
end
a,b = rednet.receive()
if a == nir then
temp = tonumber( B)/>
elseif a == console then
if b == "maxTemp" then
rednet.send(console, "ping")
id, message = rednet.receive()
message = tonumber(message)
–if message < 7500 and
if id == console then
maxTemp = message
rednet.send(console, "true")
else
rednet.send(console, "false")
end
elseif b == "on" then
if temp < maxTemp then
rs.setOutput("back", true)
rednet.send(console, "true")
rctrStatus = "on"
print("On received")
else
rednet.send(console, "false")
end
elseif b == "off" then
rs.setOutput("back", false)
rednet.send(console, "true")
rctrStatus ="Off"
end
end
end

Thx
~ Flowy
kreezxil #15
Posted 24 September 2013 - 10:30 AM
What about startup? Also when you post code put in code tags inside of spoiler tags and take the time to re-indent it if it got messed up. If happen to code with indenting, do us all a favor and indent. Indenting is the first rule of debugging code as it helps us verify the logical structures of the program at a glance.

Also, after looking at your OP it looks like both of your errors are related to something in your "startup" script. please put that file up as I don't see it.
KingFlowy #16
Posted 24 September 2013 - 01:47 PM
These are the startup Files of all PC'S
kreezxil #17
Posted 24 September 2013 - 03:39 PM
Seriously, you don't have one called "startup"? Because that's the what the error is referencing.
KingFlowy #18
Posted 24 September 2013 - 10:22 PM
this is the startup. I just did edit startup on the pc and put in my code…. :S