View Single Post
  #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