Advertisement
NolanSyKinsley

Untitled

Apr 1st, 2014
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.28 KB | None | 0 0
  1. ae = peripheral.wrap("left")
  2. p = peripheral.wrap("right")
  3. p.clear()
  4.  
  5. variables = {
  6. ["width"] = 200,
  7. ["height"] = 100,
  8. ["lineTransparency"] = 1,
  9. ["innerTransparency"] = 1,
  10. ["lineColour"] = 0x000000,
  11. ["middleColour"] = 0xFFFFFF,
  12. ["lineTransparency2"] = 1,
  13. ["innerTransparency2"] = 0,
  14. ["lineColour2"] = 0x000000,
  15. ["middleColour2"] = 0xFFFFFF
  16. }
  17. groups = {
  18. ["left_transparency"] = {
  19. [1] = {x=2, y=11, width=1, height="height+00",colour="middleColour+0",transparency="innerTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  20. [2] = {x=3, y=08, width=1, height="height+06",colour="middleColour+0",transparency="innerTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  21. [3] = {x=4, y=06, width=1, height="height+10",colour="middleColour+0",transparency="innerTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  22. [4] = {x=5, y=05, width=1, height="height+12",colour="middleColour+0",transparency="innerTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  23. [5] = {x=6, y=04, width=2, height="height+14",colour="middleColour+0",transparency="innerTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  24. [6] = {x=8, y=03, width=3, height="height+16",colour="middleColour+0",transparency="innerTransparency+0",obj=p.addBox(0,0,0,0,0,0)}
  25. },
  26. ["middle_transparency"] = {
  27. [1] = {x=11,y=2,width="width+0",height="height+18",colour="middleColour+0",transparency="innerTransparency+0",obj=p.addBox(0,0,0,0,0,0)}
  28. },
  29. ["right_transparency"] = {
  30. [1] = {x="width+11", y=03, width=3, height="height+16",colour="middleColour+0",transparency="innerTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  31. [2] = {x="width+14", y=04, width=2, height="height+14",colour="middleColour+0",transparency="innerTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  32. [3] = {x="width+16", y=05, width=1, height="height+12",colour="middleColour+0",transparency="innerTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  33. [4] = {x="width+17", y=06, width=1, height="height+10",colour="middleColour+0",transparency="innerTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  34. [5] = {x="width+18", y=08, width=1, height="height+06",colour="middleColour+0",transparency="innerTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  35. [6] = {x="width+19", y=11, width=1, height="height+00",colour="middleColour+0",transparency="innerTransparency+0",obj=p.addBox(0,0,0,0,0,0)}
  36. },
  37. ["top_left"] = {
  38. [1] = {x=8,y=2,width=3,height=1,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  39. [2] = {x=6,y=3,width=2,height=1,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  40. [3] = {x=4,y=5,width=1,height=1,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  41. [4] = {x=5,y=4,width=1,height=1,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  42. [5] = {x=3,y=6,width=1,height=2,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  43. [6] = {x=2,y=8,width=1,height=3,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)}
  44. },
  45. ["top"] = {
  46. [1] = {x=11,y=1,width="width+0",height=1,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)}
  47. },
  48. ["top_right"] = {
  49. [1] = {x="width+11",y=2,width=3,height=1,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  50. [2] = {x="width+14",y=3,width=2,height=1,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  51. [3] = {x="width+16",y=4,width=1,height=1,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  52. [4] = {x="width+17",y=5,width=1,height=1,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  53. [5] = {x="width+18",y=6,width=1,height=2,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  54. [6] = {x="width+19",y=8,width=1,height=3,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)}
  55. },
  56. ["left"] = {
  57. [1] = {x=1,y=11,width=1,height="height+0",colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)}
  58. },
  59. ["right"] = {
  60. [1] = {x="width+20",y=11,width=1,height="height+0",colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)}
  61. },
  62. ["bottom_left"] = {
  63. [1] = {x=2,y="height+11",width=1,height=3,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  64. [2] = {x=3,y="height+14",width=1,height=2,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  65. [3] = {x=4,y="height+16",width=1,height=1,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  66. [4] = {x=5,y="height+17",width=1,height=1,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  67. [5] = {x=6,y="height+18",width=2,height=1,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  68. [6] = {x=8,y="height+19",width=3,height=1,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)}
  69. },
  70. ["bottom"] = {
  71. [1] = {x=11,y="height+20",width="width+0",height=1,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)}
  72. },
  73. ["bottom_right"] = {
  74. [1] = {x="width+19",y="height+11",width=1,height=3,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  75. [2] = {x="width+18",y="height+14",width=1,height=2,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  76. [3] = {x="width+17",y="height+16",width=1,height=1,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  77. [4] = {x="width+16",y="height+17",width=1,height=1,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  78. [5] = {x="width+14",y="height+18",width=2,height=1,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)},
  79. [6] = {x="width+11",y="height+19",width=3,height=1,colour="lineColour+0",transparency="lineTransparency+0",obj=p.addBox(0,0,0,0,0,0)}
  80. }
  81. }
  82. function renderGroup(groupName)
  83. group = groups[groupName]
  84. for key, object in pairs(group) do
  85. if type(object["x"]) == "number" then
  86. object["obj"].setX(object["x"])
  87. elseif type(object["x"]) == "string" then
  88. t = {}
  89. for k, v in string.gmatch(object["x"], "(%w+)+(%w+)") do
  90. t[1] = k
  91. t[2] = v
  92. end
  93. object["obj"].setX(tonumber(variables[t[1]])+tonumber(t[2]))
  94. end
  95. if type(object["y"]) == "number" then
  96. object["obj"].setY(object["y"])
  97. elseif type(object["y"]) == "string" then
  98. t = {}
  99. for k, v in string.gmatch(object["y"], "(%w+)+(%w+)") do
  100. t[1] = k
  101. t[2] = v
  102. end
  103. object["obj"].setY(tonumber(variables[t[1]])+tonumber(t[2]))
  104. end
  105. if type(object["width"]) == "number" then
  106. object["obj"].setWidth(object["width"])
  107. elseif type(object["width"]) == "string" then
  108. t = {}
  109. for k, v in string.gmatch(object["width"], "(%w+)+(%w+)") do
  110. t[1] = k
  111. t[2] = v
  112. end
  113. object["obj"].setWidth(tonumber(variables[t[1]])+tonumber(t[2]))
  114. end
  115. if type(object["height"]) == "number" then
  116. object["obj"].setHeight(object["height"])
  117. elseif type(object["height"]) == "string" then
  118. t = {}
  119. for k, v in string.gmatch(object["height"], "(%w+)+(%w+)") do
  120. t[1] = k
  121. t[2] = v
  122. end
  123. object["obj"].setHeight(tonumber(variables[t[1]])+tonumber(t[2]))
  124. end
  125. if type(object["colour"]) == "number" then
  126. object["obj"].setColor(object["colour"])
  127. elseif type(object["colour"]) == "string" then
  128. t = {}
  129. for k, v in string.gmatch(object["colour"], "(%w+)+(%w+)") do
  130. t[1] = k
  131. t[2] = v
  132. end
  133. object["obj"].setColor(tonumber(variables[t[1]])+tonumber(t[2]))
  134. end
  135. if type(object["transparency"]) == "number" then
  136. object["obj"].setOpacity(object["transparency"])
  137. elseif type(object["transparency"]) == "string" then
  138. t = {}
  139. for k, v in string.gmatch(object["transparency"], "(%w+)+(%w+)") do
  140. t[1] = k
  141. t[2] = v
  142. end
  143. object["obj"].setOpacity(tonumber(variables[t[1]])+tonumber(t[2]))
  144. end
  145. end
  146. end
  147. function redraw()
  148. for key,value in pairs(groups) do
  149. renderGroup(key)
  150. end
  151. end
  152. redraw()
  153. while true do
  154. evt,command = os.pullEvent("chat_command")
  155. words = {}
  156. i = 0
  157. for word in string.gmatch(command, "%S+") do
  158. words[i] = word
  159. i = i + 1
  160. end
  161.  
  162. local AECapacity = false
  163. local AEValuables = false
  164. local RedStoneDown = false
  165.  
  166. if RedstoneDown == true then
  167. redstone.setOutput("down", true)
  168. else redstone.setOutput("down", false)
  169. end
  170.  
  171. if string.lower(words[0]) == "width" then
  172. variables["width"] = tonumber(words[1])
  173. redraw()
  174. elseif string.lower(words[0]) == "height" then
  175. variables["height"] = tonumber(words[1])
  176. redraw()
  177. elseif string.lower(words[0]) == "linecolour" then
  178. variables["lineColour"] = tonumber(words[1])
  179. redraw()
  180. elseif string.lower(words[0]) == "middlecolour" then
  181. variables["middleColour"] = tonumber(words[1])
  182. redraw()
  183. elseif string.lower(words[0]) == "linetransparency" then
  184. variables["lineTransparency"] = tonumber(words[1])
  185. redraw()
  186. elseif string.lower(words[0]) == "middletransparency" then
  187. variables["innerTransparency"] = tonumber(words[1])
  188. redraw()
  189. elseif string.lower(words[0]) == "suction" then
  190. RedstoneDown = (words[1])
  191. elseif string.lower(words[0]) == "kill" then
  192. p.clear()
  193. break
  194. end
  195. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement