Posted 04 March 2012 - 03:41 AM
A simple little program for all your dice-y needs :unsure:/>/>
function os.pullEvent()
local event, p1, p2, p3, p4, p5 = os.pullEventRaw()
if event == "terminate" then
os.reboot()
end
return event, p1, p2, p3, p4, p5
end
term.clear()
term.setCursorPos(1,1)
print("1: 6 sided die.")
print("2: 12 sided die.")
print("3: 20 sided die.")
print("")
input = read()
sleep(1)
term.clear()
term.setCursorPos(1,1)
if input == "" then
print("Nothing isn't a number.")
sleep(1)
os.reboot()
elseif input == "1" then
print(math.random(1, 6))
sleep(3)
term.clear()
term.setCursorPos(1,1)
shell.run("shell")
elseif input == "2" then
print(math.random(1, 12))
sleep(3)
term.clear()
term.setCursorPos(1,1)
shell.run("shell")
elseif input == "3" then
print(math.random(1, 20))
sleep(3)
term.clear()
term.setCursorPos(1,1)
shell.run("shell")
end