This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
RyanFaulk's profile picture

Activating Webdisplay with Redstone

Started by RyanFaulk, 29 July 2015 - 03:10 PM
RyanFaulk #1
Posted 29 July 2015 - 05:10 PM
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.
KingofGamesYami #2
Posted 29 July 2015 - 06:21 PM
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