Based to this function
function say2(str,dx)
local maxl,actl,pat = dx or 50,0,'(.-)(%[.-%])()'
local result,nb,lastPos,outp = {},0,0,''
if string.find(str, pat) ~= nil then
for part, dos,pos in string.gfind(str, pat) do
nb = nb + 2
if part ~= '' then result[nb-1] = part else nb = nb -1 end
result[nb] = dos
lastPos = pos
end
end
result[nb+1] = string.sub(str,lastPos)
table.foreach(result,function(i,l)
if string.find(l,pat) then
outp = outp..l
else
for le in string.gfind(l,'((%S+)%s*)') do
if actl + string.len(le) > maxl then
outp = outp..'[ENTER]'
actl = 0
end
outp = outp..le
actl = actl + string.len(le)
end
end
end)
say(outp) end
Right now, the function just does a automatic word wrap after 50 letters. I am looking for some change, which would be like this:
The first 4 lines, there will be the word wrap after 20 letters. After that each line will wrap after 50 letters. Once 10 lines total are reached, there should be a auto "wait()" placed.
I would offer $50,00 for this.