Coti5432

Lotto Cardgen

Nov 27th, 2021 (edited)
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. MAINFRAME_ID = 1
  2.  
  3. function addPlayer(player, name)
  4. rednet.send(MAINFRAME_ID, {type="addPlayer", player=player, name=name}, "otto")
  5. rednet.receive("otto")
  6. return
  7. end
  8.  
  9.  
  10. local drive = peripheral.wrap("top")
  11. rednet.open("bottom")
  12.  
  13. while true do
  14. term.clear()
  15. term.setCursorPos(1,1)
  16. term.setTextColor(colors.yellow)
  17. term.write("Enter player username")
  18. term.setCursorPos(1,2)
  19. term.write("> ")
  20. term.setTextColor(colors.white)
  21. local input = read()
  22. term.setTextColor(colors.yellow)
  23. term.write("Generating card for "..input)
  24.  
  25. turtle.turnLeft()
  26. turtle.suck()
  27. turtle.dropUp()
  28. local player = drive.getDiskID()
  29. addPlayer(player, input)
  30. drive.setDiskLabel(input.."'s Casino Card - $0")
  31. local filePath = fs.combine(drive.getMountPath(), "bal")
  32. file = fs.open(filePath, "w")
  33. file.write("0")
  34. file.close()
  35. turtle.suckUp()
  36. turtle.turnRight()
  37. turtle.drop()
  38. end
  39.  
Add Comment
Please, Sign In to add comment