14 posts
Posted 07 June 2012 - 08:07 AM
On Ic2 Nuclear Control How Can You Do This:
Lets Say A Redstone Current Comes To The Computer So, How Can You Make That Control A Monitor
Redstone Inputs:
Back
Right
Bottom
How Can You Make It Show Up This:
Back = print("2000")
Right = print("4000")
Bottom = print("6000")
On Montior With Size Of Text Big?
=============================
Nuclear Reactor Heat:
(Number Here)
=============================
Can You Try To Make A Code For Me?
-musicgac
34 posts
Posted 07 June 2012 - 09:55 AM
local heat = nil
os.pullEvent("redstone")
if rs.getInput("back") and heat = nil then
heat = 2000
elseif rs.getInput("right") and heat = 2000 then
heat = 4000
elseif rs.getInput("bottom") then
heat = 6000
end
monitor = peripheral.wrap(<side>) --replace <side> with the side of the monitor
term.redirect(monitor) --set output to monitor
print("==================")
print("Nuclear reactor heat:")
print(heat)
print("==================")
term.restore() --set the input back to the console
Don't have a computer with cc right now, but I think it should work.Oh, and btw, it's a bit annoying if you start every word with capital letters.
14 posts
Posted 26 June 2012 - 07:53 AM
Sorry, well do you need to have ccsensors?
14 posts
Posted 26 June 2012 - 07:59 AM
Don't have a computer with cc right now, but I think it should work.Oh, and btw, it's a bit annoying if you start every word with capital letters.
Ok ill try not to it is a habbit
14 posts
Posted 26 June 2012 - 08:40 AM
It Says "bios:206: [string "test"]:3: 'then' expected
(I Named The Program Test)
8543 posts
Posted 26 June 2012 - 06:49 PM
Lines three and five should have heat == instead of heat =.
14 posts
Posted 01 July 2012 - 04:44 PM
It does not work because the "heat" does not change it will stay at 2000, and can you make it in a loop?
8543 posts
Posted 01 July 2012 - 06:15 PM
Yes, you can. Just use a while loop.
14 posts
Posted 02 July 2012 - 02:38 AM
How about the "heat" not changing? it stays at 2000
8543 posts
Posted 02 July 2012 - 06:05 AM
These lines should be in this order, not the other way around.
local heat = nil
while true do
Though, with that code, it won't change back down.
local heat = 0
term.redirect(peripheral.wrap("right"))
--change "right" to whichever side the monitor is actually on
while true do
os.pullEvent("redstone")
if rs.getInput("back") and not rs.getInput("right") then
heat = 2000
elseif rs.getInput("right") and not rs.getInput("bottom") then
heat = 4000
elseif rs.getInput("bottom")
heat = 6000
end
term.clear()
term.setCursorPos(1, 1)
print("Reactor heat: "..heat)
end
14 posts
Posted 02 July 2012 - 05:15 PM
thx so much! =D
463 posts
Location
Germany
Posted 02 July 2012 - 06:03 PM
there is still an error:
elseif rs.getInput("bottom")
has to be
elseif rs.getInput("bottom") then
14 posts
Posted 04 July 2012 - 11:20 PM
Thanks Andora I Just Automanicly Put It In =D