Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mon = peripheral.wrap("right")
- local bal = 100
- function touchScreen()
- event, side, xPos, yPos = os.pullEvent("monitor_touch")
- print(event .. " => Side: " .. tostring(side) .. ", " ..
- "X: " .. tostring(xPos) .. ", " ..
- "Y: " .. tostring(yPos))
- end
- function compVersion()
- mon.clear()
- mon.setCursorPos(2,1)
- mon.setTextColor(colors.yellow)
- mon.write("Prep Computer v1.25")
- end
- function backButton()
- --MainProgram
- compVersion()
- mon.setCursorPos(24,6)
- mon.setTextColor(colors.red)
- mon.write("WELCOME FIGHTER!")
- mon.setCursorPos(9,8)
- mon.setTextColor(colors.blue)
- mon.write("Before entering the arena let's buy some gear!")
- mon.setCursorPos(11,9)
- mon.write("To get started simply right click [Shop]")
- mon.setCursorPos(29,16)
- mon.setBackgroundColor(colors.green)
- mon.write("[Shop]")
- mon.setBackgroundColor(colors.black)
- while true do
- touchScreen()
- if (xPos > 28 and xPos < 36) and (yPos > 15 and yPos < 17) then
- compVersion()
- mon.setCursorPos(21,6)
- mon.setTextColor(colors.red)
- mon.write("Welcome to the shop!")
- mon.setCursorPos(13,8)
- mon.setTextColor(colors.blue)
- mon.write("You're given $100 dollars use it wisely")
- mon.setCursorPos(13,9)
- mon.write("Your balance is in the top right corner")
- mon.setCursorPos(54,3)
- mon.setTextColor(colors.green)
- mon.write("$" .. tostring(bal))
- mon.setTextColor(colors.blue)
- mon.setCursorPos(24,10)
- mon.write("Select a category")
- mon.setCursorPos(18,11)
- mon.write("Note items are non refundable")
- mon.setCursorPos(13,18)
- mon.setBackgroundColor(colors.green)
- mon.write("[Armor]")
- mon.setCursorPos(24,18)
- mon.write("[Bow & Arrows]")
- mon.setCursorPos(42,18)
- mon.write("[Swords]")
- mon.setBackgroundColor(colors.black)
- touchScreen()
- if (xPos > 12 and xPos < 20) and (yPos > 17 and yPos < 19) then
- compVersion()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement