Advertisement
Davidgumazon03

MC Computer Craft *WinXP v1 [DGU]

Jan 2nd, 2014
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.29 KB | None | 0 0
  1. -- this Required Command Block Support Enable
  2. -- set it true
  3. -- WinCraft XP [DGU]
  4. -- set your name on "u", set your username in computercraft "un", set your password in computercraft "pw"
  5. -- this saving your XP on computer craft
  6. -- note : i highly fix and make sure is Working all! if there are errors
  7. -- u -> balance show, (withdraw xp, deposit xp:commandblock)
  8. -- un -> account required signup
  9. -- pw -> account required signup
  10. -- cmd = peripheral.wrap("<sides>") -> command block side -> trigger decrease/increase XP uses withdraw or deposit
  11. -- Warning don't place there a letter when this file are running except in u,un,pw/username,password
  12.  
  13. u = ""
  14. un = ""
  15. pw = ""
  16. print (u..' User')
  17. be = fs.open(un, "r")
  18. mybe = be.readLine()
  19. be.close()
  20.  
  21. print ('your balance here! is $'..mybe)
  22. write("User Name :")
  23. unw = read()
  24. if un == unw then
  25.  print 'UserName Correct'
  26. else
  27.  print 'UserName Incorrect!'
  28.  sleep(2.5)
  29.  os.reboot()
  30. end
  31. write("Pass Word :")
  32. pww = read("*")
  33. if pw == pww then
  34.  print 'PassWord Correct'
  35. else
  36.  print 'PassWord Incorrect!'
  37.  sleep(2.5)
  38.  os.reboot()
  39. end
  40.  
  41. sleep(1)
  42.  
  43. print '[1] Deposit XP'
  44. print '[2] Withdraw XP'
  45. write("[Num] >")
  46. cenum = read()
  47. if cenum == "1" then
  48.  print 'How many do you want to Deposit :'
  49.  write(" XP >")
  50.  wlvld = read()
  51.  if fs.exists(un) then
  52.   local rrlvld = fs.open(un, "r")
  53.   readlvl = rrlvld.readLine()
  54.   rrlvld.close()
  55.   cmd = peripheral.wrap("back")
  56.   cmd.setCommand("xp -"..wlvld.."l "..u)
  57.   cmd.runCommand()
  58.   shell.run("rm "..un)
  59.   local cclvld = fs.open(un, "w")
  60.   cclvld.writeLine(wlvld+readlvl)
  61.   cclvld.close()
  62.   sleep(0.1)
  63.   os.reboot()
  64.  else
  65.   local crlvld = fs.open(un, "a")
  66.   crlvld.writeLine("0")
  67.   crlvld.close()
  68.   sleep(0.1)
  69.   os.reboot()
  70.  end
  71. end
  72. if cenum == "2" then
  73.  print 'How many do you want to Withdraw'
  74.  write(" XP >")
  75.  rlvld = read()
  76.  if fs.exists(un) then
  77.   local readlvld = fs.open(un, "r")
  78.   readlvl = readlvld.readLine()
  79.   readlvld.close()
  80.   cmd = peripheral.wrap("back")
  81.   cmd.setCommand("xp "..rlvld.."l "..u)
  82.   cmd.runCommand()
  83.   shell.run("rm "..un)
  84.   local cclvld = fs.open(un, "w")
  85.   cclvld.writeLine(readlvl-rlvld)
  86.   cclvld.close()
  87.   sleep(0.1)
  88.   os.reboot()
  89.  else
  90.   local crlvld = fs.open(un, "a")
  91.   crlvld.writeLine("0")
  92.   crlvld.close()
  93.   sleep(0.1)
  94.   os.reboot()
  95.  end
  96. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement