Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-24-2007, 10:43 PM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
Resseting through scripts?

well, on lots of servers the NPC server resets you, and i was wondering, how would i do that? alot of people who log onto Final Resort are starting with Utopia items, Utopia flags, and utopia levels. its very hard to reset all of em by myself, so how would i do this?
__________________
I am the devil, I am here to do to devils work.
Reply With Quote
  #2  
Old 11-24-2007, 10:59 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Hmm, can't you just access the account data through the browser nowadays and delete them all yourself?
Reply With Quote
  #3  
Old 11-24-2007, 11:52 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
sendtorc("/reset account");

Make a database with an array of all the accounts that have been reset. When someone logs on it will check if that players account is in the array, if not it will reset them and add them to the list. Then when you want another reset, you just reset the database.

Of course I prefer to save to a file so that when the NPC Server has to be reconnected or anything like that the list isn't lost. (Therefore resetting everyone)
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #4  
Old 11-25-2007, 12:06 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
Saving resets to a file is best way.
__________________
Reply With Quote
  #5  
Old 11-25-2007, 12:25 AM
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
Mh, I'm creating a serverflag for every account that has been reset. If they log on its destroyed and they get a clientr.flag. If they have that, they wont get reset
Reply With Quote
  #6  
Old 11-25-2007, 12:33 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
PHP Code:
if ( this.reset.index( @ player.account ) == -)
{
  
this.reset.addplayer.account );
  
sendToRC"/reset" SPC player.account );

It's pretty simple code. Just add it in the onActionPlayerOnline event in the Control NPC.
__________________
Reply With Quote
  #7  
Old 11-25-2007, 02:12 AM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
Quote:
Originally Posted by cbkbud View Post
PHP Code:
if ( this.reset.index( @ player.account ) == -)
{
  
this.reset.addplayer.account );
  
sendToRC"/reset" SPC player.account );

It's pretty simple code. Just add it in the onActionPlayerOnline event in the Control NPC.
why tyvm. i tryed that with on reset and it reset everytime i logged on
__________________
I am the devil, I am here to do to devils work.
Reply With Quote
  #8  
Old 11-25-2007, 02:18 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 Knightmare1 View Post
why tyvm. i tryed that with on reset and it reset everytime i logged on
Where did you put it?
__________________
Reply With Quote
  #9  
Old 11-25-2007, 02:21 AM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
Quote:
Originally Posted by cbkbud View Post
Where did you put it?
Control NPC.
__________________
I am the devil, I am here to do to devils work.
Reply With Quote
  #10  
Old 11-25-2007, 02:33 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
Are you on? I can get on FR and look at it.
__________________
Reply With Quote
  #11  
Old 11-25-2007, 03:04 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
Ugh, do not store reset data in the Control-NPC.
It should be stored in text file >:O
__________________
Reply With Quote
  #12  
Old 11-25-2007, 03:15 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Inverness View Post
Ugh, do not store reset data in the Control-NPC.
It should be stored in text file >:O
Definitely.

If the Control-NPC flags are reset for some reason... you have an involuntary server reset. Plus, that string will have the potential to get really big. If someone just edits the Control-NPC flags via RC, the string could get cut short, and (as a result) some people will be reset again.

A text file is less likely to be cleared or tampered with.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #13  
Old 11-25-2007, 03:22 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
I know, I wanted to give something simple for the forums. If I can catch him on, I'm going to use a text file.

I figured it'd be too hard to explain it through the forums.
__________________
Reply With Quote
  #14  
Old 11-25-2007, 04:22 AM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
Quote:
Originally Posted by cbkbud View Post
I know, I wanted to give something simple for the forums. If I can catch him on, I'm going to use a text file.

I figured it'd be too hard to explain it through the forums.
im online. and tyvm chris. why arent you on your cbk1994 account?
__________________
I am the devil, I am here to do to devils work.
Reply With Quote
  #15  
Old 11-25-2007, 05:05 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
PHP Code:
//In Control-NPC
function onInitialized() {
  
// Loading reset accounts list into a global variable when the NPC-Server starts.
  
resetaccounts 0;
  
resetaccounts.loadlines("levels/resetaccounts.txt");
}
function 
onActionPlayerOnline() {
  
// Check if the player's account is in the list.
  
if (resetaccounts.index(player.account) < 0) {
    
// Reset him if its not.
    
sendtorc("/reset " player.account);
    
// Add his account to the list so hes not reset again.
    
resetaccounts.add(player.account);
    
// Save the list of reset accounts to file again without unloading it from memory.
    
resetaccounts.savelines("levels/resetaccounts.txt"0);
  }

There, I don't think I missed anything.

You can use that method, or only use resetaccounts.txt for players that are currently in the process of resetting then just give them a clientr flag after the reset.
__________________
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 05:49 PM.


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