|
| Author |
Message |
purcelly God Like

Joined: 10 Jun 2004 Posts: 560 Location: North West, England
    
|
Posted: Fri Dec 31, 2004 7:19 pm Post subject: |
|
|
in elsif
| Code: | | #Made By Purcelly <br />#For Innington<br /><br />if($msg =~ /^!church/)<br />{<br />&send($self,"Here is one way to get out out of going to church:");<br />open (FILE, "./church.txt");<br />@bat = <FILE>;<br />close (FILE);<br /> $result = $quotes[int(rand(scalar(@quotes)))];<br /> $self->sendmsg("$result", Font => "Arial",Color => '017151',Effect => "B");}<br />} |
|
|
| Back to top |
|
 |
mat007 Almost An Agent

Joined: 12 Jan 2004 Posts: 1375
   votes: 2
|
Posted: Fri Dec 31, 2004 7:43 pm Post subject: |
|
|
Dude are you testing these as there are rodents cury brackets????
And its not counting anything cus theres no @quotes array |
|
| Back to top |
|
 |
farkie God Like

Joined: 15 Nov 2003 Posts: 673
   
|
Posted: Sat Jan 01, 2005 1:33 pm Post subject: |
|
|
| Code: | | <br />if($msg =~ /^!church/) {<br />open (FILE, "church.txt");<br />my @quotes = <FILE>;<br />close (FILE);<br />my $result = $quotes[int(rand(scalar(@quotes)))];<br />$self->sendmsg("Here is one way to get out out of going to church:\n\n $result", Font => "Arial",Color => '017151',Effect => "B");<br />}<br /> |
|
|
| Back to top |
|
 |
Siebe God Like

Joined: 06 Jan 2004 Posts: 562 Location: Netherlands
    
|
Posted: Sat Jan 01, 2005 4:58 pm Post subject: |
|
|
| Can I ask, where are the "my"s? Hmm? |
|
| Back to top |
|
 |
farkie God Like

Joined: 15 Nov 2003 Posts: 673
   
|
Posted: Sat Jan 01, 2005 5:07 pm Post subject: |
|
|
| just there :unsure: |
|
| Back to top |
|
 |
purcelly God Like

Joined: 10 Jun 2004 Posts: 560 Location: North West, England
    
|
Posted: Sat Jan 01, 2005 11:11 pm Post subject: |
|
|
can i jsut say
i dont care aobut the rep
but everyone is saying stop posting untested
they were posted one after another not at seperate times
they worked when i testes on my morphious bot so
 |
|
| Back to top |
|
 |
Mojave Almost An Agent

Joined: 01 Nov 2003 Posts: 1434
 
|
Posted: Sun Jan 02, 2005 1:31 am Post subject: |
|
|
QUOTE(purcelly-tech @ Jan 1 2005, 03:11 PM) they worked when i testes on my morphious bot so | How could they have worked as originally written? They had bugs that would make them non-functional. Don't use "well they worked for me" as an excuse for buggy untested code.
What made it worse was that you posted buggy untested code FIVE times. I would excuse a bug or two in very complicated code, but all your code does it get a random line from a text file. There are examples on this site of working code that does that - you should have searched for them first and copied them if you had to. |