|
|
2行目: |
2行目: |
| function p.hundred(frame) | | function p.hundred(frame) |
| a,b,m,n,o = {},{},{},{},{} | | a,b,m,n,o = {},{},{},{},{} |
| if frame.args[3] then | | s = tonumber(frame.args[3]) or 100 |
| s = tonumber(frame.args[3]) or 100
| | if string.find(frame.args[1],frame.args[2]) then |
| if string.find(frame.args[1],frame.args[2]) then
| | a[1],b[1] = string.find(frame.args[1],frame.args[2]) |
| a[1],b[1] = string.find(frame.args[1],frame.args[2])
| | m[1] = string.char(string.byte(frame.args[1],a[1],b[1])) |
| m[1] = string.char(string.byte(frame.args[1],a[1],b[1]))
| | n[1] = a[1] == 1 and "" or string.char(string.byte(frame.args[1],1,a[1]-1)) |
| n[1] = a[1] == 1 and "" or string.char(string.byte(frame.args[1],1,a[1]-1))
| | g = n[1]..string.rep(m[1],100) |
| g = n[1]..string.rep(m[1],100)
| | if s >= 2 then |
| if s >= 2 then
| | for i = 2,s do |
| for i = 2,s do
| | a[i],b[i] = string.find(frame.args[1],frame.args[2],b[i-1]+1) |
| a[i],b[i] = string.find(frame.args[1],frame.args[2],b[i-1]+1)
| | m[i] = string.char(string.byte(frame.args[1],a[i],b[i])) |
| m[i] = string.char(string.byte(frame.args[1],a[i],b[i]))
| | n[i] = a[i] == b[i-1]+1 and "" or string.char(string.byte(frame.args[1],b[i-1]+1,a[i]-1)) |
| n[i] = a[i] == b[i-1]+1 and "" or string.char(string.byte(frame.args[1],b[i-1]+1,a[i]-1))
| | end |
| end
| | for i = 2,s do |
| for i = 2,s do
| | g = g..n[i]..string.rep(m[i],100) |
| g = g..n[i]..string.rep(m[i],100)
| | end |
| end
| |
| end
| |
| o[1] = b[#b] == #frame.args[1] and "" or string.char(string.byte(frame.args[1],b[#b]+1,#frame.args[1]))
| |
| return g..o[1]
| |
| else
| |
| m[1] = frame.args[1]
| |
| return string.rep(m[1],100)
| |
| end | | end |
| | o[1] = b[#b] == #frame.args[1] and "" or string.char(string.byte(frame.args[1],b[#b]+1,#frame.args[1])) |
| | return g..o[1] |
| else | | else |
| if frame.args[2] then
| | m[1] = string.rep(frame.args[1],100) |
| if string.find(frame.args[1],frame.args[2]) then
| | return m[1] or "引数を1つ以上入力してください。" |
| a[1],b[1] = string.find(frame.args[1],frame.args[2])
| | end |
| m[1] = string.char(string.byte(frame.args[1],a[1],b[1]))
| |
| n[1] = a[1] == 1 and "" or string.char(string.byte(frame.args[1],1,a[1]-1))
| |
| o[1] = b[1] == #frame.args[1] and "" or string.char(string.byte(frame.args[1],b[1]+1,#frame.args[1]))
| |
| return n[1]..string.rep(m[1],100)..o[1]
| |
| else
| |
| m[1] = frame.args[1]
| |
| return string.rep(m[1],100)
| |
| end
| |
| else
| |
| m[1] = frame.args[1]
| |
| return string.rep(m[1],100)
| |
| end
| |
| end
| |
| end | | end |
| return p | | return p |