View Single Post
  #15  
Old 06-26-2013, 02:10 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
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.
  
}
} 
__________________
Quote:

Last edited by fowlplay4; 06-26-2013 at 02:29 PM..
Reply With Quote