Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


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 08:29 AM.


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