EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Issue with finding clients (https://www.eqemulator.org/forums/showthread.php?t=26814)

trevius 11-20-2008 08:17 PM

Issue with finding clients
 
I am working on a new event for Thanksgiving, and I am running into a minor issue that I would like help with. Below, I have a section of my script that I am using for the event (most of the script is removed for easier reading). This part of the script is meant to search the entity list for any clients in the zone. I use the client information later, but it isn't relative to this problem, so I am leaving it out. Basically, the $list_check variable is incremented in a FOR and each time, it checks to see if it has found an actual client in the entity list.

Code:

sub EVENT_TIMER {

  if ($timer eq "runaway") {
    quest::stoptimer("runaway");
    my $list_check = 0;

    for ($list_check = 0; $list_check < 500; $list_check++) {

      $client_search = $entity_list->GetClientByID($list_check);
   
      if ($client_search != 0) {
        quest::say("I found client $client_search");
      }
    }
  quest::settimer("runaway",2);
  }

}

The problem I am having is that each time it doesn't find a client, it gives a log messages saying:

Code:

[Quest] Use of uninitialized value in numeric ne (!=) at quests/overthere/A_Gobbler.pl line 222.
And since it is going through hundreds of entities every second, the log files get insanely huge very fast.

So, my question is; does anyone know a better way to find clients, or at least a way to stop this message from coming in? I tried changing it to ne instead of != and that made no difference. Also, in my log.ini, I have quest logging turned off, so I am not sure why this is even being logged at all. If someone knows what else I might need to turn off, I would appreciate the info.

Once the script is all done, I plan to post it on the forums here, because it is actually a pretty cool script. I am sure people could use parts of it and/or modify it to be their own and make good use of it. Basically, the script makes Cockatrices in Overthere run away from any players that get in range of them. Sort of a chicken chasing game, accept with a Thanksgiving twist. Also, it is designed to be done with a partner, so if you are solo they are almost impossible to catch and kill, but if you have a partner, they slow down when 2 players are close to them.

joligario 11-20-2008 08:52 PM

Did you try this to see if it gets rid of error?
Code:

if ($client_search) {

trevius 11-21-2008 03:32 AM

LOL, I did try that, but I did it like this:

Code:

if ($client_search) {
  if ($client_search >= 1) {

And for some reason, it still seemed to have the same problem. But, I just tried it with just this:

Code:

if ($client_search) {
As you suggested, and it seems to be working perfectly with no insane amount of log entries. So, thanks lol :D

If anyone is interested, I will be posting the full script in the custom quests section. It is definitely something fun to at least check out and play around with :)


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

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