Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Feature Requests

Development::Feature Requests Post suggestions/feature requests here.

Reply
 
Thread Tools Display Modes
  #1  
Old 04-05-2005, 08:43 AM
knightz
Fire Beetle
 
Join Date: Jun 2004
Location: Canada
Posts: 24
Default

Sorry it took so long....

Code:
#!/usr/bin/perl

use Net::Telnet;
use strict;

my $server = "Website title : Who's online";
my $titleimg = "http://kmra.fliphost.net/themes/Illusion/images/head/banner.jpg";
my $host = "localhost";
my $user = "johndoe";
my $pass = "password";

my %players;

my $telnet = new Net::Telnet( Port=>9000, Timeout=>200, Errmode=>'die', Prompt=>'/knightz> $/i');
# print "Connecting...\n";
$telnet->open($host);

sleep 1;

$telnet->print($user);
$telnet->waitfor("/:/");
$telnet->print($pass);

$telnet->waitfor("/>/");

my @wholist = $telnet->cmd('who');

$telnet->close();

print "Content-type: text/html\n\n";
print "<title>$server online user list</title>";
print "<meta http-equiv='REFRESH' content='60;url=whoson.pl'>";
print "<body topmargin='0'>";
print "<center><img src='$titleimg'>";
print "<h3>$server</h3>";

