|
|
1行目: |
1行目: |
| local p = {}
| | |
| function p.hundred(frame)
| |
| a,b,m,n,o = {},{},{},{},{}
| |
| if frame.args[3] then
| |
| s = tonumber(frame.args[3])
| |
| if string.find(frame.args[1],frame.args[2]) then
| |
| 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]))
| |
| 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)
| |
| if s >= 2 then
| |
| for i = 2,s do
| |
| 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]))
| |
| 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
| |
| for i = 2,s do
| |
| g = g..n[i]..string.rep(m[i],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] --n[1]..string.rep(m[1],100)..n[2]..string.rep(m[2],100).. 「どうにかする」..n[s]..string.rep(m[s])..o[1]を返す処理
| |
| else
| |
| m[1] = frame.args[1]
| |
| return string.rep(m[1],100)
| |
| end
| |
| else
| |
| if 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])
| |
| 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] or "引数?"
| |
| return string.rep(m[1],100)
| |
| end
| |
| end
| |
| end
| |
| return p
| |