Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Renaming mass amount of levels? (https://forums.graalonline.com/forums/showthread.php?t=134260186)

xMane 08-13-2010 05:22 PM

Renaming mass amount of levels?
 
ok i wanted to rename my current gmap to gevo. how would i do this? i am using
LINK
for it.
or
PHP Code:

function onCreated()
{
  
this.searchid = 0;
  
scheduleevent(0.25, "renameFiles", NULL, NULL);
}
function 
onrenameFiles() 
{ 
  
temp.folderName = "levels/overworld/*.nw";
  
temp.copyFolder = "levels/overworld/";
  
temp.newName = "gevo";
  
temp.oldName = "express";  
  
temp.levelList.loadfolder(temp.folderName, 0);
   
  if ((
this.searchid * 50) >= temp.levelList.size()) 
  {   
    echo(
"All finished...");
    return 
true;
  }
  
  for (
temp.s = (this.searchid * 50); temp.s < ((this.searchid + 1) * 50); temp.s++) 
  {    
      
    
temp.curLinec = 0;
    
temp.curLevel = temp.levelList[temp.s];
    if (!
temp.curLevel.starts(temp.oldName))
    {
      continue;
    }
    
temp.levelDetails.loadlines(temp.folderName.substring(0, (temp.folderName.length() - 4)) @ temp.curLevel);     
    for (
temp.curLine: temp.levelDetails)
    {
      if (
temp.curLine.starts("LINK " @ temp.oldName))
      {
        
temp.newLine = "LINK" SPC temp.newName @ temp.curLine.substring(5 + temp.oldName.length());
        
temp.levelDetails[temp.curLinec] = temp.newLine;
      }
      
temp.curLinec++;
    }
    
temp.levelName = temp.newName @ temp.curLevel.substring(temp.oldName.length());
    
temp.levelDetails.savelines(temp.copyFolder @ temp.levelName, 0); 
    echo(
"NC: Copied" SPC temp.curLevel SPC "to" SPC temp.levelName);
  }
  
  
this.searchid++; 
  
scheduleevent(0.25, "renameFiles", NULL, NULL); 
} 

nothing seems to work?

fowlplay4 08-13-2010 10:21 PM

(npcserver) needs the folder rights to change the levels.

PHP Code:

rw levels/overworld/* 


Snakeandy7 08-14-2010 09:59 AM

I wish I still had the P/W for Chandler, to add that to the post.

Yeah, fowlplay4 is right ^^


All times are GMT +2. The time now is 04:41 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.