Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function clear(test) -- function to reset screen
- term.clear()
- term.setCursorPos(1,1)
- if test == nil then -- easy way to decide whether to display text or not
- print("Please place me at the North West corner of your building plot facing North. Is this done? 1 to Continue, 3 to cancel")
- end
- end
- clear()
- while true do
- event, param1 = os.pullEvent()
- if event == "char" and param1 == "1" then -- if the event was a character input and the character pressed was 1
- StartBuilding(true)
- elseif event == "char" and param1 == "3" then
- break -- breaks loop
- end
- end -- will repeat until loop is broken with 'break' (3 being pressed)
- clear(1) -- reset screen but without text
- function StartBuilding(build)
- print("BuildFuss") -- print "Hi"
- sleep(2) -- sleep for 2 seconds
- clear() -- call the clear function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement