Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Thememaker V1 - Make your own theme/settings!")
- local function yn()
- while true do
- local _,l=os.pullEvent"char"
- if l=="y" then
- return true
- elseif l=="n" then
- return false
- end
- end
- end
- local new = {}
- local blacklist = {
- appLocations = true ,
- fileTypeDefIcons = true ,
- extensions = true
- }
- local function goThrough(thing,s)
- for i,o in pairs(thing) do
- if blacklist[i] then else
- if type(o) == "number" then
- print(i.." was "..tostring(o)..". Is that a color?")
- if yn() then
- print()
- local colorsByNum = {}
- local num = 1
- for k,l in pairs(colors) do
- if type(l)=="number" then
- term.setBackgroundColor(l)
- term.write" "
- colorsByNum[num]=l
- num=num+1
- end
- end
- local evts = {os.pullEvent("mouse_click")}
- new[i] = colorsByNum[evts[3]]
- term.setBackgroundColor(colors.black)
- print()
- else
- print"Enter value, will convert to number:"
- new[i] = tonumber(read())
- end
- if s then
- new[s] = new[s] or {}
- new[s][i]=new[i]
- new[i]=nil
- end
- elseif type(o)=="boolean" then
- print(i.." was boolean. Y for true, N for false")
- new[i]=yn()
- if s then
- new[s] = new[s] or {}
- new[s][i]=new[i]
- new[i]=nil
- end
- elseif type(o)=="string" then
- print(i.." was string. Enter the new string")
- new[i]=read()
- if s then
- new[s] = new[s] or {}
- new[s][i]=new[i]
- new[i]=nil
- end
- elseif type(o)=="table" then
- print(i.." was table. goThrough table")
- goThrough(o,i)
- end
- end
- end
- print("Returning...")
- end
- goThrough(osStuff.settings)
- textutils.pagedPrint(textutils.serialize(new))
- local f=fs.open("newSettings","w")
- f.write(textutils.serialize(new))
- f.close()
- print("Outputted to /newSettings. Enjoy your... interesting... settings.")
Advertisement
Add Comment
Please, Sign In to add comment