JustDoesGames

CraftFunctions

Aug 1st, 2018
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.68 KB | None | 0 0
  1. -- CraftFunctions --
  2. -- Created by JustDoesGames --
  3. -- Date of Creation: 8/1/2018 --
  4.  
  5. local version = 1.1
  6.  
  7. -- Detect is Device has Color --
  8. if term.isColor() == true then
  9. print("Color Detected")
  10. color = true
  11. else
  12. print("No Color Detected")
  13. color = false
  14. end
  15.  
  16. -- faster way of clearing the screen --
  17. function cls()
  18. shell.run("clear")
  19. end
  20.  
  21. function colora(rgb)
  22. -- Checks if computer is coloured or not and replaces color with appropriate one --
  23. if color == true then
  24. if rgb == "black" then
  25. term.setTextColor(colours.black)
  26. elseif rgb == "white" then
  27. term.setTextColor(colours.white)
  28. elseif rgb == "red" then
  29. term.setTextColor(colours.red)
  30. elseif rgb == "green" then
  31. term.setTextColor(colours.green)
  32. elseif rgb == "blue" then
  33. term.setTextColor(colours.blue)
  34. elseif rgb == "orange" then
  35. term.setTextColor(colours.orange)
  36. elseif rgb == "purple" then
  37. term.setTextColor(colours.purple)
  38. elseif rgb == "yellow" then
  39. term.setTextColor(colours.yellow)
  40. elseif rgb == "lime" then
  41. term.setTextColor(colours.lime)
  42. elseif rgb == "grey" then
  43. term.setTextColor(colours.grey)
  44. end
  45. else
  46. if rgb == "black" then
  47. term.setTextColor(colours.black)
  48. elseif rgb == "white" then
  49. term.setTextColor(colours.white)
  50. elseif rgb == "red" then
  51. term.setTextColor(colours.red)
  52. elseif rgb == "green" then
  53. term.setTextColor(colours.white)
  54. elseif rgb == "blue" then
  55. term.setTextColor(colours.grey)
  56. elseif rgb == "orange" then
  57. term.setTextColor(colours.grey)
  58. elseif rgb == "purple" then
  59. term.setTextColor(colours.grey)
  60. elseif rgb == "yellow" then
  61. term.setTextColor(colours.white)
  62. elseif rgb == "lime" then
  63. term.setTextColor(colours.white)
  64. elseif rgb == "grey" then
  65. term.setTextColor(colours.grey)
  66. end
  67. end
  68. end
  69.  
  70. function colorb(rgb)
  71.  
  72. -- Checks if computer is coloured or not and replaces color with appropriate one --
  73. if color == true then
  74. if rgb == "black" then
  75. term.setBackgroundColor(colours.black)
  76. elseif rgb == "white" then
  77. term.setBackgroundColor(colours.white)
  78. elseif rgb == "red" then
  79. term.setBackgroundColor(colours.red)
  80. elseif rgb == "green" then
  81. term.setBackgroundColor(colours.green)
  82. elseif rgb == "blue" then
  83. term.setBackgroundColor(colours.blue)
  84. elseif rgb == "orange" then
  85. term.setBackgroundColor(colours.orange)
  86. elseif rgb == "purple" then
  87. term.setBackgroundColor(colours.purple)
  88. elseif rgb == "yellow" then
  89. term.setBackgroundColor(colours.yellow)
  90. elseif rgb == "lime" then
  91. term.setBackgroundColor(colours.lime)
  92. elseif rgb == "grey" then
  93. term.setBackgroundColor(colours.grey)
  94. end
  95. else
  96. if rgb == "black" then
  97. term.setBackgroundColor(colours.black)
  98. elseif rgb == "white" then
  99. term.setBackgroundColor(colours.white)
  100. elseif rgb == "red" then
  101. term.setBackgroundColor(colours.red)
  102. elseif rgb == "green" then
  103. term.setBackgroundColor(colours.white)
  104. elseif rgb == "blue" then
  105. term.setBackgroundColor(colours.grey)
  106. elseif rgb == "orange" then
  107. term.setBackgroundColor(colours.grey)
  108. elseif rgb == "purple" then
  109. term.setBackgroundColor(colours.grey)
  110. elseif rgb == "yellow" then
  111. term.setBackgroundColor(colours.white)
  112. elseif rgb == "lime" then
  113. term.setBackgroundColor(colours.white)
  114. elseif rgb == "grey" then
  115. term.setBackgroundColor(colours.grey)
  116. end
  117. end
  118. end
  119.  
  120. function RN()
  121. local right = peripheral.getType("right")
  122. local left = peripheral.getType("left")
  123. local top = peripheral.getType("top")
  124. local bottom = peripheral.getType("bottom")
  125. local back = peripheral.getType("back")
  126. local front = peripheral.getType("front")
  127.  
  128. if right == "modem" then
  129. rednet.open("right")
  130. colora("green")
  131. write("Rednet Found on ")
  132. colora("red")
  133. write("Right")
  134. colora("green")
  135. print(" Side")
  136. sleep(1)
  137. cls()
  138. elseif left == "modem" then
  139. rednet.open("left")
  140. colora("green")
  141. write("Rednet Found on ")
  142. colora("red")
  143. write("Left")
  144. colora("green")
  145. print(" Side")
  146. sleep(1)
  147. cls()
  148. elseif top == "modem" then
  149. rednet.open("top")
  150. colora("green")
  151. write("Rednet Found on ")
  152. colora("red")
  153. write("Top")
  154. colora("green")
  155. print(" Side")
  156. sleep(1)
  157. cls()
  158. elseif bottom == "modem" then
  159. rednet.open("bottom")
  160. colora("green")
  161. write("Rednet Found on ")
  162. colora("red")
  163. write("Bottom")
  164. colora("green")
  165. print(" Side")
  166. sleep(1)
  167. cls()
  168. elseif back == "modem" then
  169. rednet.open("back")
  170. colora("green")
  171. write("Rednet Found on ")
  172. colora("red")
  173. write("Back")
  174. colora("green")
  175. print(" Side")
  176. sleep(1)
  177. cls()
  178. elseif front == "modem" then
  179. rednet.open("front")
  180. colora("green")
  181. write("Rednet Found on ")
  182. colora("red")
  183. write("Front")
  184. colora("green")
  185. print(" Side")
  186. sleep(1)
  187. cls()
  188. else
  189. error("Rednet: Could not locate Rednet on a Side")
  190. end
  191. end
  192.  
  193. a = 1
  194. -- Splash Screen --
  195. while true do
  196. colorb("black")
  197. cls()
  198. colora("yellow")
  199. write("Powered by ")
  200. colora("white")
  201. print("CraftFunctions.")
  202. colora("yellow")
  203. write("Created by ")
  204. colora("white")
  205. print("JustDoesGames.")
  206. colora("purple")
  207. print("version", version)
  208.  
  209. colorb("white")
  210. if a == 1 then
  211. print(" ")
  212. elseif a == 2 then
  213. print(" ")
  214. elseif a == 3 then
  215. print(" ")
  216. elseif a == 4 then
  217. print(" ")
  218. elseif a == 5 then
  219. print(" ")
  220. elseif a == 6 then
  221. print(" ")
  222. elseif a == 7 then
  223. print(" ")
  224. elseif a == 8 then
  225. print(" ")
  226. elseif a == 9 then
  227. print(" ")
  228. elseif a == 10 then
  229. print(" ")
  230. elseif a == 11 then
  231. print(" ")
  232. elseif a == 12 then
  233. print(" ")
  234. elseif a == 13 then
  235. print(" ")
  236. elseif a == 14 then
  237. print(" ")
  238. elseif a == 15 then
  239. print(" ")
  240. elseif a == 16 then
  241. print(" ")
  242. elseif a == 17 then
  243. print(" ")
  244. elseif a == 18 then
  245. print(" ")
  246. elseif a == 19 then
  247. print(" ")
  248. elseif a == 20 then
  249. print(" ")
  250. elseif a == 21 then
  251. print(" ")
  252. elseif a == 22 then
  253. print(" ")
  254. elseif a == 23 then
  255. print(" ")
  256. elseif a == 24 then
  257. print(" ")
  258. elseif a == 25 then
  259. print(" ")
  260. elseif a == 26 then
  261. print(" ")
  262. elseif a == 27 then
  263. print(" ")
  264. sleep(.5)
  265. term.setCursorPos(27,3)
  266. print(" ")
  267. sleep(.5)
  268. term.setCursorPos(27,2)
  269. print(" ")
  270. sleep(.5)
  271. term.setCursorPos(27,1)
  272. print(" ")
  273. sleep(1.5)
  274. colorb("black")
  275. cls()
  276. break
  277. end
  278. sleep(.05)
  279. a = a + 1
  280. end
Advertisement
Add Comment
Please, Sign In to add comment