comparison skillbot.pl @ 43:edb68779265b

Fixing undefined variable warning
author Dominic Cleal <dominic@computerkb.co.uk>
date Sat, 13 Dec 2008 11:36:07 +0000
parents bf685f1a545f
children f7abbe853f5d
comparison
equal deleted inserted replaced
42:bf685f1a545f 43:edb68779265b
231 for my $f (@friends) { 231 for my $f (@friends) {
232 if ((defined $2 && lc($f->{char}->name) eq lc($2)) 232 if ((defined $2 && lc($f->{char}->name) eq lc($2))
233 || (!defined $2 && $f->{nick} eq $their_nick)) { 233 || (!defined $2 && $f->{nick} eq $their_nick)) {
234 my $text; 234 my $text;
235 if (defined $f->{skill}) { 235 if (defined $f->{skill}) {
236 my $downtime = undef; 236 my $downtime = '';
237 if (skill_finish_in_downtime($f->{skill})) { 237 if (skill_finish_in_downtime($f->{skill})) {
238 $downtime = ", coincides with downtime"; 238 $downtime = ", coincides with downtime";
239 } 239 }
240 240
241 $text = sprintf("Currently training %s %s (finish in %s%s)", 241 $text = sprintf("Currently training %s %s (finish in %s%s)",
242 $f->{skill}->name, $f->{skill}->level, 242 $f->{skill}->name, $f->{skill}->level,
243 $f->{skill}->time_remaining, $downtime) 243 $f->{skill}->time_remaining, $downtime)
244 } else { 244 } else {
245 $text = "No skill currently training"; 245 $text = "No skill currently training";
246 } 246 }
247 247
248 $self->privmsg('#' . $config{channel}, sprintf( 248 $self->privmsg('#' . $config{channel}, sprintf(