Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- this Required Command Block Support Enable
- -- set it true
- -- WinCraft XP [DGU]
- -- set your name on "u", set your username in computercraft "un", set your password in computercraft "pw"
- -- this saving your XP on computer craft
- -- note : i highly fix and make sure is Working all! if there are errors
- -- u -> balance show, (withdraw xp, deposit xp:commandblock)
- -- un -> account required signup
- -- pw -> account required signup
- -- cmd = peripheral.wrap("<sides>") -> command block side -> trigger decrease/increase XP uses withdraw or deposit
- -- Warning don't place there a letter when this file are running except in u,un,pw/username,password
- u = ""
- un = ""
- pw = ""
- print (u..' User')
- be = fs.open(un, "r")
- mybe = be.readLine()
- be.close()
- print ('your balance here! is $'..mybe)
- write("User Name :")
- unw = read()
- if un == unw then
- print 'UserName Correct'
- else
- print 'UserName Incorrect!'
- sleep(2.5)
- os.reboot()
- end
- write("Pass Word :")
- pww = read("*")
- if pw == pww then
- print 'PassWord Correct'
- else
- print 'PassWord Incorrect!'
- sleep(2.5)
- os.reboot()
- end
- sleep(1)
- print '[1] Deposit XP'
- print '[2] Withdraw XP'
- write("[Num] >")
- cenum = read()
- if cenum == "1" then
- print 'How many do you want to Deposit :'
- write(" XP >")
- wlvld = read()
- if fs.exists(un) then
- local rrlvld = fs.open(un, "r")
- readlvl = rrlvld.readLine()
- rrlvld.close()
- cmd = peripheral.wrap("back")
- cmd.setCommand("xp -"..wlvld.."l "..u)
- cmd.runCommand()
- shell.run("rm "..un)
- local cclvld = fs.open(un, "w")
- cclvld.writeLine(wlvld+readlvl)
- cclvld.close()
- sleep(0.1)
- os.reboot()
- else
- local crlvld = fs.open(un, "a")
- crlvld.writeLine("0")
- crlvld.close()
- sleep(0.1)
- os.reboot()
- end
- end
- if cenum == "2" then
- print 'How many do you want to Withdraw'
- write(" XP >")
- rlvld = read()
- if fs.exists(un) then
- local readlvld = fs.open(un, "r")
- readlvl = readlvld.readLine()
- readlvld.close()
- cmd = peripheral.wrap("back")
- cmd.setCommand("xp "..rlvld.."l "..u)
- cmd.runCommand()
- shell.run("rm "..un)
- local cclvld = fs.open(un, "w")
- cclvld.writeLine(readlvl-rlvld)
- cclvld.close()
- sleep(0.1)
- os.reboot()
- else
- local crlvld = fs.open(un, "a")
- crlvld.writeLine("0")
- crlvld.close()
- sleep(0.1)
- os.reboot()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement