Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = peripheral.wrap("bottom")
- m.open(6105)
- function main()
- term.clear()
- term.setCursorPos(16,3)
- term.write("Bienvenue dans le Game")
- term.setCursorPos(15,7)
- term.write("Que voulez vous faire ?")
- term.setCursorPos(10,13)
- term.write("M'inscrire")
- term.setCursorPos(26,13)
- term.write("Me désinscrire")
- while true do
- event,click,x,y = os.pullEvent("mouse_click")
- if x>9 and x<17 and y>12 and y<15 then
- Register()
- elseif x>25 and x<33 and y>12 and y<15 then
- Cancel()
- end
- sleep(0.1)
- end
- end
- function Register()
- term.clear()
- term.setCursorPos(15,7)
- term.write("Pseudo :")
- pseudo = read()
- msg = textutils.serialize({pseudo,"w"})
- m.transmit(6105,4,msg)
- sleep(2)
- main()
- end
- function Cancel()
- term.clear()
- term.setCursorPos(15,7)
- term.write("Pseudo :")
- pseudo = read()
- msg = textutils.serialize({pseudo,"rm"})
- m.transmit(6105,4,msg)
- event,side,channel,channelbis,message = os.pullEvent("modem_message")
- if message == "ok" then
- sleep(2)
- main()
- elseif message == "non" then
- term.clear()
- term.setCursorPos(12,7)
- term.write("Mauvais pseudo veuillez recommencer")
- sleep(2)
- main()
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment