Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 11-20-2008, 08:17 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default 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.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #2  
Old 11-20-2008, 08:52 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,491
Default

Did you try this to see if it gets rid of error?
Code:
if ($client_search) {
Reply With Quote
  #3  
Old 11-21-2008, 03:32 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

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

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
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
Reply


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 09:04 AM.


 

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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3