Jump to content




Need help with redirecting the terminal through modem cable.


  • You cannot reply to this topic
4 replies to this topic

#1 D3athbysp0rk

  • Members
  • 8 posts

Posted 02 April 2014 - 06:52 AM

so here's my lock code, I've kinda thrown bits and chunks of it together from other codes and my very basic knowledge of lua... but could someone assist me with redirecting what's written on the monitor through a modem cable, thank the monitor is also name 'monitor_0' when it's connected to the cable. the monitor is 3x1 blocks if this helps at all? thank you!

os.pullEvent = os.pullEventRaw
while true do
term.clear()
term.setCursorPos(1,1)
print ("Zared's Security System Initialized")
local monitor = peripheral.wrap("monitor_0")
monitor.write("Zared's Vault Lock V2.6.11")
write("Password: ")
local input = read("*")
if input == "Synapse" then
  term.clear()
  term.setCursorPos(1,1)
  print ("correct! See monitor for details")
  local monitor = peripheral.wrap("monitor_0")
  term.redirect( monitor)
  print("Password Correct...")
  sleep(3)
  print("Establishing uplink to Partical Matrix.")
  sleep(3)
  print("Uplink established!")
  print("Threading code.")
  sleep(3)
  print("Setting Forcetron Partical Matrix State to: 'False'")
  sleep(3)
  print("Injection complete!")
  print("Disabling particles: True")
  sleep(2)
  term.clear()
  term.setCursorPos(1,1)
  term.restore()
  rs.setOutput("left",true)
  sleep(6)
  rs.setOutput("left",false)
  term.clear()
  term.setCursorPos(1,1)
else
  print("Password Incorrect!")
  sleep(2)
  term.clear()
  term.setCursorPos(1,1)
  term.restore()
  sleep(2)
  term.clear()
  term.setCursorPos(1,1)
  end
end

Edited by D3athbysp0rk, 03 April 2014 - 01:16 AM.


#2 CometWolf

  • Members
  • 1,283 posts

Posted 02 April 2014 - 01:45 PM

Just change the wrapping to whatever the monitor's new name is
local monitor = peripheral.wrap("monitor_0")


#3 D3athbysp0rk

  • Members
  • 8 posts

Posted 03 April 2014 - 01:18 AM

View PostCometWolf, on 02 April 2014 - 01:45 PM, said:

Just change the wrapping to whatever the monitor's new name is
local monitor = peripheral.wrap("monitor_0")

i tried this, i'm getting
startup: 7: attempt to index ? (a nil value)

i updated the code above, any idea what's wrong?

#4 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 03 April 2014 - 03:37 AM

If the code in the OP is current like your post suggests, it means that either the monitor isn't named monitor_0 or the monitor isn't connected to the computer that the code is being run on.

#5 D3athbysp0rk

  • Members
  • 8 posts

Posted 03 April 2014 - 04:52 AM

View PostLyqyd, on 03 April 2014 - 03:37 AM, said:

If the code in the OP is current like your post suggests, it means that either the monitor isn't named monitor_0 or the monitor isn't connected to the computer that the code is being run on.

you're right. XD i'm a derp. i forgot to use the place a wired modem on the computer aswell. l0l.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users