Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Directory to store files
- local reciDir = "/thaumhelper/recipes"
- local descDir = "/thaumhelper/descriptions"
- print("Enter the aspect name")
- local name = ""
- while #name < 1 do
- name = read()
- end
- print("Enter the first component (blank if none)")
- local recipe1 = read()
- local recipe2 = ""
- if #recipe1 > 0 then
- print("Enter the second component")
- recipe2 = ""
- while #recipe2 < 1 do
- recipe2 = read()
- end
- end
- print("Select the aspect icon colour")
- -- Giant colour list for some reason
- local colList = {}
- colList["white"] = colors.white
- colList["orange"] = colors.orange
- colList["magenta"] = colors.magenta
- colList["lightBlue"] = colors.lightBlue
- colList["yellow"] = colors.yellow
- colList["lime"] = colors.lime
- colList["pink"] = colors.pink
- colList["gray"] = colors.gray
- colList["lightGray"] = colors.lightGray
- colList["cyan"] = colors.cyan
- colList["purple"] = colors.purple
- colList["blue"] = colors.blue
- colList["brown"] = colors.brown
- colList["green"] = colors.green
- colList["red"] = colors.red
- colList["black"] = colors.black
- local i = 0
- local colLabel = {}
- print("")
- term.setTextColor(colors.black)
- for k, v in pairs(colList) do
- i = i + 1
- colLabel[i..""] = k
- term.setBackgroundColor(v)
- term.write(" "..i)
- end
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- print("")
- local col = ""
- local invalid = true
- while invalid do
- col = read()
- for k, v in pairs(colLabel) do
- if col == k then
- invalid = false
- break
- end
- end
- end
- print("Write the aspect description")
- local desc = read()
- print("Save this aspect? y/n")
- local yesno = ""
- while true do
- yesno = read()
- if yesno == "n" then
- break
- elseif yesno == "y" then
- local tFile = fs.open(reciDir.."/"..name,"w")
- if #recipe1 > 0 then
- tFile.writeLine(recipe1)
- tFile.writeLine(recipe2)
- end
- tFile.close()
- tFile = fs.open(descDir.."/"..name,"w")
- tFile.writeLine(colLabel[col])
- tFile.writeLine(desc)
- tFile.close()
- break
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment