Advertisement
patrick11514

Untitled

Dec 23rd, 2020
901
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.20 KB | None | 0 0
  1. local comp = require("component")
  2. local http = require("internet")
  3.  
  4. local holo = comp.hologram
  5. local mx = 48
  6. local my = 32
  7. local mz = 48
  8.  
  9. local word_size = 4
  10. local start_x, start_y, start_z
  11. local current_x, current_y, current_z
  12.  
  13. local spawnx, spawny, spawnz
  14.  
  15. local holo_side
  16.  
  17. local row
  18.  
  19. local a =
  20. "#00#"..
  21. "0##0"..
  22. "0000"..
  23. "0##0"..
  24. "0##0"
  25. local b =
  26. "000#"..
  27. "0##0"..
  28. "000#"..
  29. "0##0"..
  30. "000#"
  31. local c =
  32. "#000"..
  33. "0###"..
  34. "0###"..
  35. "0###"..
  36. "#000"
  37. local d =
  38. "000#"..
  39. "0##0"..
  40. "0##0"..
  41. "0##0"..
  42. "000#"
  43. local e =
  44. "0000"..
  45. "0###"..
  46. "000#"..
  47. "0###"..
  48. "0000"
  49. local f =
  50. "0000"..
  51. "0###"..
  52. "000#"..
  53. "0###"..
  54. "0###"
  55. local g =
  56. "#000"..
  57. "0###"..
  58. "0#00"..
  59. "0##0"..
  60. "#000"
  61. local h =
  62. "0##0"..
  63. "0##0"..
  64. "0000"..
  65. "0##0"..
  66. "0##0"
  67. local j =
  68. "###0"..
  69. "###0"..
  70. "###0"..
  71. "0##0"..
  72. "#00#"
  73. local i =
  74. "#0#"..
  75. "#0#"..
  76. "#0#"..
  77. "#0#"..
  78. "#0#"
  79. local k =
  80. "0##0"..
  81. "0#0#"..
  82. "00##"..
  83. "0#0#"..
  84. "0##0"
  85. local l =
  86. "0###"..
  87. "0###"..
  88. "0###"..
  89. "0###"..
  90. "0000"
  91. local m =
  92. "0###0"..
  93. "00#00"..
  94. "0#0#0"..
  95. "0###0"..
  96. "0###0"
  97. local n =
  98. "0##0"..
  99. "00#0"..
  100. "0#00"..
  101. "0##0"..
  102. "0##0"
  103. local o =
  104. "#00#"..
  105. "0##0"..
  106. "0##0"..
  107. "0##0"..
  108. "#00#"
  109. local p =
  110. "000#"..
  111. "0##0"..
  112. "000#"..
  113. "0###"..
  114. "0###"
  115. local q =
  116. "#00#"..
  117. "0##0"..
  118. "0##0"..
  119. "0#00"..
  120. "#000"
  121. local r =
  122. "000#"..
  123. "0##0"..
  124. "000#"..
  125. "0#0#"..
  126. "0##0"
  127. local s =
  128. "#000"..
  129. "0###"..
  130. "#00#"..
  131. "###0"..
  132. "000#"
  133. local t =
  134. "000"..
  135. "#0#"..
  136. "#0#"..
  137. "#0#"..
  138. "#0#"
  139. local u =
  140. "0##0"..
  141. "0##0"..
  142. "0##0"..
  143. "0##0"..
  144. "#00#"
  145. local v =
  146. "0#0"..
  147. "0#0"..
  148. "0#0"..
  149. "0#0"..
  150. "#0#"
  151. local w =
  152. "0###0"..
  153. "0###0"..
  154. "0###0"..
  155. "0#0#0"..
  156. "#0#0#"
  157. local x =
  158. "0#0"..
  159. "0#0"..
  160. "#0#"..
  161. "0#0"..
  162. "0#0"
  163. local y =
  164. "0#0"..
  165. "0#0"..
  166. "000"..
  167. "#0#"..
  168. "#0#"
  169. local z =
  170. "0000"..
  171. "###0"..
  172. "##0#"..
  173. "#0##"..
  174. "0000"
  175. local one =
  176. "#0#"..
  177. "00#"..
  178. "#0#"..
  179. "#0#"..
  180. "000"
  181. local two =
  182. "#00#"..
  183. "0##0"..
  184. "##0#"..
  185. "#0##"..
  186. "0000"
  187. local three =
  188. "000#"..
  189. "###0"..
  190. "#00#"..
  191. "###0"..
  192. "000#"
  193. local four =
  194. "0##0"..
  195. "0##0"..
  196. "0##0"..
  197. "#000"..
  198. "###0"
  199. local five =
  200. "0000"..
  201. "0###"..
  202. "000#"..
  203. "###0"..
  204. "000#"
  205. local six =
  206. "#00#"..
  207. "0###"..
  208. "000#"..
  209. "0##0"..
  210. "#00#"
  211. local seven =
  212. "0000"..
  213. "###0"..
  214. "##0#"..
  215. "#0##"..
  216. "#0##"
  217. local eight =
  218. "#00#"..
  219. "0##0"..
  220. "#00#"..
  221. "0##0"..
  222. "#00#"
  223. local nine =
  224. "#00#"..
  225. "0##0"..
  226. "#000"..
  227. "###0"..
  228. "###0"
  229. local zero =
  230. "#00#"..
  231. "0##0"..
  232. "0##0"..
  233. "0##0"..
  234. "#00#"
  235. local dot =
  236. "###"..
  237. "###"..
  238. "###"..
  239. "###"..
  240. "#0#"
  241. local d_dot =
  242. "#"..
  243. "0"..
  244. "#"..
  245. "0"..
  246. "#"
  247. local q_m =
  248. "#00#"..
  249. "###0"..
  250. "#00#"..
  251. "####"..
  252. "#0##"
  253. local ex_m =
  254. "#0#"..
  255. "#0#"..
  256. "#0#"..
  257. "###"..
  258. "#0#"
  259. local empty =
  260. "####"..
  261. "####"..
  262. "####"..
  263. "####"..
  264. "####"
  265.  
  266.  
  267. holo.setScale(3)
  268.  
  269. function Split(text, chunkSize)
  270.     local s = {}
  271.     for i=1, #text, chunkSize do
  272.         s[#s+1] = text:sub(i,i+chunkSize - 1)
  273.     end
  274.     return s
  275. end
  276.  
  277. function clear_holo()
  278.     holo.clear()
  279. end
  280.  
  281. function set_spawn(x, y, z, side)
  282.     side = side or "north"
  283.     holo_side = side
  284.  
  285.     if (x > mx or x < 1) then
  286.         print("x must be between 1-"..mx)
  287.         os.exit()
  288.     end
  289.  
  290.     if (y > my or y < 1) then
  291.         print("y must be between 1-"..my)
  292.         os.exit()
  293.     end
  294.  
  295.     if (z > mz or z < 1) then
  296.         print("z must be between 1-"..mz)
  297.         os.exit()
  298.     end
  299.  
  300.     start_x = x
  301.     current_x = x
  302.     start_y = y
  303.     current_y = y
  304.     start_z = z
  305.     current_z = z
  306. end
  307.  
  308. function print_alp(word)
  309.     if (current_x + 4) >= mx then
  310.         current_x = start_x
  311.         current_y = current_y - 6
  312.  
  313.         print("Pisi na dalsi radek")
  314.     end
  315.     if (current_z + 4) >= mz then
  316.         current_z = start_z
  317.         current_y = current_y - 5
  318.     end
  319.  
  320.     if (current_y - 5) <= 0 then
  321.         print("Dojel jsi na konec")
  322.         return false
  323.     end
  324.     if word == "a" or word == "A" then
  325.         row = Split(a, word_size)
  326.        
  327.     elseif word == "b" or word == "B" then
  328.         row = Split(b, word_size)
  329.        
  330.     elseif word == "c" or word == "C" then
  331.         row = Split(c, word_size)
  332.        
  333.     elseif word == "d" or word == "D" then
  334.         row = Split(d, word_size)
  335.        
  336.     elseif word == "e" or word == "E" then
  337.         row = Split(e, word_size)
  338.        
  339.     elseif word == "f" or word == "F" then
  340.         row = Split(f, word_size)
  341.        
  342.     elseif word == "g" or word == "G" then
  343.         row = Split(g, word_size)
  344.        
  345.     elseif word == "h" or word == "H" then
  346.         row = Split(h, word_size)
  347.        
  348.     elseif word == "i" or word == "I" then
  349.         word_size = 3
  350.         row = Split(i, word_size)
  351.        
  352.     elseif word == "j" or word == "J" then
  353.         row = Split(j, word_size)
  354.        
  355.     elseif word == "k" or word == "K" then
  356.         row = Split(k, word_size)
  357.        
  358.     elseif word == "l" or word == "L" then
  359.         row = Split(l, word_size)
  360.        
  361.     elseif word == "m" or word == "M" then
  362.         word_size = 5
  363.         row = Split(m, word_size)
  364.        
  365.     elseif word == "n" or word == "N" then
  366.         row = Split(n, word_size)
  367.        
  368.     elseif word == "o" or word == "O" then
  369.         row = Split(o, word_size)
  370.        
  371.     elseif word == "p" or word == "P" then
  372.         row = Split(p, word_size)
  373.        
  374.     elseif word == "q" or word == "Q" then
  375.         row = Split(q, word_size)
  376.        
  377.     elseif word == "r" or word == "R" then
  378.         row = Split(r, word_size)
  379.        
  380.     elseif word == "s" or word == "S" then
  381.         row = Split(s, word_size)
  382.        
  383.     elseif word == "t" or word == "T" then
  384.         word_size = 3
  385.         row = Split(t, word_size)
  386.        
  387.     elseif word == "u" or word == "U" then
  388.         row = Split(u, word_size)
  389.        
  390.     elseif word == "v" or word == "V" then
  391.         word_size = 3
  392.         row = Split(v, word_size)
  393.        
  394.     elseif word == "w" or word == "W" then
  395.         word_size = 5
  396.         row = Split(w, word_size)
  397.        
  398.     elseif word == "x" or word == "X" then
  399.         word_size = 3
  400.         row = Split(x, word_size)
  401.        
  402.     elseif word == "y" or word == "Y" then
  403.         word_size = 3
  404.         row = Split(y, word_size)
  405.        
  406.     elseif word == "z" or word == "Z" then
  407.         row = Split(z, word_size)
  408.        
  409.     elseif word == "1" then
  410.         word_size = 3
  411.         row = Split(one, word_size)
  412.        
  413.     elseif word == "2" then
  414.         row = Split(two, word_size)
  415.        
  416.     elseif word == "3" then
  417.         row = Split(three, word_size)
  418.        
  419.     elseif word == "4" then
  420.         row = Split(four, word_size)
  421.        
  422.     elseif word == "5" then
  423.         row = Split(five, word_size)
  424.        
  425.     elseif word == "6" then
  426.         row = Split(six, word_size)
  427.        
  428.     elseif word == "7" then
  429.         row = Split(seven, word_size)
  430.        
  431.     elseif word == "8" then
  432.         row = Split(eight, word_size)
  433.        
  434.     elseif word == "9" then
  435.         row = Split(nine, word_size)
  436.        
  437.     elseif word == "0" then
  438.         row = Split(zero, word_size)
  439.        
  440.     elseif word == "." then
  441.         word_size = 3
  442.         row = Split(dot, word_size)
  443.        
  444.     elseif word == ":" then
  445.         word_size = 1
  446.         row = Split(d_dot, word_size)
  447.        
  448.     elseif word == "?" then
  449.         row = Split(q_m, word_size)
  450.        
  451.     elseif word == "!" then
  452.         word_size = 3
  453.         row = Split(ex_m, word_size)
  454.        
  455.     elseif word == " " then
  456.         word_size = 2
  457.         current_x = current_x + word_size + 1
  458.         word_size = 4
  459.         return true
  460.     elseif word == "*" then
  461.         row = Split(empty, word_size)
  462.        
  463.     else
  464.         return true
  465.     end
  466.  
  467.     for k,v in pairs(row) do
  468.         local word = Split(v, 1)
  469.         for kk,vv in pairs(word) do
  470.             if vv == "0" then
  471.                 if holo_side == "east" then
  472.                     holo.set((current_x), (current_y - k), (current_z + kk), true)
  473.                 elseif holo_side == "south" then
  474.                     holo.set((current_x - kk), (current_y - k), (current_z), true)
  475.                 elseif holo_side == "west" then
  476.                     holo.set((current_x), (current_y - k), (current_z - kk), true)
  477.                 else
  478.                     holo.set((current_x + kk), (current_y - k), current_z, true)
  479.                 end
  480.             else
  481.                 if holo_side == "east" then
  482.                     holo.set((current_x), (current_y - k), (current_z + kk), false)
  483.                 elseif holo_side == "south" then
  484.                     holo.set((current_x - kk), (current_y - k), (current_z), false)
  485.                 elseif holo_side == "west" then
  486.                     holo.set((current_x), (current_y - k), (current_z - kk), false)
  487.                 else
  488.                     holo.set((current_x + kk), (current_y - k), current_z, false)
  489.                 end
  490.             end
  491.         end
  492.     end
  493.     if holo_side == "east" then
  494.         current_z = current_z + word_size + 1
  495.         for i=1,5 do
  496.             holo.set(current_x, current_y - i, current_z, false)
  497.         end
  498.     elseif holo_side == "south" then
  499.         current_x = current_x - word_size - 1
  500.         for i=1,5 do
  501.             holo.set(current_x, current_y - i, current_z, false)
  502.         end
  503.     elseif holo_side == "west" then
  504.         current_z = current_z - word_size - 1
  505.         for i=1,5 do
  506.             holo.set(current_x, current_y - i, current_z, false)
  507.         end
  508.     else
  509.         current_x = current_x + word_size + 1
  510.         for i=1,5 do
  511.             holo.set(current_x, current_y - i, current_z, false)
  512.         end
  513.     end
  514.     word_size = 4
  515. end
  516.  
  517. function print_word(word)
  518.     for k,v in pairs(Split(word, 1)) do
  519.         if print_alp(v) == false then
  520.             break
  521.         end
  522.     end
  523. end
  524.  
  525.  
  526. clear_holo()
  527.  
  528. set_spawn(1, 32, 1)
  529. print_word("Ahoj jak se mas?")
  530.  
  531. set_spawn(20, 32, 20, "east")
  532. print_word("LOL")
  533.  
  534. set_spawn(20, 20, 20, "south")
  535. print_word("LOL")
  536.  
  537. set_spawn(20, 10, 20, "west")
  538. print_word("LOL")
  539. --while true do
  540. --    set_spawn(1,32,20)
  541. --    local data = http.request("https://vote.patrick115.eu/ocapi.php?n=patrick115")
  542. --    local string = ""
  543. --    for chunk in data do
  544. --        string = string..chunk
  545. --    end
  546. --    print_word(string)
  547. --    os.sleep(1)
  548. --end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement