EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Quests (https://www.eqemulator.org/forums/forumdisplay.php?f=624)
-   -   perl quest testing addition (https://www.eqemulator.org/forums/showthread.php?t=12174)

smogo 02-27-2004 05:59 AM

perl quest testing addition
 
here is a small addition to variable displaying ( ala Lurker_005's default.pl). It allows to get ALL exported vars, including qglobals. It is dynamic, so no update should be needed when server changes, and also, it works with all quest files, not only default.pl

Add the following lines in EVENT_SAY :
Code:

  if ($text=~/allvars/i){
      my($pack, $filename, $line, $subr, $has_args, $want_array)=caller(0);

      #get all variables in caller's scope
      no strict 'refs';
      my $package;
        ($package=$subr) =~ s/::\w+// ;
        my $stash = *{$package . '::'}{HASH};
        my $n;
        foreach $n (keys %$stash) {
          my $fullname = $package . '::' . $n;
          if( defined $$fullname){
            $$n=${$fullname};
            quest::say("$n -> $$n (fully $fullname)\n");
          }
        }
  }

Then say 'allvars' to the target.

The output is a bit long, but could prove usefull
http://perso.wanadoo.fr/afou/khalzed...ts/allvars.jpg

Lurker_005 02-27-2004 04:46 PM

Cool!

Glad to see someone starting to push what the perls quest system can do, even if this is for testing :) Hopefully this will inspire someone else that knows perl to get creative.

smogo 02-28-2004 12:40 AM

thx. But this isn't just for fun. It was a mandatory tool for something* i'm planning, as well as the simulator.

*Should be out today. :wink:


All times are GMT -4. The time now is 11:09 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.