foreach my $line (@wholist) {

    if($line =~/^ +\[.*/) { # regular players
        my ($v_userinfo, $v_zone, $v_account_id, $v_account_name, $v_lsid, $v_status) = split(/[a-zA-Z]+:/, $line);
        # clean up the spaces and other garbage
        $v_userinfo =~s/^ +//;
        $v_userinfo =~s/ +$//;
        $v_userinfo =~s/RolePlay |ANON //;
        $v_zone =~s/^ +([a-z]+) +$/$1/;

        # if no guild
        if($v_userinfo =~/^\[([0-9]+) ([A-Za-z ]+)\] ([A-Za-z_]+) \(([A-Za-z ]+)\)$/) {
            if($1>0) {
                $players{$3}{"level"} = $1;
                $players{$3}{"class"} = $2;
                $players{$3}{"race"} = $4;
                $players{$3}{"guild"} = "\&nbsp;";
                $players{$3}{"zone"} = $v_zone;
            } else {
                $players{$3}{"level"} = "\&nbsp;";
                $players{$3}{"class"} = "\&nbsp;";
                $players{$3}{"race"} = "\&nbsp;";
                $players{$3}{"guild"} = "\&nbsp;";
                $players{$3}{"zone"} = "zoning";
            }
        # if in a guild
        } elsif($v_userinfo =~/^\[([0-9]+) ([A-Za-z ]+)\] ([A-Za-z_]+) \(([A-Za-z ]+)\) \<(.*)\>$/) {
            if($1>0) {
                $players{$3}{"level"} = $1;
                $players{$3}{"class"} = $2;
                $players{$3}{"race"} = $4;
                $players{$3}{"guild"} = $5;
                $players{$3}{"zone"} = $v_zone;
            } else {
                $players{$3}{"level"} = "\&nbsp;";
                $players{$3}{"class"} = "\&nbsp;";
                $players{$3}{"race"} = "\&nbsp;";
                $players{$3}{"guild"} = "\&nbsp;";
                $players{$3}{"zone"} = "zoning";
            }
        }
    } elsif($line =~/\* GM-.*/) { # GMs
        $line =~s/\* GM-[A-Za-z]+ \*//;
        my ($v_userinfo, $v_zone, $v_account_id, $v_account_name, $v_lsid, $v_status) = split(/[a-zA-Z]+:/, $line);
        # clean up the spaces and other garbage
        $v_userinfo =~s/^ +//;
        $v_userinfo =~s/ +$//;
        $v_userinfo =~s/RolePlay |ANON //;
        $v_zone =~s/^ +([a-z]+) +$/$1/;

        # if no guild
        if($v_userinfo =~/^\[([0-9]+) ([A-Za-z ]+)\] ([A-Za-z_]+) \(([A-Za-z ]+)\)$/) {
            if($1>0) {
                $players{$3}{"level"} = $1;
                $players{$3}{"class"} = $2;
                $players{$3}{"race"} = $4;
                $players{$3}{"guild"} = "\&nbsp;";
                $players{$3}{"zone"} = $v_zone;
                $players{$3}{"gm"} = "yes";
            } else {
                $players{$3}{"level"} = "\&nbsp;";
                $players{$3}{"class"} = "\&nbsp;";
                $players{$3}{"race"} = "\&nbsp;";
                $players{$3}{"guild"} = "\&nbsp;";
                $players{$3}{"zone"} = "zoning";
                $players{$3}{"gm"} = "yes";
            }
        # if in a guild
        } elsif($v_userinfo =~/^\[([0-9]+) ([A-Za-z ]+)\] ([A-Za-z_]+) \(([A-Za-z ]+)\) \<(.*)\>$/) {
            if($1>0) {
                $players{$3}{"level"} = $1;
                $players{$3}{"class"} = $2;
                $players{$3}{"race"} = $4;
                $players{$3}{"guild"} = $5;
                $players{$3}{"zone"} = $v_zone;
                $players{$3}{"gm"} = "yes";
            } else {
                $players{$3}{"level"} = "\&nbsp;";
                $players{$3}{"class"} = "\&nbsp;";
                $players{$3}{"race"} = "\&nbsp;";
                $players{$3}{"guild"} = "\&nbsp;";
                $players{$3}{"zone"} = "zoning";
                $players{$3}{"gm"} = "yes";
            }
        }
    }
}

print "<html><body><table border='1' cellpadding='3' cellspacing='0'>\n";
print "<tr><td align='center'>Player</td><td align='center'>Class</td><td align='center'>Zone</td><td align='center'>Guild</td></tr>\n";
my $count = 0;

if(scalar(%players) > 0) {
    foreach my $player (sort keys %players) {
        my $fontcolor;
        if(defined $players{$player}{"gm"}) {
            $fontcolor = '#008f1e';
        } else {
            $fontcolor = '#000000';
        }
        print "<tr><td align='center'><font color='$fontcolor'>$player</font></td><td>$players{$player}{'level'} $players{$player}{'race'} $players{$player}{'class'}</td><td align='center'>$players{$player}{'zone'}</td><td align='center'>$players{$player}{'guild'}</td></tr>\n";
        $count++;
    }
} else {
    print "<tr><td colspan='4'>No players online</tr>";
}
print "</table><br>";
print "$count players online.";
print "</center>";
print "</body></html>\n";
__________________
~ bUri

Last edited by knightz; 04-13-2005 at 10:06 PM..
Reply With Quote
  #2  
Old 04-05-2005, 07:15 PM
KhaN's Avatar
KhaN
Dragon
 
Join Date: Mar 2004
Location: France, Bordeaux.
Posts: 677
Default

Thanks Buri, its nice PHP script

btw, i seen on KMRA you fixed govtcheese magelo profile for latest EQEmu version, is there any plan to make it public ? :p
__________________

Reply With Quote
  #3  
Old 04-06-2005, 02:39 AM
knightz
Fire Beetle
 
Join Date: Jun 2004
Location: Canada
Posts: 24
Default

Quote:
Originally Posted by KhaN
btw, i seen on KMRA you fixed govtcheese magelo profile for latest EQEmu version, is there any plan to make it public ? :p
Actually atm, I only stripped out the parts it reads the item information from a custom items table (dont have the import script). I do plan on fixing this (eventually) and will release it at that time.
__________________
~ bUri

Last edited by knightz; 04-06-2005 at 10:42 AM..
Reply With Quote
  #4  
Old 04-05-2005, 10:05 PM
Belfedia
Demi-God
 
Join Date: Jan 2005
Posts: 1,109
Default

Don't know perl,
But i have a error :
Global symbol "$li" requires explicit package name at D:/Apache2/cgi-bin/whoson.pl line 41.

Ps: perl is'nt install with telnet features
you need to open Mcpan and install module no more error 500
__________________
__________________________________________________ _____________________________________
I speak english like a spanish cow..., I speak spanish like a english pudding...
But I try to speak good french !!! (Non au langage SMS sur forum)
http://eqfroggy.new.fr : Froggy French Server Website.
Reply With Quote
  #5  
Old 04-06-2005, 11:50 PM
sdabbs65
Dragon
 
Join Date: Dec 2003
Location: Earth
Posts: 818
Default non computer GURU's INSTALL telnet under Perl.

Go to DOS and type .
perl -MCPAN -e shell;

then at the command lilne type
install Net::Telnet::Cisco
you will see about 500 lines then ask you to do some things just keep hitting enter for default.

then you will have telnet installed under perl.
__________________
hosting Eqemu/Runuo/wow Emulators.

www.cheaterz.info
Reply With Quote
  #6  
Old 08-08-2005, 06:56 AM
SuedeWorthey
Sarnak
 
Join Date: Jan 2005
Posts: 64
Default No PERL... PHP is the way to go.

I don't use PERL, so can someone port this to PHP? I will if I have to but if someone has already done it, please share.
__________________
-Suede Worthey-
http://www.wortheysoft.com
http://www.steelpsychos.com
Reply With Quote
  #7  
Old 08-08-2005, 06:31 PM
mwmdragon's Avatar
mwmdragon
Discordant
 
Join Date: Apr 2003
Location: Winnipeg, Manitoba Canada
Posts: 270
Default php

Yeah PHP would be nice
__________________
Thanks
MWMDRAGON

NeverQuest
http://neverquest.gotdns.com
Emucade
http://dragonsden.emuunlim.com
Reply With Quote
  #8  
Old 08-09-2005, 06:51 AM
SuedeWorthey
Sarnak
 
Join Date: Jan 2005
Posts: 64
Default

Quote:
Originally Posted by mwmdragon
Yeah PHP would be nice
I am working on a port now... Just gotta figure out all the authentication stuff...
__________________
-Suede Worthey-
http://www.wortheysoft.com
http://www.steelpsychos.com

Last edited by SuedeWorthey; 08-09-2005 at 03:42 PM..
Reply With Quote
  #9  
Old 08-11-2005, 05:52 AM
sdabbs65
Dragon
 
Join Date: Dec 2003
Location: Earth
Posts: 818
Default telnet

Quote:
Originally Posted by SuedeWorthey
I am working on a port now... Just gotta figure out all the authentication stuff...
I heard the telnet feature was disabled years ago...
it may still be in the source somewhere tho <shrug>..
__________________
hosting Eqemu/Runuo/wow Emulators.

www.cheaterz.info
Reply With Quote
Reply

Thread Tools
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 -4. The time now is 12:27 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3