Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --dofile("LuaScripts/CreateElement.lua")
- top_stack = 1
- enabled_scripts = {"bmbgs.lua"}
- function scroll_up()
- top_stack = (top_stack + 1)
- refresh(0)
- end
- function scroll_down()
- if top_stack ~= 1 then
- top_stack = (top_stack - 1)
- refresh(0)
- end
- end
- function window()
- win = Window:new(236, 60, 150, 225)
- --close button
- cBtn = Button:new(135, 0, 15, 15, "X")
- cBtn:action(function()interface.closeWindow(win)end)
- win:addComponent(cBtn)
- --reload button
- rBtn = Button:new(80, 0, 50, 15, "RELOAD")
- rBtn:action(refresh(1))
- win:addComponent(rBtn)
- --scroll up button
- uBtn = Button:new(0, 0, 15, 15, "^")
- uBtn:action(scroll_up)
- win:addComponent(uBtn)
- --scroll down button
- dBtn = Button:new(0, 120, 15, 15, "v")
- dBtn:action(scroll_down)
- win:addComponent(dBtn)
- --stack1
- cb1 = Checkbox:new(0,15, 15, 15) --------------------------------Here the checkbox is defined
- win:addComponent(cb1)
- --stack2
- cb2 = Checkbox:new(0,30, 15, 15)
- win:addComponent(cb2)
- --stack3
- cb3 = Checkbox:new(0,45, 15, 15)
- win:addComponent(cb3)
- --stack4
- cb4 = Checkbox:new(0,60, 15, 15)
- win:addComponent(cb4)
- --stack5
- cb5 = Checkbox:new(0,75, 15, 15)
- win:addComponent(cb5)
- --stack6
- cb6 = Checkbox:new(0,90, 15, 15)
- win:addComponent(cb6)
- --stack7
- cb7 = Checkbox:new(0,105, 15, 15)
- win:addComponent(cb7)
- interface.showWindow(win)
- refresh(0)
- end
- function refresh(choice)
- if choice == 1 then
- top_stack = 1
- choice = 0
- end
- cb1:text(" ") -----------------------------------------But here im getting an error.
- cb2:text(" ")
- cb3:text(" ")
- cb4:text(" ")
- cb5:text(" ")
- cb6:text(" ")
- cb7:text(" ")
- local files = fs.list("LuaScripts")
- for k,v in pairs(files) do
- if k <= (top_stack + 6) and k >= top_stack then
- if k == top_stack then --1
- cb1:text(v)
- for k2, v2 in pairs(enabled_scripts) do
- if k == k2 then
- cb1:checked(true)
- else
- cb1:checked(false)
- end
- end
- elseif k == (top_stack + 1) then --2
- cb2:text(v)
- for k2, v2 in pairs(enabled_scripts) do
- if k == k2 then
- cb2:checked(true)
- else
- cb2:checked(false)
- end
- end
- elseif k == (top_stack + 2) then --3
- cb3:text(v)
- for k2, v2 in pairs(enabled_scripts) do
- if k == k2 then
- cb3:checked(true)
- else
- cb3:checked(false)
- end
- end
- elseif k == (top_stack + 3) then --4
- cb4:text(v)
- for k2, v2 in pairs(enabled_scripts) do
- if k == k2 then
- cb4:checked(true)
- else
- cb4:checked(false)
- end
- end
- elseif k == (top_stack + 4) then --5
- cb5:text(v)
- for k2, v2 in pairs(enabled_scripts) do
- if k == k2 then
- cb5:checked(true)
- else
- cb5:checked(false)
- end
- end
- elseif k == (top_stack + 5) then --6
- cb6:text(v)
- for k2, v2 in pairs(enabled_scripts) do
- if k == k2 then
- cb6:checked(true)
- else
- cb6:checked(false)
- end
- end
- elseif k == (top_stack + 6) then --7
- cb7:text(v)
- for k2, v2 in pairs(enabled_scripts) do
- if k == k2 then
- cb7:checked(true)
- else
- cb7:checked(false)
- end
- end
- else
- print("wtf")
- end
- end
- end
- end
- window()
Advertisement
Add Comment
Please, Sign In to add comment