Rolcam

Mall Kiosk Program - Condemned Network Mall

Feb 23rd, 2024 (edited)
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2. This program is designed for use with Computercraft
  3. This is a modern version of the kiosk program designed for use in Minecraft versions newer than 1.6.4
  4. Custom version for: The Condemned Network - The 1.12 Pack player mall
  5. Kiosk Specs: 2 blocks wide by 3 blocks tall advanced monitor
  6.  
  7. Programmed by Rolcam
  8. You can copy/modify this program as you wish, just please leave the documentation intact
  9.  
  10. ]]--
  11. -- Mall Location Variable (mLoc) - This determines what text based sign the kiosk is to display when it cycles back to its main screen
  12. -- Default Locations: 0 - Ad Agency Demo | 1 - Rolcam's Bar & Grill | 2 - McDonalds Kiosk
  13. mLoc = 0
  14. -- Time variable for how long (in seconds) to display each sign
  15. t = 5
  16.  
  17. oldTerm = term.current()
  18.  
  19. --Redirects setup/install output to monitor (for artistic effect)
  20. tSides = {"left","right","bottom","top","front","back"}
  21.  
  22. for i = 1, #tSides do
  23.   monitor = peripheral.wrap(tSides[i])
  24.   if monitor then
  25.         side = tSides[i]
  26.         break
  27.   end
  28. end
  29.  
  30.  
  31. --Prevents program termination
  32. os.pullEvent = os.pullEventRaw
  33.  
  34. if not fs.exists("boot") then
  35.     term.setTextColor(colors.red)
  36.     print("Warning: boot image missing!")
  37.     print("Downloading image...")
  38.     term.setTextColor(colors.white)
  39.     shell.run("pastebin get JUKMFJSe boot")
  40.     term.setTextColor(colors.green)
  41.     print("Kiosk boot image downloaded.")
  42.     term.setTextColor(colors.white)
  43. else
  44.     term.setTextColor(colors.green)
  45.     print("boot image found!")
  46.     term.setTextColor(colors.white)
  47. end
  48. local img = paintutils.loadImage("boot")
  49. term.redirect(monitor)
  50. paintutils.drawImage(img, 1,1)
  51. term.redirect(oldTerm)
  52. term.setBackgroundColor(colors.blue)
  53. term.setTextColor(colors.orange)
  54. term.clear()
  55. print("Rolcam's Kiosk Program V1")
  56. term.setTextColor(colors.white)
  57. print(" ")
  58. print("Beginning system check...")
  59. --Checks for missing signs and labels itself
  60. print("Checking signs...")
  61. if not fs.exists("image") then
  62.     term.setTextColor(colors.red)
  63.     print("Warning: advert image missing!")
  64.     term.setTextColor(colors.white)
  65.     print("Downloading image...")
  66.     shell.run("pastebin get fDigRNmG image")
  67.     term.setTextColor(colors.green)
  68.     print("File downloaded")
  69.     term.setTextColor(colors.white)
  70. else
  71.     term.setTextColor(colors.green)
  72.     print("beach image found!")
  73.     term.setTextColor(colors.white)
  74. end
  75.  
  76. if not fs.exists("ad2") then
  77.     term.setTextColor(colors.red)
  78.     print("Warning: Kiosk advert sign is missing!")
  79.     term.setTextColor(colors.white)
  80.     print("Downloading image...")
  81.     shell.run("pastebin get WwMDuBuY ad2")
  82.     term.setTextColor(colors.green)
  83.     print("File downloaded")
  84.     term.setTextColor(colors.white)
  85. else
  86.     term.setTextColor(colors.green)
  87.     print("Kiosk advert sign image found!")
  88.     term.setTextColor(colors.white)
  89. end
  90. adSign2 = paintutils.loadImage("ad2")
  91.  
  92. if mLoc == 2 then
  93.     if not fs.exists("McDonalds") then
  94.         term.setTextColor(colors.red)
  95.         print("Warning: Kiosk McDonalds sign is missing!")
  96.         term.setTextColor(colors.white)
  97.         print("Downloading image...")
  98.         shell.run("pastebin get J3PTn6ze McDonalds")
  99.         term.setTextColor(colors.green)
  100.         print("File downloaded")
  101.         term.setTextColor(colors.white)
  102.     else
  103.         term.setTextColor(colors.green)
  104.         print("Kiosk McDonalds sign found!")
  105.         term.setTextColor(colors.white)
  106.     end
  107. end
  108. McDon = paintutils.loadImage("McDonalds")
  109.  
  110.        
  111.  
  112.  
  113.  
  114. print("Sign check completed!")
  115. print("Checking for computer label")
  116. if os.getComputerLabel() == nil then
  117.     term.setTextColor(colors.red)
  118.     print("Warning: Computer is not labeled!")
  119.     print("Labelling Computer")
  120.     os.setComputerLabel("Mall - Advert Kiosk")
  121.     term.setTextColor(colors.white)
  122. else
  123.     term.setTextColor(colors.green)
  124.     print("Computer is already labelled. Great!")
  125.     term.setTextColor(colors.white)
  126. end
  127. print("System Check Completed!")
  128. sleep(1)
  129. print("Starting Kiosk!")
  130.  
  131. -- Displays text overlay over images - Modify this to fit your needs
  132. function adText()
  133.     if mLoc == 0 then
  134.         term.setBackgroundColor(colors.black)
  135.         term.clear()
  136.         term.setCursorPos(1,1)
  137.         term.setTextColor(colors.orange)
  138.         print("  Condemned Mall  ")
  139.         print("Advertising Agency")
  140.         print("    Demo Kiosk    ")
  141.         print(" ")
  142.         term.setTextColor(colors.yellow)
  143.         sleep(0.5)
  144.         print("Pricing Rates --->")
  145.         print(" ")
  146.         sleep(0.5)
  147.         print("<--- Example Text ")
  148.         sleep(0.5)
  149.         print(" Example Text --->")
  150.     elseif mLoc == 1 then
  151.         term.setBackgroundColor(colors.black)
  152.         term.clear()
  153.         term.setTextColor(colors.orange)
  154.         term.setCursorPos(1,1)
  155.         print("    Welcome to    ")
  156.         print("     Rolcam's     ")
  157.         print("   Bar & Grill!   ")
  158.         print(" ")
  159.         print("    Food Menu:    ")
  160.         print("Cheese Wheels: $25")
  161.         print("Venison Burg: $20")
  162.         print("Paradise Burg: $10")
  163.         print("Deluxe Nachos: $10")
  164.         print("Onion Rings: $5  ")
  165.         print("Fries: $5")
  166.         print(" ")
  167.         print("   Drinks Menu:   ")
  168.         print("Kumis: $10")
  169.         print("Mead: $10")
  170.         print("Cider: TBD")
  171.         print("Cider [Intox]: TBD")
  172.         print("Ale: TBD")
  173.         print("Lager: TBD")
  174.     elseif mLoc == 2 then
  175.             term.clear()
  176.             paintutils.drawImage(McDon, 1, 1)
  177.             term.setTextColor(colors.yellow)
  178.             term.setCursorPos(1,10)
  179.             print("    Welcome to     ")
  180.             print("     McDonalds     ")
  181.             print("                   ")
  182.             print("    Order Here!    ")
  183.     else
  184.         term.setTextColor(colors.orange)
  185.         term.setBackgroundColor(colors.black)
  186.         term.setCursorPos(2,14)
  187.         term.write(" Your Ad Here! ")
  188.         term.setCursorPos(2,15)
  189.         print(" Contact Rolcam ")
  190.         term.setCursorPos(2,16)
  191.         print(" for details! ")
  192.         term.setTextColor(colors.white)
  193.         term.setCursorPos(1,1)
  194.     end
  195. end
  196.  
  197.  
  198.  
  199. mLoc2 = mLoc
  200.  
  201. term.redirect(monitor)
  202. adSign = paintutils.loadImage("image")
  203. while redstone.getInput("left") == true do
  204.     sleep(1)
  205. end
  206. while true do
  207.     mLoc = mLoc2
  208.     adText()
  209.     sleep(10)
  210.     mLoc = 999
  211.     paintutils.drawImage(adSign, 1, 1)
  212.     adText()
  213.     sleep(t)
  214.     mLoc = mLoc2
  215.     adText()
  216.     sleep(10)
  217.     mLoc = 999
  218.     paintutils.drawImage(adSign2, 1, 1)
  219.     adText()
  220.     sleep(t)
  221. end
Add Comment
Please, Sign In to add comment