Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function StringToCmd(self, CallFunction, t1, t2)
- for c in string.gmatch(CallFunction(t1,t2), "(.-);") do
- b = {};
- b[1] = string.match(c, "(.-),");
- b[2] = string.match(c, ",(.-),");
- if not b[2] then
- b[2] = string.match(c, ",(.+)");
- end;
- b[3] = string.match(c, ",.-,(.-),");
- if not b[3] then
- b[3] = string.match(c, ",.-,(.+)");
- end;
- b[4] = string.match(c, ",.-,.-,(.-),");
- if not b[4] then
- b[4] = string.match(c, ",.-,.-,(.+)");
- end;
- b[5] = string.match(c, ",.-,.-,.-,(.+)")
- v2 = 0;
- for i=1,#b do
- v = string.match(b[i], "(%w+)");
- if not v2 then v2 = 0; end;
- for c2 in string.gmatch(b[i], "%+(%w+)") do
- if c2 then
- v2 = v2 + c2;
- b[i] = v + v2;
- end;
- end;
- for c2 in string.gmatch(b[i], "%-(%w+)") do
- if c2 then
- v2 = v2 - c2;
- b[i] = v - v2;
- end;
- end;
- end;
- if b[5] then
- self[b[1]](self,b[2],b[3],b[4],b[5]);
- elseif b[4] then
- self[b[1]](self,b[2],b[3],b[4]);
- elseif b[3] then
- self[b[1]](self,b[2],b[3]);
- elseif b[2] then
- self[b[1]](self,b[2]);
- else
- self[b[1]](self);
- end;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement