Enjoy!
Spoiler
function blank()
term.setCursorPos(7,3)
print("+--------------+ +--------------+")
term.setCursorPos(7,4)
print("| | | |")
term.setCursorPos(7,5)
print("| | | |")
term.setCursorPos(7,6)
print("| | | |")
term.setCursorPos(7,7)
print("| Press ENTER | | To Roll |")
term.setCursorPos(7,8)
print("| | | |")
term.setCursorPos(7,9)
print("| | | |")
term.setCursorPos(7,10)
print("| | | |")
term.setCursorPos(7,11)
print("+--------------+ +--------------+")
end
function die1()
local x = math.random(1,6)
if x == 1 then
term.setCursorPos(7,3)
print("+--------------+")
term.setCursorPos(7,4)
print("| |")
term.setCursorPos(7,5)
print("| |")
term.setCursorPos(7,6)
print("| |")
term.setCursorPos(7,7)
print("| O |")
term.setCursorPos(7,8)
print("| |")
term.setCursorPos(7,9)
print("| |")
term.setCursorPos(7,10)
print("| |")
term.setCursorPos(7,11)
print("+--------------+")
elseif x == 2 then
term.setCursorPos(7,3)
print("+--------------+")
term.setCursorPos(7,4)
print("| |")
term.setCursorPos(7,5)
print("| O |")
term.setCursorPos(7,6)
print("| |")
term.setCursorPos(7,7)
print("| |")
term.setCursorPos(7,8)
print("| |")
term.setCursorPos(7,9)
print("| O |")
term.setCursorPos(7,10)
print("| |")
term.setCursorPos(7,11)
print("+--------------+")
elseif x == 3 then
term.setCursorPos(7,3)
print("+--------------+")
term.setCursorPos(7,4)
print("| |")
term.setCursorPos(7,5)
print("| O |")
term.setCursorPos(7,6)
print("| |")
term.setCursorPos(7,7)
print("| O |")
term.setCursorPos(7,8)
print("| |")
term.setCursorPos(7,9)
print("| O |")
term.setCursorPos(7,10)
print("| |")
term.setCursorPos(7,11)
print("+--------------+")
elseif x == 4 then
term.setCursorPos(7,3)
print("+--------------+")
term.setCursorPos(7,4)
print("| |")
term.setCursorPos(7,5)
print("| O O |")
term.setCursorPos(7,6)
print("| |")
term.setCursorPos(7,7)
print("| |")
term.setCursorPos(7,8)
print("| |")
term.setCursorPos(7,9)
print("| O O |")
term.setCursorPos(7,10)
print("| |")
term.setCursorPos(7,11)
print("+--------------+")
elseif x == 5 then
term.setCursorPos(7,3)
print("+--------------+")
term.setCursorPos(7,4)
print("| |")
term.setCursorPos(7,5)
print("| O O |")
term.setCursorPos(7,6)
print("| |")
term.setCursorPos(7,7)
print("| O |")
term.setCursorPos(7,8)
print("| |")
term.setCursorPos(7,9)
print("| O O |")
term.setCursorPos(7,10)
print("| |")
term.setCursorPos(7,11)
print("+--------------+")
elseif x == 6 then
term.setCursorPos(7,3)
print("+--------------+")
term.setCursorPos(7,4)
print("| |")
term.setCursorPos(7,5)
print("| O O |")
term.setCursorPos(7,6)
print("| |")
term.setCursorPos(7,7)
print("| O O |")
term.setCursorPos(7,8)
print("| |")
term.setCursorPos(7,9)
print("| O O |")
term.setCursorPos(7,10)
print("| |")
term.setCursorPos(7,11)
print("+--------------+")
end
end
function die2()
local x = math.random(1,6)
if x == 1 then
term.setCursorPos(25,3)
print("+--------------+")
term.setCursorPos(25,4)
print("| |")
term.setCursorPos(25,5)
print("| |")
term.setCursorPos(25,6)
print("| |")
term.setCursorPos(25,7)
print("| O |")
term.setCursorPos(25,8)
print("| |")
term.setCursorPos(25,9)
print("| |")
term.setCursorPos(25,10)
print("| |")
term.setCursorPos(25,11)
print("+--------------+")
elseif x == 2 then
term.setCursorPos(25,3)
print("+--------------+")
term.setCursorPos(25,4)
print("| |")
term.setCursorPos(25,5)
print("| O |")
term.setCursorPos(25,6)
print("| |")
term.setCursorPos(25,7)
print("| |")
term.setCursorPos(25,8)
print("| |")
term.setCursorPos(25,9)
print("| O |")
term.setCursorPos(25,10)
print("| |")
term.setCursorPos(25,11)
print("+--------------+")
elseif x == 3 then
term.setCursorPos(25,3)
print("+--------------+")
term.setCursorPos(25,4)
print("| |")
term.setCursorPos(25,5)
print("| O |")
term.setCursorPos(25,6)
print("| |")
term.setCursorPos(25,7)
print("| O |")
term.setCursorPos(25,8)
print("| |")
term.setCursorPos(25,9)
print("| O |")
term.setCursorPos(25,10)
print("| |")
term.setCursorPos(25,11)
print("+--------------+")
elseif x == 4 then
term.setCursorPos(25,3)
print("+--------------+")
term.setCursorPos(25,4)
print("| |")
term.setCursorPos(25,5)
print("| O O |")
term.setCursorPos(25,6)
print("| |")
term.setCursorPos(25,7)
print("| |")
term.setCursorPos(25,8)
print("| |")
term.setCursorPos(25,9)
print("| O O |")
term.setCursorPos(25,10)
print("| |")
term.setCursorPos(25,11)
print("+--------------+")
elseif x == 5 then
term.setCursorPos(25,3)
print("+--------------+")
term.setCursorPos(25,4)
print("| |")
term.setCursorPos(25,5)
print("| O O |")
term.setCursorPos(25,6)
print("| |")
term.setCursorPos(25,7)
print("| O |")
term.setCursorPos(25,8)
print("| |")
term.setCursorPos(25,9)
print("| O O |")
term.setCursorPos(25,10)
print("| |")
term.setCursorPos(25,11)
print("+--------------+")
elseif x == 6 then
term.setCursorPos(25,3)
print("+--------------+")
term.setCursorPos(25,4)
print("| |")
term.setCursorPos(25,5)
print("| O O |")
term.setCursorPos(25,6)
print("| |")
term.setCursorPos(25,7)
print("| O O |")
term.setCursorPos(25,8)
print("| |")
term.setCursorPos(25,9)
print("| O O |")
term.setCursorPos(25,10)
print("| |")
term.setCursorPos(25,11)
print("+--------------+")
end
end
function roll()
local r = 1
for r = 1,50 do
parallel.waitForAll(die1,die2,sleep(.1))
end
end
function title()
term.setCursorPos(1,14)
print(" __ __ ___ _ ")
print(" / / __ ______/ /____ __ / _ (_)______ ")
print(" / /__/ // / __/ '_/ // / / // / / __/ -_)")
print(" /____/_,_/__/_/__, / /____/_/__/__/ ")
print(" /___/ ")
end
--code here
while true do
term.clear()
title()
blank()
event, p1 = os.pullEvent("key")
if p1 == 28 then
roll()
sleep(3)
end
end
Edit: Pastebin Here!