Posted 18 October 2014 - 12:58 AM
Hi, im new to the forums, but not ComputerCraft, however lets start :)/>
So to start off im rewriting a script for CC that works with BigReactors, it first was to simply display info about the Reactor on the monitor above the PC, but then i thought i can maybe add two touch buttons to the monitor that let me toggle the state of the reactor with "reactor.setActive(true/false)", however what ever i try to do it tells me to "end" the line, but i tried alot of ends, from one end to five ends and on many different places, so i now need some help, it would be appreciated, thanks in advance.
local reactor1 = peripheral.wrap("BigReactors-Reactor_1")
local mon = peripheral.wrap("top")
mon.clear()
– Begin Reactor 1
–mon.setCursorPos(1,1)
–mon.setTextColor(colors.white)
–mon.write("Reactor #: ")
–mon.setTextColor(colors.lime)
–mon.write("1")
mon.setCursorPos(1,1)
mon.setTextColor(colors.white)
mon.write("Active: ")
mon.setTextColor(colors.lime)
mon.write(reactor1.getActive())
mon.setCursorPos(1,2)
mon.setTextColor(colors.white)
mon.write("RF/T: ")
mon.setTextColor(colors.lime)
mon.write(math.floor(reactor1.getEnergyProducedLastTick()))
mon.setCursorPos(1,3)
mon.setTextColor(colors.white)
mon.write("Control Rods: ")
mon.setTextColor(colors.lime)
mon.write(math.floor(reactor1.getNumberOfControlRods()))
mon.setCursorPos(1,4)
mon.setTextColor(colors.white)
mon.write("RF Stored: ")
mon.setTextColor(colors.lime)
mon.write(math.floor(reactor1.getEnergyStored()))
mon.setCursorPos(1,5)
mon.setTextColor(colors.white)
mon.write("Casing Heat: ")
mon.setTextColor(colors.lime)
mon.write(math.floor(reactor1.getCasingTemperature()))
mon.setCursorPos(1,6)
mon.setTextColor(colors.white)
mon.write("Fuel Heat: ")
mon.setTextColor(colors.lime)
mon.write(math.floor(reactor1.getFuelTemperature()))
– End Reactor 1
function Clicks()
mon.setCursorPos(1,7)
print("ON")
mon.setCursorPos(1,8)
print("OFF")
end
function Pick()
while true do
event,side,x,y = os.pullEvent()
if event == "monitor_touch" then
if x == 1 and y == 7 then
reactor.setActive(true)
elseif x == 1 and y == 8 then
reactor.setActive(false)
end
end
sleep(5)
end
end
Hope anyone can find out whats wrong here. Regards -Yanniclord
So to start off im rewriting a script for CC that works with BigReactors, it first was to simply display info about the Reactor on the monitor above the PC, but then i thought i can maybe add two touch buttons to the monitor that let me toggle the state of the reactor with "reactor.setActive(true/false)", however what ever i try to do it tells me to "end" the line, but i tried alot of ends, from one end to five ends and on many different places, so i now need some help, it would be appreciated, thanks in advance.
Spoiler
while true dolocal reactor1 = peripheral.wrap("BigReactors-Reactor_1")
local mon = peripheral.wrap("top")
mon.clear()
– Begin Reactor 1
–mon.setCursorPos(1,1)
–mon.setTextColor(colors.white)
–mon.write("Reactor #: ")
–mon.setTextColor(colors.lime)
–mon.write("1")
mon.setCursorPos(1,1)
mon.setTextColor(colors.white)
mon.write("Active: ")
mon.setTextColor(colors.lime)
mon.write(reactor1.getActive())
mon.setCursorPos(1,2)
mon.setTextColor(colors.white)
mon.write("RF/T: ")
mon.setTextColor(colors.lime)
mon.write(math.floor(reactor1.getEnergyProducedLastTick()))
mon.setCursorPos(1,3)
mon.setTextColor(colors.white)
mon.write("Control Rods: ")
mon.setTextColor(colors.lime)
mon.write(math.floor(reactor1.getNumberOfControlRods()))
mon.setCursorPos(1,4)
mon.setTextColor(colors.white)
mon.write("RF Stored: ")
mon.setTextColor(colors.lime)
mon.write(math.floor(reactor1.getEnergyStored()))
mon.setCursorPos(1,5)
mon.setTextColor(colors.white)
mon.write("Casing Heat: ")
mon.setTextColor(colors.lime)
mon.write(math.floor(reactor1.getCasingTemperature()))
mon.setCursorPos(1,6)
mon.setTextColor(colors.white)
mon.write("Fuel Heat: ")
mon.setTextColor(colors.lime)
mon.write(math.floor(reactor1.getFuelTemperature()))
– End Reactor 1
function Clicks()
mon.setCursorPos(1,7)
print("ON")
mon.setCursorPos(1,8)
print("OFF")
end
function Pick()
while true do
event,side,x,y = os.pullEvent()
if event == "monitor_touch" then
if x == 1 and y == 7 then
reactor.setActive(true)
elseif x == 1 and y == 8 then
reactor.setActive(false)
end
end
sleep(5)
end
end
Hope anyone can find out whats wrong here. Regards -Yanniclord