Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-15-2008, 05:00 AM
Ronnie Ronnie is offline
Registered User
Join Date: Jun 2008
Location: Nj, USA
Posts: 48
Ronnie is on a distinguished road
Send a message via AIM to Ronnie
For( problem.

Inside the for( there is something wrong, and I know I'm redefining inside the for( but that's not the problem, the array d.lists is a list of player accounts and then once it converts to dband, I need it to load all those accounts files "guild/player saccount_groster.txt" then remove the d.guild which is a guildname and then reupload it using savelines.All the params are correct I echoed them all. Someone Help!

PHP Code:
    case "disband":
      
d.guild params[1];
      
d.plr params[2];
      
dingguild.loadlines("guild/local_guilds_list.txt");
      
dingguild.remove(d.guild);
      
deletefile("guild/"@d.guild@"_glist.txt");
      
d.lists loadlines("guild/"@d.guild@"_groster.txt");

//Where it fails ;/--------------------------------------
           
for (dbandd.lists){
       
dgrstr.loadlines("guild/"@dband@"_glist.txt");
       
dgrstr.remove(d.guild);
       
dgrstr.savelines("guild/"@dband@"_glist.txt"0);
       
dppl findPlayer(dband);
       
dppl.chat "The guild, "@d.guild@" has been disbanded!";
       
with(dppl)clientr.(@d.guild).rank=0;
       }

      
removeguild(@d.guild);
      
deletefile("guild/"@d.guild@"_groster.txt");
      
l.list.loadlines("guild/Leaders_list.txt");
      
l.list.remove(@d.guild@"="@d.plr@"");[CODE][/CODE]
      
l.list.savelines("guild/Leaders_list.txt"0);
      break; 
Thanks in advance
-Ronnie
Reply With Quote
  #2  
Old 11-15-2008, 05:04 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
try for ( temp.dband : d.lists ), and also try echoing (if you haven't for some reason) d.lists to see that it actually is an array.

EDIT: You really should declare your variables as temporary with a temp. prefix anyway, so they aren't global variables.
__________________
Reply With Quote
  #3  
Old 11-15-2008, 05:04 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
What does d.lists echo?
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #4  
Old 11-15-2008, 05:13 AM
Ronnie Ronnie is offline
Registered User
Join Date: Jun 2008
Location: Nj, USA
Posts: 48
Ronnie is on a distinguished road
Send a message via AIM to Ronnie
Actually guys figured it out for some odd reason

PHP Code:
d.lists loadlines("guild/"@d.guild@"_groster.txt"); 
Did not work so then I decided to use

PHP Code:
d.lists.loadlines("guild/"@d.guild@"_groster.txt"); 
And it did, thanks for everyones help though

-Ronnie



Will do @ Cbk, that should reduce lag also , or atleast a tiny bit?
Reply With Quote
  #5  
Old 11-15-2008, 03:10 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Its probably not increasing the speed a lot but using proper variable names instead of "d" or "dppl" is always good
Reply With Quote
  #6  
Old 11-15-2008, 07:55 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
I'm pretty sure using temp. variables lowers the memory usage.
__________________
Reply With Quote
  #7  
Old 11-15-2008, 11:00 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Quote:
Originally Posted by Crow View Post
I'm pretty sure using temp. variables lowers the memory usage.
It also cures cancer.
Reply With Quote
  #8  
Old 11-15-2008, 11:28 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Loriel View Post
It also cures cancer.
I bet it does.
__________________
Reply With Quote
  #9  
Old 11-15-2008, 11:51 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Crow View Post
I'm pretty sure using temp. variables lowers the memory usage.
Would seem like it should, since the variables will be deleted when the function (or loop, etc) is over, rather than storing them.

Though I'm not sure if it's stored on the hard drive (virtual memory) or actual memory on the systems running the servers.
__________________
Reply With Quote
  #10  
Old 11-16-2008, 12:22 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by cbk1994 View Post
Would seem like it should, since the variables will be deleted when the function (or loop, etc) is over, rather than storing them.

Though I'm not sure if it's stored on the hard drive (virtual memory) or actual memory on the systems running the servers.
There is no way active variables are stored in anything but the RAM.

Now then, Stefan was talking about variable names, not whether they're temporary variables or not, because obviously properly descriptive variable names improve comprehension.
__________________
Reply With Quote
  #11  
Old 11-16-2008, 12:41 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Inverness View Post
Now then, Stefan was talking about variable names, not whether they're temporary variables or not, because obviously properly descriptive variable names improve comprehension.
We realize this. We were responding to "Will do @ Cbk, that should reduce lag also , or atleast a tiny bit?"
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:53 AM.


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