EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Anyone see an error in this script? (https://www.eqemulator.org/forums/showthread.php?t=33964)

Criimson 08-05-2011 10:18 AM

Anyone see an error in this script?
 
Well as I am fighting in PoP I occasionally run into a script that doesn't take into account bot groups. Not a problem. I tried editing this script but it is still crashing the zone.

Anyone see the error?

Code:

sub EVENT_CLICKDOOR {
  my $x = $client->GetX();
  my $y = $client->GetY();
  my $z = $client->GetZ();
  my $raid = $entity_list->GetRaidByClient($client);
  my $group = $entity_list->GetGroupByClient($client);

  if($doorid == 51) { #Agnarr Tower
    if($status > 79) { #GM status
      $client->MovePC(209, -765, -1735, 1270, 0);
    }
    elsif(plugin::check_hasitem($client, 9433)) { #Symbol of Torden
        $client->MovePC(209, -765, -1735, 1270, 0);
    }
    else { #Send gargoyles to attack
      my @npc_list = $entity_list->GetNPCList();
      foreach $npc (@npc_list) {
        if($npc->GetNPCTypeID() == 209024) {
          $npc->AddToHateList($client, 1);
        }
      }
    }
  }
  if($doorid == 61) { #SE tower
    if($status > 79) { #GM status
      $client->MovePC(209, 85, 145, 635, 128);
    }
    elsif($client->KeyRingCheck(9425) || plugin::check_hasitem($client, 9425)) { #Ring of Torden
      if(!$client->KeyRingCheck(9425)) {
        $client->KeyRingAdd(9425);   
              $client->MovePC(209, 85, 145, 635, 128);
      }
    }
    else { #Send gargoyles to attack
      my @npc_list = $entity_list->GetNPCList();
      foreach $npc (@npc_list) {
        if($npc->GetNPCTypeID() == 209110) {
          $npc->AddToHateList($client, 1);
        }
      }
    }
  }
  if($doorid == 63) { #SW tower
    if($status > 79) { #GM status
      $client->MovePC(209, -830, -865, 1375, 128);
    }
    elsif($client->KeyRingCheck(9425) || plugin::check_hasitem($client, 9425)) { #Ring of Torden
      if(!$client->KeyRingCheck(9425)) {
        $client->KeyRingAdd(9425);
        $client->MovePC(209, -830, -865, 1375, 128);
      }
    }
    else { #Send gargoyles to attack
      my @npc_list = $entity_list->GetNPCList();
      foreach $npc (@npc_list) {
        if($npc->GetNPCTypeID() == 209111) {
          $npc->AddToHateList($client, 1);
        }
      }
    }
  }
  if($doorid == 65) { #NW tower
    if($status > 79) { #GM status
      $client->MovePC(209, -350, -2200, 1955, 255);
    }
    elsif($client->KeyRingCheck(9425) || plugin::check_hasitem($client, 9425)) { #Ring of Torden
      if(!$client->KeyRingCheck(9425)) {
        $client->KeyRingAdd(9425);
        $client->MovePC(209, -350, -2200, 1955, 255);
      }
    }
    else { #Send gargoyles to attack
      my @npc_list = $entity_list->GetNPCList();
      foreach $npc (@npc_list) {
        if($npc->GetNPCTypeID() == 209112) {
          $npc->AddToHateList($client, 1);
        }
      }
    }
  }
  if($doorid == 67) { #NE tower
    if($status > 79) { #GM status
      $client->MovePC(209, 150, -1220, 1120, 128);
    }
    elsif($client->KeyRingCheck(9425) || plugin::check_hasitem($client, 9425)) { #Ring of Torden
      if(!$client->KeyRingCheck(9425)) {
        $client->KeyRingAdd(9425);
        $client->MovePC(209, 150, -1220, 1120, 128);
      }
    }
    else { #Send gargoyles to attack
      my @npc_list = $entity_list->GetNPCList();
      foreach $npc (@npc_list) {
        if($npc->GetNPCTypeID() == 209113) {
          $npc->AddToHateList($client, 1);
        }
      }
    }
  }
}

Thank you
Criimson

Congdar 08-05-2011 12:53 PM

when you get a crash, do you not get any clues in the logs or crash dumps?

Criimson 08-05-2011 03:18 PM

I look in the log files and nothing shows. Does perl write errors somewhere besides /eqemu/logs/ ?

I now crash when trying to use SolRo stone and PoTactics stone. The rest work just fine oddly enough.

Also does perl use any kind of cache system? I was getting out of date pointers that I "fixed" by renumbering my character ID but then tried reinstalling perl without renumbering the char ID and that also fixed the problems I was having. So am thinking maybe it has something to do with reading bad data.

EDIT:
Just cleared all logs and started the server and tried to zone in to SolRo

This was in eqemu_quest_zone_****.log (at the end of all 5 zones) at the bottom

[08.05. - 12:26:00] Terminating on signal SIGHUP(1)

Am guessing this is what is causing it as I have never seen this.

Any ideas?

Congdar 08-05-2011 03:58 PM

in logs with names like eqemu_quest_zone_0272.log you would get perl msgs like
[08.02. - 11:17:56] Useless use of private variable in void context at plugins/formation_tools.pl line 364.

Congdar 08-05-2011 04:00 PM

i see the edit now... not sure what that SIGHUP(1) is. Any clues around that log line?

Criimson 08-05-2011 04:25 PM

This is what is in all 5:

Code:

---------------------------------------------
[08.05. - 12:23:12] Starting Log: logs/eqemu_quest_zone_4844.log
[08.05. - 12:23:12] Tying perl output to eqemu logs
[08.05. - 12:23:12] Creating EQEmuIO=HASH(0x2af116c)
[08.05. - 12:23:12] Creating EQEmuIO=HASH(0x2ae1df4)
[08.05. - 12:23:12] Loading perlemb plugins.
[08.05. - 12:23:12] Useless use of private variable in void context at plugins/formation_tools.pl line 364.
[08.05. - 12:23:12] Subroutine Cwd::fastcwd redefined at C:/Perl/lib/Cwd.pm line 812.
[08.05. - 12:23:12] Subroutine Cwd::getcwd redefined at C:/Perl/lib/Cwd.pm line 812.
[08.05. - 12:23:12] Subroutine Cwd::abs_path redefined at C:/Perl/lib/Cwd.pm line 812.
[08.05. - 12:23:12] Subroutine CalcDestFromHeading redefined at plugins/path_tools.pl line 222.
[08.05. - 12:23:12] Loading perl commands...
[08.05. - 12:26:00] Terminating on signal SIGHUP(1)


Congdar 08-05-2011 04:26 PM

You on Linux? I mention this cuz if you set up Visual Studio right it will catch the zone crashes and put you right on the line that it crashed on for further debugging.

Criimson 08-05-2011 10:18 PM

No I'm on WIndows. Used VC++

I'll look into that

Thanks


All times are GMT -4. The time now is 01:00 AM.

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