View Single Post
  #12  
Old 12-16-2008, 10:34 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Sorry, Angelu kept me busy on client

I didn't quite fix yours, but I did make a version that works. Feel free to use it, or whatever.

PHP Code:
function onLevelFileUpdated(file)
{
  
temp.lines.loadlines("levels/" temp.file);
  
temp.newLines.loadlines("levels/" temp.file);
  
  
temp.illegal = {"item""client""rupee""player"};
  
  
temp.var = -1;
  for (
temp.linetemp.lines) {
    
temp.var ++;
    
    if (
temp.line.starts("BOARD")) continue;
    if (
temp.line.starts("GLEV")) continue;
    if (
temp.line.starts("LINK")) continue;
    if (
temp.line == "" && !temp.isNPC) continue;
       
    if (
temp.line.starts("NPC") && temp.line != "NPCEND") {
      
temp.isNPC true;
      
temp.startPos = var;
    }
    
    else if (
temp.line == "NPCEND") {
      
temp.endPos temp.var;
      
      if (
temp.bad && temp.isNPC) {
        for (
temp.temp.startPostemp.<= temp.endPostemp.++) {
          
temp.newLines.delete(temp.temp.deleteCount);
          
temp.deleteCount ++;
        }
        
        
temp.bad false;
        
temp.isNPC false;
      }
    }
    
    else if (
temp.isNPC && !temp.bad) {
      for (
temp.scantemp.illegal) {
        if (
temp.line.lower().pos(temp.scan) > -1temp.bad true;
      }
    }
  }
  
  
temp.newLines.saveLines("levels/" temp.file0);

__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote