Advertisement
FoxWorn3365

Minceraft

Jul 6th, 2021 (edited)
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.20 KB | None | 0 0
  1. ---------------------
  2. -- >> MINCERAFT << --
  3. ---------------------
  4. -- Versione: Alpha 0.1.2
  5. -- Sviluppatore: FoxWorn3365
  6. -- Agenzia di Distribuzione: FoxInvest Holding
  7. -- OS: CraftOS 1.5a
  8. ---------------------
  9. version = "Alpha 1.0.2"
  10. developer = "FoxWorn3365"
  11. holding = "FoxInvest Holding"
  12. os = "CraftOS 1.5a"
  13.  
  14. -- Definisco le variabili basiche
  15. start = 0 -- [0] Main Menu, [1] World Select, [2] Game, [3] Info
  16. ch = 500
  17.  
  18. -- Ora imlemento le funzioni che mi servono
  19. maxw, maxh = term.getSize()
  20. local function drawPixelInternal(xPos, yPos)
  21.     term.setCursorPos(xPos, yPos)
  22.     term.write(" ")
  23. end
  24.  
  25. local tColourLookup = {}
  26. for n = 1, 16 do
  27.     tColourLookup[string.byte("0123456789abcdef", n, n)] = 2 ^ (n - 1)
  28. end
  29.  
  30. function drawFilledBox(startX, startY, endX, endY, nColour)
  31.     if type(startX) ~= "number" or type(startX) ~= "number" or type(endX) ~=
  32.         "number" or type(endY) ~= "number" or
  33.         (nColour ~= nil and type(nColour) ~= "number") then
  34.         error("Expected startX, startY, endX, endY, colour", 2)
  35.     end
  36.  
  37.     startX = math.floor(startX)
  38.     startY = math.floor(startY)
  39.     endX = math.floor(endX)
  40.     endY = math.floor(endY)
  41.  
  42.     if nColour then term.setBackgroundColor(nColour) end
  43.     if startX == endX and startY == endY then
  44.         drawPixelInternal(startX, startY)
  45.         return
  46.     end
  47.  
  48.     local minX = math.min(startX, endX)
  49.     if minX == startX then
  50.         minY = startY
  51.         maxX = endX
  52.         maxY = endY
  53.     else
  54.         minY = endY
  55.         maxX = startX
  56.         maxY = startY
  57.     end
  58.  
  59.     for x = minX, maxX do for y = minY, maxY do drawPixelInternal(x, y) end end
  60. end
  61.  
  62. function clear()
  63.     sfondo(colors.black)
  64.     term.clear()
  65.     term.setCursorPos(1, 1)
  66. end
  67.  
  68. function clearRed()
  69.     sfondo(colors.red)
  70.     term.clear()
  71.     term.setCursorPos(1, 1)
  72. end
  73.  
  74. function titolo(testo)
  75.     drawFilledBox(1, 1, maxw, 1, colors.blue)
  76.     term.setCursorPos((maxw - #testo) / 2, 1)
  77.     term.setTextColor(colors.white)
  78.     term.write(testo)
  79. end
  80.  
  81. function bottone(color, text, x, y)
  82.    term.setBackgroundColor(colors[color])
  83.    term.setTextColor(colors.white)
  84.    term.setCursorPos(x, y)
  85.    print(text)
  86. end
  87.  
  88. function no()
  89.    term.setBackgroundColor(colors.white)
  90.    term.setTextColor(colors.black)
  91. end
  92.  
  93. function rMessage()
  94. local number = math.random(1, 15)
  95. if number == 1 then
  96.    print("Viva la FoxInvest Holding")
  97. elseif number == 2 then
  98.    print("EPCO o EPPECO :thonk:")
  99. elseif number == 3 then
  100.    print(version)
  101. elseif number == 4 then
  102.    print("RGBCraft nel cuore")
  103. elseif number == 5 then
  104.    print("Ma la Microsol esiste?")
  105. elseif number == 6 then
  106.    print("/lego11")
  107. elseif number == 7 then
  108.    print("Discord dimmerda")
  109. elseif number == 8 then
  110.    print("Adesso dobbiamo fare un discorsetto")
  111. elseif number == 9 then
  112.    print("Questo e' perche' non usi l'ME")
  113. elseif number == 10 then
  114.    print("Il gas puo' tutto")
  115. else
  116.    print("ERROR")
  117. end
  118. end
  119. -- Ora inizio con il programma
  120. while true do
  121. if start == 0 then
  122. -- HOMEPAGE [0]
  123. titolo("Minceraft.ccp")
  124. print("\n\nBenvenuto sul launcher ufficiale di Minceraft!")
  125. print("")
  126. rMessage()
  127.  
  128. local event, button, x, y = os.pullEvent("mouse_click")
  129. end
  130. sleep(0.2)
  131. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement