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.