SHOW:
|
|
- or go back to the newest paste.
| 1 | function clear(test) -- function to reset screen | |
| 2 | term.clear() | |
| 3 | term.setCursorPos(1,1) | |
| 4 | if test == nil then -- easy way to decide whether to display text or not | |
| 5 | print("Please place me at the North West corner of your building plot facing North. Is this done? 1 to Continue, 3 to cancel")
| |
| 6 | end | |
| 7 | end | |
| 8 | ||
| 9 | clear() | |
| 10 | ||
| 11 | while true do | |
| 12 | event, param1 = os.pullEvent() | |
| 13 | ||
| 14 | if event == "char" and param1 == "1" then -- if the event was a character input and the character pressed was 1 | |
| 15 | - | StartBuilding |
| 15 | + | StartBuilding(true) |
| 16 | ||
| 17 | elseif event == "char" and param1 == "3" then | |
| 18 | break -- breaks loop | |
| 19 | ||
| 20 | end | |
| 21 | end -- will repeat until loop is broken with 'break' (3 being pressed) | |
| 22 | clear(1) -- reset screen but without text | |
| 23 | ||
| 24 | ||
| 25 | function StartBuilding(build) | |
| 26 | print("BuildFuss") -- print "Hi"
| |
| 27 | sleep(2) -- sleep for 2 seconds | |
| 28 | clear() -- call the clear function |