Advertisement
KedrikFeeD

commands

Feb 7th, 2025 (edited)
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.44 KB | Gaming | 0 0
  1. local commands = {}
  2.  
  3. function commands.checkCommandAndRun(command)
  4.     if not command then
  5.         return false
  6.     end
  7.  
  8.     if command == "/reboot" then
  9.         os.reboot()
  10.         return true
  11.     end
  12.  
  13.     if command == "/shutdown" then
  14.         os.shutdown()
  15.         return true
  16.     end
  17.  
  18.     if command == "/clear" then
  19.         term.setCursorPos(1, 1)
  20.         term.clear()
  21.     end
  22.  
  23.     return false
  24. end
  25.  
  26. return commands
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement