Advertisement
Guest User

HELP

a guest
Jun 3rd, 2015
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. local internet = component.proxy(component.list("internet")())
  2. local modem = component.proxy(component.list('modem')())
  3. drone=component.proxy(component.list('drone')())
  4.  
  5. function sleep(n)
  6.   local t0 = computer.uptime()
  7.   while computer.uptime() - t0 <= n do computer.pushSignal("wait") computer.pullSignal() end
  8. end
  9.  
  10. while true do
  11.     local response = internet.request("http://hidden.me/mc/getAction.php") --gets a command like drone.move(0,1,0)
  12.     sleep(1)
  13.     if response.finishConnect() then
  14.         message = response.read()
  15.         if tostring(message) == "test" then
  16.             drone.setStatusText("OOC")
  17.         else
  18.             modem.broadcast(20, tostring(message))
  19.             pcall(load, 'drone.move(1,0,0)')
  20.            
  21.             drone.setStatusText("M: "..tostring(message))
  22.         end
  23.     end
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement