Advertisement
NuAoA

Untitled

Jun 8th, 2013
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. -- Command block random teleporter
  2. --
  3.  
  4. if not fs.exists("wrap") then
  5. print("wrap API not found, downloading from http://pastebin.com/g5tBarus")
  6. shell.run("pastebin get g5tBarus wrap")
  7. end
  8. os.loadAPI("wrap")
  9. co = wrap.attach("command")
  10.  
  11. --os.pullEvent = os.pullEventRaw
  12. function run()
  13. while true do
  14. local event = os.pullEvent("redstone")
  15. local x = math.random(10000, 50000)
  16. local z = math.random(10000, 50000)
  17. co.setCommand("tp @p[r=1] "..x.." 128 "..z)
  18. co.runCommand()
  19. co.setCommand("")
  20. end
  21. end
  22. function antiHack()
  23. print("[AntiHack] Enabled")
  24. while true do
  25. local event,side = os.pullEventRaw()
  26. if event == "peripheral" then
  27. if peripheral.getType(side) == "drive" then
  28. -- we got someone putting a drive next to the terminal
  29. elseif peripheral.getType(side) == "computer" then
  30.  
  31. end
  32. elseif event == "disk" then
  33. if fs.exists("disk/startup") then
  34. fs.delete("disk/startup")
  35. disk.setLabel(side,"Broken Floppy")
  36. end
  37. elseif event == "terminate" then
  38. os.queueEvent("password")
  39. end
  40. end
  41. end
  42. function password()
  43. while true do
  44. local event = os.pullEvent("password")
  45. sleep(0)
  46. term.clear()
  47. term.setCursorPos(1,1)
  48. if string.lower(read("*")) == "recordmods" then
  49. shell.run("edit startup")
  50. os.reboot()
  51. end
  52. end
  53. end
  54. parallel.waitForAll(run,password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement