Advertisement
klindley

Test

Jan 19th, 2017
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.38 KB | None | 0 0
  1. package.loaded.builder = nil
  2. os.execute("pastebin get -f TkSG91Zm builder.lua")
  3.  
  4. local gml = require("gml")
  5. local component = require("component")
  6. local builder = require("builder")
  7.  
  8. local gui = gml.create("center", "center", 32, 42)
  9.  
  10. local label=gui:addLabel("center", 2, 14, "Render Ellipse")
  11.  
  12. gui:addLabel(1, 3, 9, "Center")
  13. gui:addLabel(1, 4, 9, "Length")
  14. gui:addLabel(1, 5, 9, "Width")
  15. gui:addLabel(1, 6, 9, "Height")
  16. gui:addLabel(1, 7, 9, "Block")
  17. gui:addLabel(1, 8, 9, "Filled")
  18. local tp_center_x = gui:addTextField(10, 3, 5, "")
  19. local tp_center_y = gui:addTextField(16, 3, 5, "")
  20. local tp_center_z = gui:addTextField(22, 3, 5, "")
  21. local tp_length = gui:addTextField(10, 4, 5, "")
  22. local tp_width = gui:addTextField(10, 5, 5, "")
  23. local tp_height = gui:addTextField(10, 6, 5, "")
  24. local tp_block_id = gui:addTextField(10, 7, 5, "")
  25. local tp_block_meta = gui:addTextField(16, 7, 5, "")
  26. local tp_filled = gui:addTextField(10, 8, 5, "0")
  27.  
  28. function createEllipse()
  29.     builder.ellipse(tonumber(tp_center_x.text), tonumber(tp_center_y.text), tonumber(tp_center_z.text), tonumber(tp_length.text), tonumber(tp_width.text), tonumber(tp_height.text), tonumber(tp_block_id.text), tonumber(tp_block_meta.text), tonumber(tp_filled.text))
  30. end
  31.  
  32. local ellipse_button = gui:addButton("center", 10, 10, 1, "Render", createEllipse)
  33.  
  34. gui:addLabel("center", 11, 14, "Render Line")
  35. gui:addLabel(1, 12, 9, "Start x,y,z")
  36. gui:addLabel(1, 13, 9, "End x,y,z")
  37. gui:addLabel(1, 14, 9, "Height")
  38. gui:addLabel(1, 15, 9, "Block")
  39. local status = gui:addLabel(1, 16, 32, "")
  40.  
  41. local tp_x0 = gui:addTextField(10, 12, 5, "")
  42. local tp_y0 = gui:addTextField(16, 12, 5, "")
  43. local tp_z0 = gui:addTextField(22, 12, 5, "")
  44.  
  45. local tp_x1 = gui:addTextField(10, 13, 5, "")
  46. local tp_y1 = gui:addTextField(16, 13, 5, "")
  47. local tp_z1 = gui:addTextField(22, 13, 5, "")
  48.  
  49. local tp_line_height = gui:addTextField(10, 14, 5, "1")
  50.  
  51. local tp_line_block_id = gui:addTextField(10, 15, 5, "")
  52. local tp_line_block_meta = gui:addTextField(16, 15, 5, "")
  53.  
  54. function createLine()
  55.     error, message = builder.line(tonumber(tp_x0.text), tonumber(tp_y0.text), tonumber(tp_z0.text), tonumber(tp_x1.text), tonumber(tp_z1.text), tonumber(tp_line_height.text), tonumber(tp_line_block_id.text), tonumber(tp_line_block_meta.text))
  56.  
  57.     status.text = message
  58. end
  59. gui:addButton("center", 17, 10, 1, "Render", createLine)
  60.  
  61. os.execute("clear")
  62.  
  63. gui:run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement