Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- redstoneSide = "left"
- openTime = 2
- local maxw, maxh = term.getSize()
- function printCentered(text)
- local maxw, maxh = term.getSize()
- local curx, cury = term.getCursorPos()
- term.setCursorPos((maxw - #text) / 2, cury)
- term.write(text)
- term.setCursorPos(curx, cury + 1)
- end
- rs.setOutput(redstoneSide, true)
- while true do
- term.clear()
- term.setCursorPos(1, math.floor(maxh / 2))
- printCentered("Benvenuto!")
- print()
- printCentered("Tocca il sensore per entrare")
- event, playerName = os.pullEvent()
- if event == "player" then
- print()
- printCentered("Ciao, " .. playerName)
- rs.setOutput(redstoneSide, false)
- http.get("http://172.16.20.227/~fabrimat/rgr/user_access_ctc.php?player=" .. playerName)
- os.sleep(openTime)
- rs.setOutput(redstoneSide, true)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement