←  Ask a Pro

ComputerCraft | Programmable Computers for Minecraft

»

Activating Webdisplay with Redstone

RyanFaulk's Photo RyanFaulk 29 Jul 2015

All I want to do is something very simple, and that is to make a webdisplay screen navigate to a page when redstone to the left of the computer,

http://i.imgur.com/VxoNvK8.png

I can navigate pages by typing in lua and then the proper commands from there after having first set up the peripheral

I've never coded before, but I surmise that this is close to what is needed to make this work, but I have no idea where to put it:

if redstone.getInput("left",true) then
scr.setUrl("https://www.youtube.com/embed/z0PGK7a2IFo?autoplay=1")
else
scr.setUrl("about:blank")
end

I know where to make programs run in the "normal area", but not the interactive lua prompt, which appears to be the only way to interact with the webdisplays computer interface.

Intuitively this seems like it would be so simple to just have a redstone input make the webdisplay go to a specific website.
Quote

KingofGamesYami's Photo KingofGamesYami 29 Jul 2015

You'd do this:
while true do
  if rs.getInput( "left" ) then 
    --#set stuff
  else
    --#set other stuff
  end
  os.pullEvent( "redstone" ) --#waits for redstone input to change
end
Quote