Advertisement
wv1106

file copy form disk to startup on pc computercraft

Apr 1st, 2021
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 KB | None | 0 0
  1. local filedir = ""
  2. local filedest = ""
  3. local confirm = false
  4. local install = false
  5. function text()
  6.     term.setCursorPos(13, 7)
  7.     print("this will create a startup.")
  8.     term.setCursorPos(14, 8)
  9.     print("do you want to continue?")
  10. end
  11. function confirmation()
  12.     term.setCursorPos(18, 10)
  13.     local event, key, isHeld = os.pullEvent("key")
  14.     if key == keys.left then
  15.         write(">Yes<     No ")
  16.         confirm = true
  17.     elseif key == keys.right then
  18.         write(" Yes     >No<")
  19.         confirm = false
  20.     end
  21.  
  22. end
  23.  
  24. term.clear()
  25. term.setCursorPos(18, 10)
  26. print(" Yes     >No<")
  27. while install == false do
  28.     text()
  29.     confirmation()
  30.     local event, key, isHeld = os.pullEvent("key")
  31.     if confirm and key == keys.enter then
  32.         install = true
  33.     end
  34. end
  35. fs.copy(filedir, filedest)
  36. term.clear()
  37. term.setCursorPos(1, 1)
  38. print("installed")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement