I wrote my own substr function to trim off all the possible commands (the title of the script means nothing - it started as a substr...)
I also wrapped my own string_count (_string_count) for ease of code translation because I origionally wrote this in java. It also makes it safe to feed it more than two arguments. It swaps the two arguments, so _string_count(arg0,arg1) becomes string_count(arg1,arg0).
alarm[0] = 30;
command = <command code here>
if (_string_count(command,"<")) {
//error occured
exit;
}
if (_string_count(command,">link ")) {
arg = string_substr(arg);
//do function
}
if (_string_count(command,">dial ")) {
arg = string_substr(arg);
//do function
}
if (_string_count(command,">call ")) {
arg = string_substr(arg);
//do function
}
if (_string_count(command,">notify ")) {
arg = string_substr(arg);
//do function
}
if (_string_count(command,">text ")) {
arg = string_substr(arg);
// dosomething
}
And my current implementation of string_substr (again, not actually a substr function, but I just called it that)
str = argument0; str = string_replace(str,">link",""); //delete the commands str = string_replace(str,">call",""); str = string_replace(str,">dial",""); str = string_replace(str,">text",""); str = string_replace(str,">del",""); str = string_replace(str,">dl",""); str = string_replace(str,">rnm",""); str = string_delete(str,1,1); //remove the space between the command and the args return str;



Find content
Male
