SHOW:
|
|
- or go back to the newest paste.
| 1 | --20-Sided Die in Computercraft | |
| 2 | --TheCountChuckula | |
| 3 | ||
| 4 | math.randomseed(os.time()) | |
| 5 | m = peripheral.wrap("top")
| |
| 6 | while true do | |
| 7 | os.pullEvent(monitor_touch) | |
| 8 | for r = 1, 5 do | |
| 9 | for x = 1, 2 do | |
| 10 | local effect = math.random(20) | |
| 11 | m.setCursorPos(1,x) | |
| 12 | m.clear() | |
| 13 | m.setTextScale(3) | |
| 14 | if effect < 10 then | |
| 15 | m.write("0")
| |
| 16 | m.write(effect) | |
| 17 | else | |
| 18 | m.write(effect) | |
| 19 | end | |
| 20 | sleep(.05) | |
| 21 | end | |
| 22 | end | |
| 23 | local rint = math.random(20) | |
| 24 | m.setCursorPos(1,1) | |
| 25 | m.clear() | |
| 26 | m.setTextScale(3) | |
| 27 | if rint < 10 then | |
| 28 | m.write("0")
| |
| 29 | m.write(rint) | |
| 30 | else | |
| 31 | m.write(rint) | |
| 32 | end | |
| 33 | m.setCursorPos(1,2) | |
| 34 | m.write("^^")
| |
| 35 | end |