Advertisement
Alakazard12

Withdraw

Aug 3rd, 2014
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 48.37 KB | None | 0 0
  1. os.loadAPI("bapi")
  2. local mag = peripheral.wrap("bottom")
  3. local pim = peripheral.wrap("pim_1")
  4. local chest = peripheral.wrap("container_chest_1")
  5.  
  6.  
  7. -- Nova GUI API lightweight edition. By alakazard12
  8. -- Feel free to use this as long as you give me credit, but there's no documentation yet
  9.  
  10. local LGW, LGH = term.getSize()
  11.  
  12. local VColors = {}
  13. local VClasses = {
  14.     ["TextButton"] = true;
  15.     ["TextLabel"] = true;
  16.     ["TextBox"] = true;
  17.     ["ImageButton"] = true;
  18.     ["ImageLabel"] = true;
  19. }
  20.  
  21. for _,Color in pairs(colors) do
  22.     if type(Color) == "number" then
  23.         VColors[Color] = true
  24.     end
  25. end
  26.  
  27. local function Round(Number)
  28.     return math.floor(Number + 0.5)
  29. end
  30.  
  31. local Check
  32. function Check(Object, BG, PX, PY, ChangeP)
  33.     if Object.Visible == true then
  34.         if Object.Class == "TextButton" or Object.Class == "TextBox" or Object.Class == "TextLabel" or Object.Class == "ImageButton" or Object.Class == "ImageLabel" then
  35.             -- if ChangeP ~= true then
  36.                 PX = PX + Object.Position[1] - 1
  37.                 PY = PY + Object.Position[2] - 1
  38.             -- end
  39.             if Object.ShowBackground == true then
  40.                 BG = Object.BackgroundColor
  41.             end
  42.             if Object.Class == "TextBox" and Object.Focused == true then
  43.                 BG = Object.ActiveTextColor
  44.             end
  45.             term.setBackgroundColor(BG)
  46.             for Y = 1, Object.Size[2] do
  47.                 term.setCursorPos(PX, PY + Y - 1)
  48.                 term.write(string.rep(" ", Object.Size[1]))
  49.             end
  50.  
  51.             if Object.Class == "ImageButton" or Object.Class == "ImageLabel" and Object.Image then
  52.                 paintutils.drawImage(Object.Image, PX, PY)
  53.             end
  54.  
  55.             if Object.Class == "TextButton" or Object.Class == "TextBox" or Object.Class == "TextLabel" then
  56.                 if Object.ShowText == true then
  57.                     term.setTextColor(Object.TextColor)
  58.  
  59.                     local Text = Object.Text
  60.                     if Object.TextChar then
  61.                         Text = string.rep(Object.TextChar, #Text)
  62.                     end
  63.  
  64.                     if Object.Focused == true then
  65.                         Text = Text .. " "
  66.                     end
  67.  
  68.                     if Object.MultiLine == true then
  69.                         local LastP = 1
  70.                         local LastS
  71.                         local Lines = {}
  72.                         local DidBreak = false
  73.                         local RPassed = false
  74.                         local ROnLine = false
  75.                         local ROnNum
  76.                         local RLine
  77.                         for On = 1, #Text do
  78.                             if Text:sub(On, On) == " " then
  79.                                 LastS = On
  80.                             end
  81.  
  82.                             if On - LastP + 2 > Object.Size[1] then
  83.                                 if #Lines == Object.Size[2] then
  84.                                     break
  85.                                 end
  86.  
  87.                                 if LastS then
  88.                                     table.insert(Lines, Text:sub(LastP, LastS))
  89.                                     LastP = LastS + 1
  90.                                 else
  91.                                     table.insert(Lines, Text:sub(LastP, On))
  92.                                     LastP = On + 1
  93.                                 end
  94.  
  95.                                 LastS = nil
  96.  
  97.                                 if #Lines == Object.Size[2] then
  98.                                     if Object.Focused == false then
  99.                                         DidBreak = true
  100.                                         break
  101.                                     else
  102.                                         table.remove(Lines, 1)
  103.                                     end
  104.                                 end
  105.                             end
  106.                         end
  107.  
  108.                         if DidBreak == false then
  109.                             table.insert(Lines, Text:sub(LastP))
  110.                         elseif Object.Focused == true then
  111.                             table.remove(Lines, 1)
  112.                             table.insert(Lines, Text:sub(LastP))
  113.                         end
  114.  
  115.                         local TextCount = 0
  116.  
  117.                         for _,Line in pairs(Lines) do
  118.                             local XA = 0
  119.                             local YA = 0
  120.  
  121.                             if Object.TextXAlignment == 0 then
  122.                                 XA = PX
  123.                             elseif Object.TextXAlignment == 1 then
  124.                                 XA = PX + Round((Object.Size[1] - #Line) / 2)
  125.                             else
  126.                                 XA = PX + Round(Object.Size[1] - #Line)
  127.                             end
  128.  
  129.                             if Object.TextYAlignment == 0 then
  130.                                 YA = PY + _ - 1
  131.                             elseif Object.TextYAlignment == 1 then
  132.                                 YA = PY + Round((Object.Size[2] - #Lines) / 2) + _ - 1
  133.                             else
  134.                                 YA = PY + Round(Object.Size[2] - #Lines) + _ - 1
  135.                             end
  136.  
  137.                             term.setCursorPos(XA, YA)
  138.                             term.write(Line)
  139.                         end
  140.                     else
  141.                         if #Text > Object.Size[1] then
  142.                             if Object.Focused == false then
  143.                                 Text = string.sub(Text, 1, Object.Size[1])
  144.                             -- elseif Object.RTextPos then
  145.                             -- Text = string.sub(Text, Object.RTextPos, Object.RTextPos + Object.Size[1] - 1)
  146.                             else
  147.                                 Text = string.sub(Text, #Text - Object.Size[1] + 1, #Text)
  148.                             end
  149.                         end
  150.  
  151.                         local XA = 0
  152.                         local YA = 0
  153.  
  154.                         if Object.TextXAlignment == 0 then
  155.                             XA = PX
  156.                         elseif Object.TextXAlignment == 1 then
  157.                             XA = PX + Round((Object.Size[1] - #Text) / 2)
  158.                         else
  159.                             XA = PX + Round(Object.Size[1] - #Text)
  160.                         end
  161.  
  162.                         if Object.TextYAlignment == 0 then
  163.                             YA = PY
  164.                         elseif Object.TextYAlignment == 1 then
  165.                             YA = PY + Round((Object.Size[2] - 1) / 2)
  166.                         else
  167.                             YA = PY + Round(Object.Size[2] - 1)
  168.                         end
  169.  
  170.                         term.setCursorPos(XA, YA)
  171.                         term.write(Text)
  172.                     end
  173.                     -- if Object.RTextPos == nil then
  174.                         Object.TextPos = {term.getCursorPos()}
  175.                         Object.TextPos[1] = Object.TextPos[1] - 1
  176.                     -- end
  177.                 end
  178.             end
  179.  
  180.             for _,Obj in pairs(Object.Children) do
  181.                 Check(Obj, BG, PX, PY)
  182.             end
  183.         end
  184.     end
  185. end
  186.  
  187. local function SortListen(Tbl)
  188.     local Clone = {}
  189.     for _,Item in pairs(Tbl) do
  190.         Clone[_] = Item
  191.     end
  192.     table.sort(Clone, function(A, B)
  193.         return A.ZIndex > B.ZIndex
  194.     end)
  195.     return Clone
  196. end
  197.  
  198. local function NewClass(Par, Class, Main)
  199.     if type(Class) ~= "string" then
  200.         error("bad argument #1: string expected, got " .. type(Class), 2)
  201.     end
  202.     if not VClasses[Class] then
  203.         error("Invalid class name.", 2)
  204.     end
  205.  
  206.     local PublicTable = {}
  207.     local LocalTable = {}
  208.  
  209.     LocalTable.Parent = Par
  210.     LocalTable.Class = Class
  211.  
  212.     function PublicTable:ClearChildren()
  213.         LocalTable.Children = {}
  214.     end
  215.  
  216.     if Class == "ImageButton" or Class == "ImageLabel" then
  217.         LocalTable.Size = {2, 2}
  218.         LocalTable.Position = {1, 1}
  219.         LocalTable.Visible = true
  220.         LocalTable.Active = true
  221.         LocalTable.Children = {}
  222.         LocalTable.ZIndex = 0
  223.         LocalTable.ShowBackground = true
  224.  
  225.         function PublicTable:Size(X, Y)
  226.             if type(X) ~= "number" then
  227.                 error("bad argument #1: number expected, got " .. type(X), 2)
  228.             end
  229.             if type(Y) ~= "number" then
  230.                 error("bad argument #2: number expected, got " .. type(Y), 2)
  231.             end
  232.  
  233.             LocalTable.Size = {X, Y}
  234.         end
  235.  
  236.         function PublicTable:Image(Image)
  237.             if type(Image) ~= "table" then
  238.                 error("bad argument #1: table expected, got " .. type(Image), 2)
  239.             end
  240.  
  241.             LocalTable.Image = Image
  242.         end
  243.  
  244.         function PublicTable:GetSize()
  245.             return unpack(LocalTable.Size)
  246.         end
  247.  
  248.         function PublicTable:ShowBackground(Bool)
  249.             if type(Bool) ~= "boolean" then
  250.                 error("bad argument #1: boolean expected, got " .. type(Bool), 2)
  251.             end
  252.             LocalTable.ShowBackground = Bool
  253.         end
  254.  
  255.         function PublicTable:GetShowBackground()
  256.             return LocalTable.ShowBackground
  257.         end
  258.  
  259.         function PublicTable:ZIndex(Number)
  260.             if type(Number) ~= "number" then
  261.                 error("bad argument #1: number expected, got " .. type(Number), 2)
  262.             end
  263.             LocalTable.ZIndex = Number
  264.             table.sort(Par.Children, function(A, B)
  265.                 return A.ZIndex < B.ZIndex
  266.             end)
  267.         end
  268.  
  269.         function PublicTable:GetZIndex()
  270.             return LocalTable.ZIndex
  271.         end
  272.  
  273.         function PublicTable:Position(X, Y)
  274.             if type(X) ~= "number" then
  275.                 error("bad argument #1: number expected, got " .. type(X), 2)
  276.             end
  277.             if type(Y) ~= "number" then
  278.                 error("bad argument #2: number expected, got " .. type(Y), 2)
  279.             end
  280.             LocalTable.Position = {X, Y}
  281.         end
  282.  
  283.         function PublicTable:GetPosition()
  284.             return unpack(LocalTable.Position)
  285.         end
  286.  
  287.         function PublicTable:Visible(Bool)
  288.             if type(Bool) ~= "boolean" then
  289.                 error("bad argument #1: boolean expected, got " .. type(Bool), 2)
  290.             end
  291.             LocalTable.Visible = Bool
  292.         end
  293.  
  294.         function PublicTable:GetVisible()
  295.             return LocalTable.Visible
  296.         end
  297.  
  298.         function PublicTable:Active(Bool)
  299.             if type(Bool) ~= "boolean" then
  300.                 error("bad argument #1: boolean expected, got " .. type(Bool), 2)
  301.             end
  302.             LocalTable.Active = Bool
  303.         end
  304.  
  305.         function PublicTable:GetActive()
  306.             return LocalTable.Active
  307.         end
  308.  
  309.         function PublicTable:BackgroundColor(Color)
  310.             if type(Color) ~= "number" then
  311.                 error("bad argument #1: number expected, got " .. type(Color), 2)
  312.             end
  313.             if VColors[Color] ~= true then
  314.                 error("Invalid color.", 2)
  315.             end
  316.             LocalTable.BackgroundColor = Color
  317.         end
  318.  
  319.         function PublicTable:GetBackgroundColor()
  320.             return LocalTable.BackgroundColor
  321.         end
  322.  
  323.         if Class == "ImageButton" then
  324.             function PublicTable:Button1Click(Function)
  325.                 if Function == nil then
  326.                     LocalTable.Button1Click = nil
  327.                 else
  328.                     if type(Function) ~= "function" then
  329.                         error("bad argument #1: function expected, got " .. type(Function), 2)
  330.                     end
  331.                     LocalTable.Button1Click = Function
  332.                 end
  333.             end
  334.  
  335.             function PublicTable:GetButton1Click()
  336.                 return LocalTable.Button1Click
  337.             end
  338.  
  339.             function PublicTable:MouseScroll(Function)
  340.                 if Function == nil then
  341.                     LocalTable.MouseScroll = nil
  342.                 else
  343.                     if type(Function) ~= "function" then
  344.                         error("bad argument #1: function expected, got " .. type(Function), 2)
  345.                     end
  346.                     LocalTable.MouseScroll = Function
  347.                 end
  348.             end
  349.  
  350.             function PublicTable:GetMouseScroll()
  351.                 return LocalTable.MouseScroll
  352.             end
  353.  
  354.             function PublicTable:MouseDrag1(Function)
  355.                 if Function == nil then
  356.                     LocalTable.MouseDrag1 = nil
  357.                 else
  358.                     if type(Function) ~= "function" then
  359.                         error("bad argument #1: function expected, got " .. type(Function), 2)
  360.                     end
  361.                     LocalTable.MouseDrag1 = Function
  362.                 end
  363.             end
  364.  
  365.             function PublicTable:GetMouseDrag1()
  366.                 return LocalTable.MouseDrag1
  367.             end
  368.  
  369.             function PublicTable:MouseDrag2(Function)
  370.                 if Function == nil then
  371.                     LocalTable.MouseDrag2 = nil
  372.                 else
  373.                     if type(Function) ~= "function" then
  374.                         error("bad argument #1: function expected, got " .. type(Function), 2)
  375.                     end
  376.                     LocalTable.MouseDrag2 = Function
  377.                 end
  378.             end
  379.  
  380.             function PublicTable:GetMouseDrag2()
  381.                 return LocalTable.MouseDrag2
  382.             end
  383.  
  384.             function PublicTable:MouseDrag3(Function)
  385.                 if Function == nil then
  386.                     LocalTable.MouseDrag3 = nil
  387.                 else
  388.                     if type(Function) ~= "function" then
  389.                         error("bad argument #1: function expected, got " .. type(Function), 2)
  390.                     end
  391.                     LocalTable.MouseDrag3 = Function
  392.                 end
  393.             end
  394.  
  395.             function PublicTable:GetMouseDrag3()
  396.                 return LocalTable.MouseDrag3
  397.             end
  398.  
  399.             function PublicTable:Button2Click(Function)
  400.                 if Function == nil then
  401.                     LocalTable.Button2Click = nil
  402.                 else
  403.                     if type(Function) ~= "function" then
  404.                         error("bad argument #1: function expected, got " .. type(Function), 2)
  405.                     end
  406.                     LocalTable.Button2Click = Function
  407.                 end
  408.             end
  409.  
  410.             function PublicTable:GetButton2Click()
  411.                 return LocalTable.Button2Click
  412.             end
  413.  
  414.             function PublicTable:Button3Click(Function)
  415.                 if Function == nil then
  416.                     LocalTable.Button3Click = nil
  417.                 else
  418.                     if type(Function) ~= "function" then
  419.                         error("bad argument #1: function expected, got " .. type(Function), 2)
  420.                     end
  421.                     LocalTable.Button3Click = Function
  422.                 end
  423.             end
  424.  
  425.             function PublicTable:GetButton3Click()
  426.                 return LocalTable.Button3Click
  427.             end
  428.         end
  429.  
  430.         function PublicTable:New(Class)
  431.             return NewClass(LocalTable, Class, Main)
  432.         end
  433.  
  434.         function PublicTable:Draw()
  435.             local BG = Main.BackgroundColor
  436.             local FoundBG = false
  437.             local PX, PY = 1, 1
  438.  
  439.             local On = LocalTable.Parent
  440.             while On ~= Main do
  441.                 PX = PX + On.Position[1] - 1
  442.                 PY = PY + On.Position[2] - 1
  443.  
  444.                 if On.ShowBackground and FoundBG == false then
  445.                     BG = On.BackgroundColor
  446.                     FoundBG = true
  447.                 end
  448.                 On = On.Parent
  449.             end
  450.  
  451.             Check(LocalTable, BG, PX, PY)
  452.         end
  453.     elseif Class == "TextButton" or Class == "TextLabel" or Class == "TextBox" then
  454.         LocalTable.Size = {2, 2}
  455.         LocalTable.Position = {1, 1}
  456.         LocalTable.RawText = ""
  457.         LocalTable.Text = ""
  458.         LocalTable.BackgroundColor = colors.cyan
  459.         LocalTable.TextColor = colors.white
  460.         LocalTable.Visible = true
  461.         LocalTable.Active = true
  462.         LocalTable.Children = {}
  463.         LocalTable.ZIndex = 0
  464.         LocalTable.ShowBackground = true
  465.         LocalTable.ShowText = true
  466.         LocalTable.TextXAlignment = 1
  467.         LocalTable.TextYAlignment = 1
  468.         LocalTable.MultiLine = false
  469.  
  470.         if Class == "TextBox" then
  471.             LocalTable.ActiveTextColor = colors.blue
  472.             LocalTable.Overlap = false
  473.             LocalTable.Focused = false
  474.             LocalTable.ClearTextOnFocus = false
  475.             LocalTable.RTextPos = 8
  476.         end
  477.  
  478.         function PublicTable:TextXAlignment(Num)
  479.             if type(Num) == "string" then
  480.                 if Num:lower() == "left" then
  481.                     Num = 0
  482.                 elseif Num:lower() == "center" then
  483.                     Num = 1
  484.                 elseif Num:lower() == "right" then
  485.                     Num = 2
  486.                 else
  487.                     error("bad argument #1: '" .. Num .. "' is not a valid string", 2)
  488.                 end
  489.             end
  490.  
  491.             if type(Num) ~= "number" then
  492.                 error("bad argument #1: number expected, got " .. type(X), 2)
  493.             end
  494.             LocalTable.TextXAlignment = Num
  495.         end
  496.  
  497.         function PublicTable:GetTextXAlignment()
  498.             return LocalTable.TextXAlignment
  499.         end
  500.  
  501.         function PublicTable:TextYAlignment(Num)
  502.             if type(Num) == "string" then
  503.                 if Num:lower() == "top" then
  504.                     Num = 0
  505.                 elseif Num:lower() == "center" then
  506.                     Num = 1
  507.                 elseif Num:lower() == "bottom" then
  508.                     Num = 2
  509.                 else
  510.                     error("bad argument #1: '" .. Num .. "' is not a valid string", 2)
  511.                 end
  512.             end
  513.  
  514.             if type(Num) ~= "number" then
  515.                 error("bad argument #1: number expected, got " .. type(X), 2)
  516.             end
  517.             LocalTable.TextYAlignment = Num
  518.         end
  519.  
  520.         function PublicTable:GetTextYAlignment()
  521.             return LocalTable.TextYAlignment
  522.         end
  523.  
  524.         function PublicTable:Size(X, Y)
  525.             if type(X) ~= "number" then
  526.                 error("bad argument #1: number expected, got " .. type(X), 2)
  527.             end
  528.             if type(Y) ~= "number" then
  529.                 error("bad argument #2: number expected, got " .. type(Y), 2)
  530.             end
  531.  
  532.             LocalTable.Size = {X, Y}
  533.         end
  534.  
  535.         function PublicTable:GetSize()
  536.             return unpack(LocalTable.Size)
  537.         end
  538.  
  539.         function PublicTable:ShowBackground(Bool)
  540.             if type(Bool) ~= "boolean" then
  541.                 error("bad argument #1: boolean expected, got " .. type(Bool), 2)
  542.             end
  543.             LocalTable.ShowBackground = Bool
  544.         end
  545.  
  546.         function PublicTable:GetShowBackground()
  547.             return LocalTable.ShowBackground
  548.         end
  549.  
  550.         function PublicTable:ShowText(Bool)
  551.             if type(Bool) ~= "boolean" then
  552.                 error("bad argument #1: boolean expected, got " .. type(Bool), 2)
  553.             end
  554.             LocalTable.ShowText = Bool
  555.         end
  556.  
  557.         function PublicTable:GetShowText()
  558.             return LocalTable.ShowText
  559.         end
  560.  
  561.         function PublicTable:MultiLine(Bool)
  562.             if type(Bool) ~= "boolean" then
  563.                 error("bad argument #1: boolean expected, got " .. type(Bool), 2)
  564.             end
  565.             LocalTable.MultiLine = Bool
  566.         end
  567.  
  568.         function PublicTable:GetMultiLine()
  569.             return LocalTable.MultiLine
  570.         end
  571.  
  572.         function PublicTable:ZIndex(Number)
  573.             if type(Number) ~= "number" then
  574.                 error("bad argument #1: number expected, got " .. type(Number), 2)
  575.             end
  576.             LocalTable.ZIndex = Number
  577.             table.sort(Par.Children, function(A, B)
  578.                 return A.ZIndex < B.ZIndex
  579.             end)
  580.         end
  581.  
  582.         function PublicTable:GetZIndex()
  583.             return LocalTable.ZIndex
  584.         end
  585.  
  586.         function PublicTable:Position(X, Y)
  587.             if type(X) ~= "number" then
  588.                 error("bad argument #1: number expected, got " .. type(X), 2)
  589.             end
  590.             if type(Y) ~= "number" then
  591.                 error("bad argument #2: number expected, got " .. type(Y), 2)
  592.             end
  593.             LocalTable.Position = {X, Y}
  594.         end
  595.  
  596.         function PublicTable:GetPosition()
  597.             return unpack(LocalTable.Position)
  598.         end
  599.  
  600.         function PublicTable:Visible(Bool)
  601.             if type(Bool) ~= "boolean" then
  602.                 error("bad argument #1: boolean expected, got " .. type(Bool), 2)
  603.             end
  604.             LocalTable.Visible = Bool
  605.         end
  606.  
  607.         function PublicTable:GetVisible()
  608.             return LocalTable.Visible
  609.         end
  610.  
  611.         function PublicTable:Active(Bool)
  612.             if type(Bool) ~= "boolean" then
  613.                 error("bad argument #1: boolean expected, got " .. type(Bool), 2)
  614.             end
  615.             LocalTable.Active = Bool
  616.         end
  617.  
  618.         function PublicTable:GetActive()
  619.             return LocalTable.Active
  620.         end
  621.  
  622.         function PublicTable:Text(Text)
  623.             if Text == nil then
  624.                 Text = ""
  625.             end
  626.             if type(Text) ~= "string" then
  627.                 error("bad argument #1: string expected, got " .. type(Text), 2)
  628.             end
  629.             LocalTable.Text = Text
  630.         end
  631.  
  632.         function PublicTable:GetText()
  633.             return LocalTable.Text
  634.         end
  635.  
  636.         function PublicTable:BackgroundColor(Color)
  637.             if type(Color) ~= "number" then
  638.                 error("bad argument #1: number expected, got " .. type(Color), 2)
  639.             end
  640.             if VColors[Color] ~= true then
  641.                 error("Invalid color.", 2)
  642.             end
  643.             LocalTable.BackgroundColor = Color
  644.         end
  645.  
  646.         function PublicTable:GetBackgroundColor()
  647.             return LocalTable.BackgroundColor
  648.         end
  649.  
  650.         function PublicTable:TextColor(Color)
  651.             if type(Color) ~= "number" then
  652.                 error("bad argument #1: number expected, got " .. type(Color), 2)
  653.             end
  654.             if VColors[Color] ~= true then
  655.                 error("Invalid color.", 2)
  656.             end
  657.             LocalTable.TextColor = Color
  658.         end
  659.  
  660.         function PublicTable:GetTextColor()
  661.             return LocalTable.TextColor
  662.         end
  663.  
  664.         function PublicTable:MouseScroll(Function)
  665.                 if Function == nil then
  666.                     LocalTable.MouseScroll = nil
  667.                 else
  668.                 if type(Function) ~= "function" then
  669.                     error("bad argument #1: function expected, got " .. type(Function), 2)
  670.                 end
  671.                 LocalTable.MouseScroll = Function
  672.             end
  673.         end
  674.  
  675.         if Class == "TextButton" then
  676.             function PublicTable:Button1Click(Function)
  677.                 if Function == nil then
  678.                     LocalTable.Button1Click = nil
  679.                 else
  680.                     if type(Function) ~= "function" then
  681.                         error("bad argument #1: function expected, got " .. type(Function), 2)
  682.                     end
  683.                     LocalTable.Button1Click = Function
  684.                 end
  685.             end
  686.  
  687.             function PublicTable:GetButton1Click()
  688.                 return LocalTable.Button1Click
  689.             end
  690.  
  691.             function PublicTable:GetMouseScroll()
  692.                 return LocalTable.MouseScroll
  693.             end
  694.  
  695.             function PublicTable:MouseDrag1(Function)
  696.                 if Function == nil then
  697.                     LocalTable.MouseDrag1 = nil
  698.                 else
  699.                     if type(Function) ~= "function" then
  700.                         error("bad argument #1: function expected, got " .. type(Function), 2)
  701.                     end
  702.                     LocalTable.MouseDrag1 = Function
  703.                 end
  704.             end
  705.  
  706.             function PublicTable:GetMouseDrag1()
  707.                 return LocalTable.MouseDrag1
  708.             end
  709.  
  710.             function PublicTable:MouseDrag2(Function)
  711.                 if Function == nil then
  712.                     LocalTable.MouseDrag2 = nil
  713.                 else
  714.                     if type(Function) ~= "function" then
  715.                         error("bad argument #1: function expected, got " .. type(Function), 2)
  716.                     end
  717.                     LocalTable.MouseDrag2 = Function
  718.                 end
  719.             end
  720.  
  721.             function PublicTable:GetMouseDrag2()
  722.                 return LocalTable.MouseDrag2
  723.             end
  724.  
  725.             function PublicTable:MouseDrag3(Function)
  726.                 if Function == nil then
  727.                     LocalTable.MouseDrag3 = nil
  728.                 else
  729.                     if type(Function) ~= "function" then
  730.                         error("bad argument #1: function expected, got " .. type(Function), 2)
  731.                     end
  732.                     LocalTable.MouseDrag3 = Function
  733.                 end
  734.             end
  735.  
  736.             function PublicTable:GetMouseDrag3()
  737.                 return LocalTable.MouseDrag3
  738.             end
  739.  
  740.             function PublicTable:Button2Click(Function)
  741.                 if Function == nil then
  742.                     LocalTable.Button2Click = nil
  743.                 else
  744.                     if type(Function) ~= "function" then
  745.                         error("bad argument #1: function expected, got " .. type(Function), 2)
  746.                     end
  747.                     LocalTable.Button2Click = Function
  748.                 end
  749.             end
  750.  
  751.             function PublicTable:GetButton2Click()
  752.                 return LocalTable.Button2Click
  753.             end
  754.  
  755.             function PublicTable:Button3Click(Function)
  756.                 if Function == nil then
  757.                     LocalTable.Button3Click = nil
  758.                 else
  759.                     if type(Function) ~= "function" then
  760.                         error("bad argument #1: function expected, got " .. type(Function), 2)
  761.                     end
  762.                     LocalTable.Button3Click = Function
  763.                 end
  764.             end
  765.  
  766.             function PublicTable:GetButton3Click()
  767.                 return LocalTable.Button3Click
  768.             end
  769.         elseif Class == "TextBox" then
  770.             function PublicTable:ActiveTextColor(Color)
  771.                 if type(Color) ~= "number" then
  772.                     error("bad argument #1: number expected, got " .. type(Color), 2)
  773.                 end
  774.                 if VColors[Color] ~= true then
  775.                     error("Invalid color.", 2)
  776.                 end
  777.                 LocalTable.ActiveTextColor = Color
  778.             end
  779.  
  780.             function PublicTable:EnterPress(Function)
  781.                 if Function == nil then
  782.                     LocalTable.EnterPress = nil
  783.                 else
  784.                     if type(Function) ~= "function" then
  785.                         error("bad argument #1: function expected, got " .. type(Function), 2)
  786.                     end
  787.                     LocalTable.EnterPress = Function
  788.                 end
  789.             end
  790.  
  791.             function PublicTable:GetEnterPress()
  792.                 return LocalTable.EnterPress
  793.             end
  794.  
  795.             function PublicTable:Overlap(Bool)
  796.                 if type(Bool) ~= "boolean" then
  797.                     error("bad argument #1: boolean expected, got " .. type(Bool), 2)
  798.                 end
  799.                 LocalTable.Overlap = Bool
  800.             end
  801.  
  802.             function PublicTable:GetOverlap()
  803.                 return LocalTable.Overlap
  804.             end
  805.  
  806.             function PublicTable:ClearTextOnFocus(Bool)
  807.                 if type(Bool) ~= "boolean" then
  808.                     error("bad argument #1: boolean expected, got " .. type(Bool), 2)
  809.                 end
  810.                 LocalTable.ClearTextOnFocus = Bool
  811.             end
  812.  
  813.             function PublicTable:GetClearTextOnFocus()
  814.                 return LocalTable.ClearTextOnFocus
  815.             end
  816.  
  817.             function PublicTable:Focus()
  818.                 Main.MakeFocus = LocalTable
  819.                 os.queueEvent("")
  820.             end
  821.  
  822.             function PublicTable:StopFocus()
  823.                 Main.StopFocus = true
  824.                 os.queueEvent("")
  825.             end
  826.  
  827.             function PublicTable:TextChar(Char)
  828.                 if Char == nil then
  829.                     LocalTable.TextChar = nil
  830.                 else
  831.                     if type(Char) ~= "string" then
  832.                         error("bad argument #1: string expected, got " .. type(Char), 2)
  833.                     end
  834.                     LocalTable.TextChar = Char
  835.                 end
  836.             end
  837.  
  838.             function PublicTable:GetTextChar()
  839.                 return LocalTable.TextChar
  840.             end
  841.         end
  842.  
  843.         function PublicTable:New(Class)
  844.             return NewClass(LocalTable, Class, Main)
  845.         end
  846.  
  847.         function PublicTable:Draw()
  848.             local BG = Main.BackgroundColor
  849.             local FoundBG = false
  850.             local PX, PY = 1, 1
  851.  
  852.             local On = LocalTable.Parent
  853.             while On ~= Main do
  854.                 PX = PX + On.Position[1] - 1
  855.                 PY = PY + On.Position[2] - 1
  856.  
  857.                 if On.ShowBackground and FoundBG == false then
  858.                     BG = On.BackgroundColor
  859.                     FoundBG = true
  860.                 end
  861.                 On = On.Parent
  862.             end
  863.  
  864.             Check(LocalTable, BG, PX, PY , true)
  865.         end
  866.     end
  867.  
  868.     LocalTable.Pub = PublicTable
  869.  
  870.     table.insert(Par.Children, LocalTable)
  871.  
  872.     function PublicTable:Destroy()
  873.         for _,Object in pairs(Par.Children) do
  874.             if LocalTable == Object then
  875.                 table.remove(Par.Children, _)
  876.                 break
  877.             end
  878.         end
  879.         LocalTable = nil
  880.         PublicTable = nil
  881.     end
  882.  
  883.     return PublicTable
  884. end
  885.  
  886. local function NewUI()
  887.     local LocalTable = {}
  888.     local PublicTable = {}
  889.  
  890.     LocalTable.BackgroundColor = colors.red
  891.     LocalTable.Visible = true
  892.     LocalTable.Active = true
  893.     LocalTable.Children = {}
  894.     LocalTable.Listening = false
  895.  
  896.     function PublicTable:BackgroundColor(Color)
  897.         if type(Color) ~= "number" then
  898.             error("bad argument #1: number expected, got " .. type(Color), 2)
  899.         end
  900.         if not VColors[Color] then
  901.             error("Invalid color.", 2)
  902.         end
  903.         LocalTable.BackgroundColor = Color
  904.     end
  905.  
  906.     function PublicTable:New(Class)
  907.         return NewClass(LocalTable, Class, LocalTable)
  908.     end
  909.  
  910.     function PublicTable:ClearChildren()
  911.         LocalTable.Children = {}
  912.     end
  913.  
  914.     function PublicTable:ErrorHandle(Function)
  915.         if type(Function) ~= "function" and Function ~= nil then
  916.             error("bad argument #1: function expected, got " .. type(Function), 2)
  917.         end
  918.  
  919.         LocalTable.ErrorHandle = Function
  920.     end
  921.  
  922.     function PublicTable:Output(Function)
  923.         if type(Function) ~= "function" and Function ~= nil then
  924.             error("bad argument #1: function expected, got " .. type(Function), 2)
  925.         end
  926.  
  927.         LocalTable.Output = Function
  928.     end
  929.  
  930.     function PublicTable:Listen()
  931.         LocalTable.Listening = true
  932.         local ActiveBox
  933.         local LastClick1
  934.         local LastClick2
  935.         local LastClick3
  936.  
  937.         while LocalTable.Listening == true do
  938.             local Event, P1, P2, P3, P4, P5 = os.pullEventRaw()
  939.             if LocalTable.Listening == false then
  940.                 break
  941.             end
  942.  
  943.             if LocalTable.MakeFocus then
  944.                 if ActiveBox then
  945.                     ActiveBox.Focused = false
  946.                     ActiveBox.StopFocus = nil
  947.                     term.setCursorBlink(false)
  948.                     if ActiveBox.Overlap == true then
  949.                         ActiveBox.Pub:Draw()
  950.                     else
  951.                         PublicTable:Draw()
  952.                     end
  953.                 end
  954.                 ActiveBox = LocalTable.MakeFocus
  955.                 LocalTable.MakeFocus = nil
  956.                 ActiveBox.Focused = true
  957.                 if ActiveBox.Overlap == true then
  958.                     ActiveBox.Pub:Draw()
  959.                 else
  960.                     PublicTable:Draw()
  961.                 end
  962.  
  963.                 term.setCursorBlink(true)
  964.                 term.setTextColor(ActiveBox.TextColor)
  965.                 term.setCursorPos(unpack(ActiveBox.TextPos))
  966.             end
  967.  
  968.             if ActiveBox and ActiveBox.StopFocus then
  969.                 ActiveBox.Focused = false
  970.                 ActiveBox.StopFocus = nil
  971.                 term.setCursorBlink(false)
  972.                 if ActiveBox.Overlap == true then
  973.                     ActiveBox.Pub:Draw()
  974.                 else
  975.                     PublicTable:Draw()
  976.                 end
  977.                 if ActiveBox.EnterPress then
  978.                     ActiveBox.EnterPress()
  979.                 end
  980.                 ActiveBox = nil
  981.             end
  982.  
  983.             if LocalTable.Output then
  984.                 if LocalTable.ErrorHandle then
  985.                     local Success, Err = pcall(LocalTable.Output, Event, P1, P2, P3, P4, P5)
  986.                     if not Success then
  987.                         LocalTable.ErrorHandle(Err)
  988.                     end
  989.                 else
  990.                     LocalTable.Output(Event, P1, P2, P3, P4, P5)
  991.                 end
  992.             end
  993.  
  994.             if Event == "char" then
  995.                 if ActiveBox then
  996.                     ActiveBox.Text = ActiveBox.Text .. P1
  997.                     if ActiveBox.Overlap == true then
  998.                         ActiveBox.Pub:Draw()
  999.                     else
  1000.                         PublicTable:Draw()
  1001.                     end
  1002.                     term.setTextColor(ActiveBox.TextColor)
  1003.  
  1004.                     term.setCursorPos(unpack(ActiveBox.TextPos))
  1005.                 end
  1006.             elseif Event == "key" then
  1007.                 if ActiveBox then
  1008.                     if P1 == 14 then
  1009.                         if #ActiveBox.Text > 0 then
  1010.                             ActiveBox.Text = string.sub(ActiveBox.Text, 1, #ActiveBox.Text - 1)
  1011.                             if ActiveBox.Overlap == true then
  1012.                                 ActiveBox.Pub:Draw()
  1013.                             else
  1014.                                 PublicTable:Draw()
  1015.                             end
  1016.                             term.setTextColor(ActiveBox.TextColor)
  1017.  
  1018.                             term.setCursorPos(unpack(ActiveBox.TextPos))
  1019.                         end
  1020.                     elseif P1 == 28 then
  1021.                         ActiveBox.Focused = false
  1022.                         term.setCursorBlink(false)
  1023.  
  1024.                         if ActiveBox.Overlap == true then
  1025.                             ActiveBox.Pub:Draw()
  1026.                         else
  1027.                             PublicTable:Draw()
  1028.                         end
  1029.  
  1030.                         if ActiveBox.EnterPress then
  1031.                             if LocalTable.ErrorHandle then
  1032.                                 local Success, Err = pcall(ActiveBox.EnterPress)
  1033.                                 if not Success then
  1034.                                     LocalTable.ErrorHandle(Err)
  1035.                                 end
  1036.                             else
  1037.                                 ActiveBox.EnterPress()
  1038.                             end
  1039.                         end
  1040.                         ActiveBox = nil
  1041.                     end
  1042.                 end
  1043.             elseif Event == "mouse_scroll" then
  1044.                 local PStop = false
  1045.                 local Check
  1046.                 function Check(Object, Par, PX, PY)
  1047.                     if Object.Active == true then
  1048.                         if PStop == true then return end
  1049.                         if Object.Class == "TextLabel" or Object.Class == "TextButton" or Object.Class == "ImageButton" then
  1050.                             if P2 >= Object.Position[1] + PX - 1 and P2 <= Object.Position[1] + Object.Size[1] + PX - 2 and P3 >= Object.Position[2] + PY - 1 and P3 <= Object.Position[2] + Object.Size[2] + PY - 2 then
  1051.                                 if Object.MouseScroll then
  1052.                                     if LocalTable.ErrorHandle then
  1053.                                         local Success, Err = pcall(Object.MouseScroll, P1)
  1054.                                         if not Success then
  1055.                                             LocalTable.ErrorHandle(Err)
  1056.                                         end
  1057.                                     else
  1058.                                         Object.MouseScroll(P1)
  1059.                                     end
  1060.                                     PStop = true
  1061.                                 end
  1062.                             end
  1063.                         end
  1064.  
  1065.                         for _,Object in pairs(SortListen(Object.Children)) do
  1066.                             Check(Object, Object, PX + Object.Position[1] - 1, PY + Object.Position[2] - 1)
  1067.                         end
  1068.                     end
  1069.                 end
  1070.  
  1071.                 for _,Object in pairs(SortListen(LocalTable.Children))  do
  1072.                     Check(Object, LocalTable, 1, 1)
  1073.                 end
  1074.             elseif Event == "mouse_drag" then
  1075.                 if P1 == 1 and LastClick1 then
  1076.                     if LastClick1.MouseDrag1 then
  1077.                         if LocalTable.ErrorHandle then
  1078.                             local Success, Err = pcall(LastClick1.MouseDrag1, P2, P3)
  1079.                             if not Success then
  1080.                                 LocalTable.ErrorHandle(Err)
  1081.                             end
  1082.                         else
  1083.                             LastClick1.MouseDrag1(P2, P3)
  1084.                         end
  1085.                     end
  1086.                 elseif P1 == 2 and LastClick2 then
  1087.                     if LastClick2.MouseDrag2 then
  1088.                         if LocalTable.ErrorHandle then
  1089.                             local Success, Err = pcall(Object.MouseDrag2, P2, P3)
  1090.                             if not Success then
  1091.                                 LocalTable.ErrorHandle(Err)
  1092.                             end
  1093.                         else
  1094.                             Object.MouseDrag2(P2, P3)
  1095.                         end
  1096.                     end
  1097.                 elseif P1 == 3 and LastClick3 then
  1098.                     if LastClick3.MouseDrag3 then
  1099.                         if LocalTable.ErrorHandle then
  1100.                             local Success, Err = pcall(Object.MouseDrag3, P2, P3)
  1101.                             if not Success then
  1102.                                 LocalTable.ErrorHandle(Err)
  1103.                             end
  1104.                         else
  1105.                             Object.MouseDrag3(P2, P3)
  1106.                         end
  1107.                     end
  1108.                 end
  1109.             elseif Event == "mouse_click" then
  1110.                 LastClick1 = nil
  1111.                 LastClick2 = nil
  1112.                 LastClick3 = nil
  1113.                 local PStop = false
  1114.                 local StopFocus = true
  1115.                 local Check
  1116.                 function Check(Object, Par, PX, PY)
  1117.                     if Object.Active == true then
  1118.                         if PStop == true then return end
  1119.                         if Object.Class == "TextButton" or Object.Class == "ImageButton" or Object.Class == "TextBox" then
  1120.                             if P2 >= Object.Position[1] + PX - 1 and P2 <= Object.Position[1] + Object.Size[1] + PX - 2 and P3 >= Object.Position[2] + PY - 1 and P3 <= Object.Position[2] + Object.Size[2] + PY - 2 then
  1121.                                 if ActiveBox and Object ~= ActiveBox then
  1122.                                     ActiveBox.Focused = false
  1123.                                     ActiveBox.StopFocus = nil
  1124.                                     term.setCursorBlink(false)
  1125.                                     if ActiveBox.Overlap == true then
  1126.                                         ActiveBox.Pub:Draw()
  1127.                                     else
  1128.                                         PublicTable:Draw()
  1129.                                     end
  1130.  
  1131.                                     if ActiveBox.EnterPress then
  1132.                                         if LocalTable.ErrorHandle then
  1133.                                             local Success, Err = pcall(ActiveBox.EnterPress)
  1134.                                             if not Success then
  1135.                                                 LocalTable.ErrorHandle(Err)
  1136.                                             end
  1137.                                         else
  1138.                                             ActiveBox.EnterPress()
  1139.                                         end
  1140.                                     end
  1141.                                     ActiveBox = nil
  1142.                                 end
  1143.                                 if P1 == 1 then
  1144.                                     LastClick1 = Object
  1145.                                     if (Object.Class == "TextButton" or Object.Class == "ImageButton") and Object.Button1Click then
  1146.                                         if LocalTable.ErrorHandle then
  1147.                                             local Success, Err = pcall(Object.Button1Click, P2, P3)
  1148.                                             if not Success then
  1149.                                                 LocalTable.ErrorHandle(Err)
  1150.                                             end
  1151.                                         else
  1152.                                             Object.Button1Click(P2, P3)
  1153.                                         end
  1154.                                     elseif Object.Class == "TextBox" then
  1155.                                         ActiveBox = Object
  1156.                                         Object.Focused = true
  1157.  
  1158.                                         if Object.ClearTextOnFocus == true then
  1159.                                             Object.Text = ""
  1160.                                         end
  1161.  
  1162.                                         Object.RawText = ""
  1163.                                         Object.RTextPos = 6
  1164.  
  1165.                                         if Object.Overlap == true then
  1166.                                             Object.Pub:Draw()
  1167.                                         else
  1168.                                             PublicTable:Draw()
  1169.                                         end
  1170.                                         term.setCursorBlink(true)
  1171.                                         term.setTextColor(ActiveBox.TextColor)
  1172.                                         term.setCursorPos(unpack(Object.TextPos))
  1173.                                     end
  1174.                                 elseif P1 == 2 then
  1175.                                     LastClick2 = Object
  1176.                                     if (Object.Class == "TextButton" or Object.Class == "ImageButton") and Object.Button2Click then
  1177.                                         if LocalTable.ErrorHandle then
  1178.                                             local Success, Err = pcall(Object.Button2Click, P2, P3)
  1179.                                             if not Success then
  1180.                                                 LocalTable.ErrorHandle(Err)
  1181.                                             end
  1182.                                         else
  1183.                                             Object.Button2Click(P2, P3)
  1184.                                         end
  1185.                                     end
  1186.                                 elseif P1 == 3 then
  1187.                                     LastClick3 = Object
  1188.                                     if (Object.Class == "TextButton" or Object.Class == "ImageButton") and Object.Button3Click then
  1189.                                         if LocalTable.ErrorHandle then
  1190.                                             local Success, Err = pcall(Object.Button3Click, P2, P3)
  1191.                                             if not Success then
  1192.                                                 LocalTable.ErrorHandle(Err)
  1193.                                             end
  1194.                                         else
  1195.                                             Object.Button3Click(P2, P3)
  1196.                                         end
  1197.                                     end
  1198.                                 end
  1199.  
  1200.                                 PStop = true
  1201.                             end
  1202.                         end
  1203.  
  1204.                         for _,Object2 in pairs(SortListen(Object.Children)) do
  1205.                             Check(Object2, Object, PX + Object.Position[1] - 1, PY + Object.Position[2] - 1)
  1206.                         end
  1207.                     end
  1208.                 end
  1209.  
  1210.                 for _,Object in pairs(SortListen(LocalTable.Children))  do
  1211.                     Check(Object, LocalTable, 1, 1)
  1212.                 end
  1213.             end
  1214.         end
  1215.     end
  1216.  
  1217.     function PublicTable:StopListen()
  1218.         LocalTable.Listening = false
  1219.     end
  1220.  
  1221.     function PublicTable:Draw()
  1222.         term.setBackgroundColor(LocalTable.BackgroundColor)
  1223.         term.clear()
  1224.  
  1225.         for _,Item in ipairs(LocalTable.Children) do
  1226.             Check(Item, LocalTable.BackgroundColor, 1, 1)
  1227.         end
  1228.     end
  1229.     return PublicTable
  1230. end
  1231.  
  1232. -- End of alakazard12's Nova GUI API
  1233.  
  1234. local IsConnected = bapi.connect()
  1235.  
  1236. local W, H = term.getSize()
  1237.  
  1238. local MainUI = NewUI()
  1239. MainUI:BackgroundColor(colors.white)
  1240.  
  1241. local Title = MainUI:New("TextLabel")
  1242. Title:Size(W, 1)
  1243. Title:Text("Withdraw from YeuaBank")
  1244. Title:BackgroundColor(colors.gray)
  1245. Title:TextColor(colors.white)
  1246.  
  1247. local Stat = MainUI:New("TextLabel")
  1248. Stat:Size(W, 1)
  1249. Stat:Text("")
  1250. Stat:ShowBackground(false)
  1251. Stat:Position(1, H)
  1252.  
  1253. local BSizeX = math.floor((W - 2) / 5 - 2)
  1254. local BSizeY = math.floor((H - 1) / 4 - 1)
  1255.  
  1256. local TakeUpX = 5 * (BSizeX + 1) + 1
  1257. local TakeUpY = 4 * (BSizeY + 1) + 2
  1258.  
  1259. for i = 0, 19 do
  1260.     local But = MainUI:New("TextButton")
  1261.     But:Size(BSizeX, BSizeY)
  1262.     But:BackgroundColor(colors.gray)
  1263.     But:Text(tostring((i + 1) * 5))
  1264.     But:TextColor(colors.green)
  1265.     But:Position(((i % 5) * (BSizeX + 1)) + (W - TakeUpX) / 2 + 2, (math.floor(i / 5) * (BSizeY + 1) + 2)  + (H - TakeUpY) / 2 + 1)
  1266.     But:Button1Click(function()
  1267.         local num = i + 1
  1268.         local am = num * 5
  1269.  
  1270.         Stat:TextColor(colors.green)
  1271.         Stat:Text("Please swipe your card")
  1272.         Stat:Draw()
  1273.  
  1274.         local _,Data = os.pullEvent("mag_swipe")
  1275.         if #Data == 16 and pim.getInventoryName() ~= "pim" then
  1276.             local chestAmount = 0
  1277.             local Stacks = {}
  1278.             for _,Item in pairs(chest.getAllStacks()) do
  1279.                 chestAmount = chestAmount + Item.qty
  1280.                 table.insert(Stacks, {_, Item})
  1281.             end
  1282.  
  1283.             table.sort(Stacks, function(f, l)
  1284.                 return f[2].qty > l[2].qty
  1285.             end)
  1286.  
  1287.             local slotsUsedT = 0
  1288.             local slotsUsed
  1289.             local tempAmount = 0
  1290.             for _,Stack in pairs(Stacks) do
  1291.                 tempAmount = tempAmount + Stack[2].qty
  1292.                 slotsUsedT = slotsUsedT + 1
  1293.                 if tempAmount >= num and slotsUsed == nil then
  1294.                     slotsUsed = slotsUsedT
  1295.                 end
  1296.             end
  1297.  
  1298.             if chestAmount < num then
  1299.                 Stat:TextColor(colors.red)
  1300.                 Stat:Text("I don't have enough money to give you")
  1301.                 Stat:Draw()
  1302.                 sleep(3)
  1303.             else
  1304.                 local playerSlotsFree = {}
  1305.                 for On = 1, pim.getInventorySize() do
  1306.                     if not pim.getStackInSlot(On) then
  1307.                         table.insert(playerSlotsFree, On)
  1308.                     end
  1309.                 end
  1310.  
  1311.                 if #playerSlotsFree < slotsUsed then
  1312.                     Stat:TextColor(colors.red)
  1313.                     Stat:Text("You don't have enough slots empty (" .. #playerSlotsFree .. "/" .. slotsUsed .. ")")
  1314.                     Stat:Draw()
  1315.                     sleep(3)
  1316.                 else
  1317.                     local Suc, Err = bapi.transact(Data, "void", am)
  1318.                     if not Suc then
  1319.                         Stat:TextColor(colors.red)
  1320.                         Stat:Text("Error: " .. Err)
  1321.                         Stat:Draw()
  1322.                         sleep(2)
  1323.                     else
  1324.                         for On = 1, num do
  1325.                             -- pim.pullItem("down", playerSlotsFree[On], 0, Stacks[_][1])
  1326.                             chest.pushItem("up", Stacks[On][1], 64, playerSlotsFree[On])
  1327.                         end
  1328.                         Stat:TextColor(colors.green)
  1329.                         Stat:Text("Success")
  1330.                         Stat:Draw()
  1331.                         sleep(2)
  1332.                     end
  1333.                 end
  1334.             end
  1335.         end
  1336.  
  1337.         Stat:Text("")
  1338.         Stat:Draw()
  1339.     end)
  1340. end
  1341.  
  1342. MainUI:Draw()
  1343. MainUI:Listen()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement