LolzPB

sito

May 27th, 2020
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. function createKey(progr)
  2. function genKey()
  3. alpha = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}
  4. str = ""
  5. for i=1, 12 do
  6. ind = math.random(26)
  7. if i == 5 or i == 9 or i == 13 then
  8. str = str.."-"
  9. end
  10. str = str..alpha[ind]
  11. end
  12. return str
  13. end
  14.  
  15. http.get("http://kamino.a-centauri.com:62380/product.php?richiesta=insert&key="..genKey().."&program="..progr)
  16.  
  17. end
  18.  
  19. function blank()
  20. term.clear()
  21. term.setBackgroundColor(colors.white)
  22. term.setTextColor(colors.white)
  23. term.clear()
  24. term.setCursorPos(1, 1)
  25. end
  26.  
  27. cPage = "home"
  28.  
  29. function blankPage()
  30. blank()
  31. term.setCursorPos(1, 1)
  32. for i=1, 51 do
  33. term.setBackgroundColor(colors.black)
  34. term.write(" ")
  35. end
  36. term.setCursorPos(1, 1)
  37. term.write("Home")
  38. term.setCursorPos(6, 1)
  39. term.write("Negozio")
  40. end
  41.  
  42.  
  43. function drawHomePage()
  44. blankPage()
  45. term.setCursorPos(1, 1)
  46. term.setTextColor(colors.yellow)
  47. term.write("Home")
  48. term.setBackgroundColor(colors.white)
  49. term.setTextColor(colors.black)
  50. term.setCursorPos(2, 3)
  51. term.write("La ZEUS åA8 felice di darvi il benvenuto sul nostro")
  52. term.setCursorPos(2, 4)
  53. term.write("sito. Qui potrete comprare gran parte dei nostri")
  54. term.setCursorPos(2, 5)
  55. term.write("programmi oppure potrete richiedere assistenza.")
  56. term.setCursorPos(2, 7)
  57. term.write("News: ")
  58. term.setCursorPos(2, 8)
  59. term.write("Linux åA8 pronto al rilascio!")
  60. term.setCursorPos(2, 9)
  61. term.write("Finalmente potrete comprare un disco")
  62. term.setCursorPos(2, 10)
  63. term.write("di installazione per Linux a soli 4IC!")
  64. end
  65.  
  66. function drawShopPage()
  67. blankPage()
  68. term.setCursorPos(6, 1)
  69. term.setTextColor(colors.yellow)
  70. term.write("Negozio")
  71. term.setBackgroundColor(colors.white)
  72. term.setTextColor(colors.black)
  73. term.setCursorPos(2, 3)
  74. term.write("")
  75. end
  76.  
  77. function checkClick()
  78. while true do
  79. _, btn, x, y = os.pullEvent("mouse_click")
  80. if btn == 1 and x <= 4 and y == 1 then
  81. os.queueEvent("homepage")
  82. elseif btn == 1 and x >= 6 and x <= 13 and y == 1 then
  83. os.queueEvent("shoppage")
  84. end
  85. end
  86. end
  87.  
  88. function checkPage()
  89. while true do
  90. _ = os.pullEvent()
  91. if _ == "homepage" then
  92. if cPage ~= "home" then
  93. drawHomePage()
  94. end
  95. cPage = "home"
  96. elseif _ == "shoppage" then
  97. if cPage ~= "shop" then
  98. drawShopPage()
  99. end
  100. cPage = "shop"
  101. end
  102. end
  103. end
  104.  
  105. drawHomePage()
  106. parallel.waitForAll(checkPage, checkClick)
Advertisement
Add Comment
Please, Sign In to add comment