Jump to content




Monitor change


  • You cannot reply to this topic
1 reply to this topic

#1 Fiestaguy

  • New Members
  • 2 posts

Posted 27 February 2014 - 08:26 PM

I am having a problem.
There is a monitor in my office displaying the following text:

Ovis Aries Industries
Nuclear reactor: STABLE


**:**PM/AM
the script is:
side = "back"
cn = "Ovis Aries Industries"
mon = peripheral.wrap(side)
Active = Nein
mon.setTextScale(2)
if Active == Nuke then
while true do
mon.setCursorPos(1,1)
mon.write(cn)
mon.setCursorPos(1,2)
mon.write("Nuclear reactor: STABLE
mon.setCursorPos(22,9)
mon.write(textutils.formatTime(os.time(), false))
sleep(1)
mon.clear()
shell.run("Nuke")
end
end
if redstone.getInput("left")
then
Active = Nuke
mon.clear()
mon.setCursorPos(1,1)
mon.write("EMERGENCY. REACTOR MELTDOWN IMMINENT")
mon.setCursorPos(1,2)
mon.write("REACTOR SHUT DOWN.")
end
You might notice that there is a command to run the program "Nuke"

that program is irrelevant as it just shows stuff on the computer itself and not on the monitor.

I would like to add that in the seventh line
if Active == Nuke then
when its == the screen will work as fine as normal and show all info

when the == is changed to ~= (Is not equal to) then the whole monitor becomes inoperatable.

I would like to know if someone knows how to fix this. thank you

#2 KaoS

    Diabolical Coder

  • Members
  • 1,510 posts
  • LocationThat dark shadow under your bed...

Posted 27 February 2014 - 10:16 PM

you need to enclose your strings in quotes
side = "back"
cn = "Ovis Aries Industries"
mon = peripheral.wrap(side)
Active = "Nein"
mon.setTextScale(2)
if Active == "Nuke" then
while true do
mon.setCursorPos(1,1)
mon.write(cn)
mon.setCursorPos(1,2)
mon.write("Nuclear reactor: STABLE
mon.setCursorPos(22,9)
mon.write(textutils.formatTime(os.time(), false))
sleep(1)
mon.clear()
shell.run("Nuke")
end
end
if redstone.getInput("left")
then
Active = "Nuke"
mon.clear()
mon.setCursorPos(1,1)
mon.write("EMERGENCY. REACTOR MELTDOWN IMMINENT")
mon.setCursorPos(1,2)
mon.write("REACTOR SHUT DOWN.")
end






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users