Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("json")
- term.clear()
- term.setCursorPos(1,1)
- local mon = peripheral.wrap("top")
- local mag = peripheral.wrap("right")
- local hostname = "http://localhost:8080/api/key"
- write("Username : ")
- local username = read()
- write("Password : ")
- local password = read('*')
- local res = http.post(hostname .. "?level=2&username="..username.."&password="..password).readAll()
- local obj = json.decode(res)
- if (obj.success) then
- print("Inserer la carte")
- mon.write("Inserer la carte")
- mag.beginWrite(obj.key, "Carte banquaire")
- local ev, arg = os.pullEvent("mag_write_done")
- mon.clear()
- mon.setCursorPos(1,1)
- end
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement