Jump to content

ruben654

Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by ruben654

  1. You could always make a new program with a convenient name that does this:

    rednet.open("yoursidehere")
    
    rednet.broadcast("yourmessagehere")
    
    rednet.close("yoursidehere")
    
    
    
    
    if you want it send on redstone this will help:
    
    
    
    rednet.open("yoursidehere")
    
    while !(event=="char" and p1=="q") do
    
     event,p1=os.pullEvent()
    
     if event=="redstone" then
    
     if redstone.getInput("yoursidehere") then
    
      rednet.broadcast("onmessage")
    
     else
    
      rednet.broadcast("offmessage")
    
     end
    
     end
    
    end
    
    rednet.close("yoursidehere")

    and if you press Q in the bottom program, it'll terminate the program and turn off the modem

  2. If I'm right this should work:

    rednet.open("left")
    
    while true do
    
    senderID, input = rednet.receive()
    
    if input == "zsakul" then
    
    redstone.output("back", true)
    
    end
    
    end
    
    
    
    
    rednet.receive() doesn't have a required timeout setting, if you don't set it it doesn't have a timeout
    
    And I suggest you put something in your code to turn the redstone off again like:
    
    
    
    rednet.open("left")
    
    while true do
    
    senderID, input = rednet.receive()
    
    if input == "zsakul" then
    
    redstone.setOutput("back", true)
    
    sleep(1) --wait one second
    
    redstone.setOutput("back", false)
    
    end
    
    end

×
×
  • Create New...