Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-03-2009, 04:59 AM
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
Scripted /clientstats accountname

Was looking through help today and saw..

/clientstats accountname: shows client stats (requires Graal v6)

So I figured.. that can't be right! I would like that functionality now...

5 or so minutes later I arrived to this basic script..

PHP Code:
// For this post sakes I named this: -ExampleWeapon
function onActionServerSide() {
  if (
params[0] == "clientstats") {
    
// Display Results
    
echo("Clientstats for " player.account);
    for (
temp.lineparams[1]) {
      echo(
temp.line);
    }
  }
}

//#CLIENTSIDE

function onActionClientside() {
  if (
params[0] == "getclientstats"onClientStats();
}

function 
onClientStats() { 
  
// Clear Scripts Log
  
F2LogWindow_Text2.text "";
  
// Get Script Stats
  
shared.chat("showscriptstats");
  
// Wait.. so the scriptstats command can do it's work.
  
sleep(0.1);
  
// Strip HTML from Results
  
for (temp.lineF2LogWindow_Text2.getlines()) {
    
temp.line temp.line.substring(line.pos(">")+1);
    
temp.line temp.line.substring(0line.pos("<"));
    
temp.packet.add(temp.line);
  }
  
// Transfer Serverside
  
triggerserver("gui"name"clientstats"temp.packet);

Then you'd trigger the client..

PHP Code:
function onClientStats(acct) {
  
findplayer(acct).triggerclient("-ExampleWeapon""getclientstats");

Then NC gets spammed , so you may want to add the line..

PHP Code:
if (temp.line.pos("Gani player") >= 0) continue; 
Into the for loop when it's stripping html. Enjoy!
__________________
Quote:
Reply With Quote
  #2  
Old 07-03-2009, 05:03 AM
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
Could limit it to the top 10 NPCs... really no need to see the random NPC's taking up 0.001% most of the time. Perhaps have it catch the top 10 by default, and allow a parameter to capture x amounts.
Reply With Quote
  #3  
Old 07-03-2009, 05:13 AM
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
Quote:
Originally Posted by DustyPorViva View Post
Could limit it to the top 10 NPCs... really no need to see the random NPC's taking up 0.001 most of the time. Perhaps have it catch the top 10 by default, and allow a parameter to capture x amounts.
If people request it I'll add it Until then, I found that just having Gani Player not show really trims the result then again I did test/make this outside of Zodiac's OSL.
__________________
Quote:
Reply With Quote
  #4  
Old 07-03-2009, 01:25 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
The /clientstats function is more than the top NPCs taking CPU. It is also showing which elements of the game engine are taking most time (drawing tilesets, networking, input, etc.) and running clientside function profiling. It is also PMed to you from the player whose stats you requested so that you do not spam RC.

Looks nice, though.
__________________
Skyld
Reply With Quote
  #5  
Old 07-03-2009, 02:38 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 Skyld View Post
The /clientstats function is more than the top NPCs taking CPU. It is also showing which elements of the game engine are taking most time (drawing tilesets, networking, input, etc.) and running clientside function profiling. It is also PMed to you from the player whose stats you requested so that you do not spam RC.

Looks nice, though.
Holy ****, I want that badly.
Reply With Quote
  #6  
Old 07-03-2009, 02:59 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by Crow View Post
Holy ****, I want that badly.
It's incredibly useful; I use it a lot when testing the iPhone client because with it being a slower processor and not having an F2 window that's readily accessible, it helps to weed out laggy scripts and such.
__________________
Skyld
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 10:47 PM.


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