if #({...})>0 then
term.setBackgroundColor(colors.black)
term.setTextColor(colors.yellow)
term.clear()
term.setCursorPos(1,1)
print(os.version())
end
local function choice(t)
return t[math.random(1,#t)]
end
local heart = "\x03"
local hist = {}
local f = fs.open("mommy_config.json","r")
local text = f.readAll()
local config = textutils.unserialiseJSON(text)
f.close()
config.emoji = string.char(config.emoji)
local function fill(s)
strconfig = {
["emoji"]=config.emoji,
["affectionate_term"]=choice(config.affectionate_terms),
["role"]=choice(config.roles),
["pronoun"]=choice(config.pronouns)
}
for i,v in pairs(strconfig) do
s = string.gsub(s, "{"..i.."}", v)
end
return s
end
while true do
term.setBackgroundColor(colors.black)
term.setTextColor(colors.yellow)
write(heart.." "..shell.dir().."> ")
term.setTextColor(colors.white)
hist[#hist+1]=read(nil,hist,shell.complete)
local r = shell.run(hist[#hist])
term.setBackgroundColor(colors.black)
term.setTextColor(config.color)
if r then
if not config.only_negative then
print(fill(choice(config.positive_responses)))
end
else
print(fill(choice(config.negative_responses)))
end
end