Advertisement
LegoStax

WClear

Sep 18th, 2015
650
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. local args = {...}
  2. if not commands then
  3.     print("This program is for Command Computers only")
  4.     return
  5. end
  6. if args[1] == "?" or args[1] == "/?" or args[1] == "-?" or args[1] == "help" then
  7.     print("Usage:")
  8.     print(fs.getName(shell.getRunningProgram()).." [ticksToWait] [programToRun]")
  9.     return
  10. end
  11. local ticksToWait = tonumber(args[1]) or 999999
  12. local prog = args[2] or "rom/programs/shell"
  13. print("WClear Daemon Waiting "..ticksToWait.." for each command")
  14. local function main()
  15.     while true do
  16.         commands.exec("/weather clear 999999")
  17.         sleep(ticksToWait/20)
  18.     end
  19. end
  20. parallel.waitForAny(function() shell.run(prog) end, main)
  21. print("Daemon killed")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement