Advertisement
Guest User

ContinualPing

a guest
Mar 17th, 2018
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. print("Welcome to Bobby's ContinualPing program!")
  2. print("preparing for scan")
  3. print("please enter a radius for the scan")
  4. print("between 100 and 999")
  5. r=io.read()
  6. print("would you like to use a monitor? (y/n)")
  7. x=io.read()
  8. if x=="y" then
  9.  print("which side?")
  10.  m=io.read()
  11.   w=peripheral.wrap(m)
  12.  while true do
  13.   print("pinging with a radius of")
  14.   print(r)
  15.   print("meters.")
  16.   w.clear()
  17.   w.setCursorPos(1,1)
  18.   shell.run("monitor",m,"ping",r)
  19.   sleep(5)
  20.   end
  21.  end
  22. if x=="n" then
  23.  while true do
  24.   print("pinging with a radius of")
  25.   print(r)
  26.   print("meters.")
  27.   shell.run("ping",r)
  28.   sleep(5)
  29.   end
  30.  end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement