View Single Post
  #46  
Old 11-28-2015, 08:28 PM
atrayas
Hill Giant
 
Join Date: Jun 2010
Posts: 105
Default

Im having trouble getting this to work. We had it working fine before but we just recently migrated our server from a windows 7 baed machine to a Linux machine running debian8. Below is a copy of the perl script we are using, that worked fine before we migrated.

Code:
sub AutoTrain {

    $client->Message( 15, "Your experiences across the realm have infused you with increased power and knowledge..." );

    # set all available skills to maximum for race/class at current level
    foreach my $skill ( 0 .. 42 ) {
        next unless $client->CanHaveSkill($skill);
        my $maxSkill = $client->MaxSkill( $skill, $client->GetClass(), $ulevel );
        next unless $maxSkill > $client->GetRawSkill($skill);
        $client->SetSkill( $skill, $maxSkill );
    }
	foreach my $skill ( 48 .. 55 ) {
        next unless $client->CanHaveSkill($skill);
        my $maxSkill = $client->MaxSkill( $skill, $client->GetClass(), $ulevel );
        next unless $maxSkill > $client->GetRawSkill($skill);
        $client->SetSkill( $skill, $maxSkill );
    }
	foreach my $skill ( 66 .. 73 ) {
        next unless $client->CanHaveSkill($skill);
        my $maxSkill = $client->MaxSkill( $skill, $client->GetClass(), $ulevel );
        next unless $maxSkill > $client->GetRawSkill($skill);
        $client->SetSkill( $skill, $maxSkill );
    }
    # scribe all spells for current level
    quest::scribespells( $ulevel, $ulevel - 1 );

    # train all discs for current level
    quest::traindiscs( $ulevel, $ulevel - 1 );

}
Reply With Quote