This could probably be optimized to use onAllRCChat now.
PHP Code:
function onAllRCChat(msg) {
temp.msgs = {
{"The script of NPC ", " has been updated by", "npcs"},
{"The npc ", " has been deleted by account", "npcs"},
{"Weapon/GUI-script ", " added/updated by account", "weapons"},
{"Weapon ", " deleted by account", "weapons"},
{"Script ", " updated by account", "scripts"},
{"Script ", " deleted by account", "scripts"}
};
temp.stype = false;
for (temp.m: temp.msgs) {
temp.mp = msg.pos(temp.m[1]);
if (msg.starts(temp.m[0]) && temp.mp > 0) {
temp.ml = temp.m[0].length();
temp.sname = msg.substring(temp.ml, temp.mp - temp.ml);
temp.stype = temp.m[2];
break;
}
}
if (temp.stype) {
temp.stype; // script folder
temp.sname; // script name
// Queue the files for update, then perhaps push them a minute from now or something.
}
}