Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local uid = ""
- local ePilon = ""
- for key, side in pairs(peripheral.getNames()) do
- if peripheral.getType(side) == "draconic_rf_storage" then
- ePilon = peripheral.wrap(side)
- end
- end
- function setUsername()
- term.setTextColor(colors.lightBlue)
- print("Choose a username.")
- term.setTextColor(colors.lime)
- term.write("> ")
- term.setTextColor(colors.yellow)
- username = read()
- if username == "" then
- term.setTextColor(colors.red)
- print("\nUsername can't be blank.\n")
- setUsername()
- end
- request = http.post("https://rodre.nekotiki.fr/setenergyname.php", "uid=" .. uid .. "&username=" .. username)
- data = request.readAll()
- if data == "false" then
- term.setTextColor(colors.red)
- print("\nUsername Already Taken.\n")
- setUsername()
- else
- term.setTextColor(colors.lime)
- print("\nUsername as been set.\n")
- fUid = fs.open("uid", "w")
- fUid.write(uid)
- fUid.close()
- end
- end
- function startProgram()
- if fs.exists("uid") then
- fUid = fs.open("uid", "r")
- uid = fUid.readAll()
- fUid.close()
- else
- request = http.get("https://rodre.nekotiki.fr/getenergyuid.php")
- data = request.readAll()
- uid = data
- setUsername()
- end
- term.setTextColor(colors.yellow)
- write("Your UID: ")
- term.setTextColor(colors.lime)
- print(uid)
- while true do
- request = http.post("https://rodre.nekotiki.fr/setenergy.php", "uid=" .. uid .. "&energy=" .. ePilon.getEnergyStored() .. "&energyPerTick=" .. ePilon.getTransferPerTick())
- sleep(5)
- end
- end
- if ePilon == "" then
- term.setTextColor(colors.red)
- term.write("No Draconic Pylon Found.\n")
- else
- startProgram()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement