Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function _init()
- cls()
- local input="line(16,16,64,32,7)"
- local p1=index_of(input,"(")
- local p2=index_of(input,")")
- local cmd=sub(input,1,p1-1)
- local args=sub(input,p1+1,p2-1)
- if cmd=="line" then
- line(unpack(split(args)))
- end
- end
- -- returns first occurence of
- -- character c, or nil
- function index_of(str,c)
- str=""..str
- for i=1,#str do
- if sub(str,i,i)==c then
- return i
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement