Advertisement
LDDestroier

Redstone Rednet Game Controller

Oct 3rd, 2014
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. rednet.open("bottom")
  2. id = 25
  3. print("Activating controller...")
  4. while true do
  5.     local event = { os.pullEvent() }
  6.     if event == "redstone_message" then
  7.         if redstone.getInput("front")==true then
  8.             rednet.send(id, "up")
  9.         end
  10.         if redstone.getInput("back")==true then
  11.             rednet.send(id, "down")
  12.         end
  13.         if redstone.getInput("left")==true then
  14.             rednet.send(id, "left")
  15.         end
  16.         if redstone.getInput("right")==true then
  17.             rednet.send(id, "right")
  18.         end
  19.         if redstone.getInput("top")==true then
  20.             rednet.send(id, "use")
  21.         end
  22.     end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement