|
|
|
|
|
|
| Back to top |
|
 |
Trebe Young One

Joined: 23 Mar 2004 Posts: 58 Location: Computer Desk, My House, Alberta, Canada
   
|
Posted: Mon Apr 05, 2004 6:46 pm Post subject: |
|
|
| Seems to me like you could modify the number guessing game to do it. |
|
| Back to top |
|
 |
JTW God Like

Joined: 07 Mar 2004 Posts: 582 Location: Maidstone
  votes: 4
|
Posted: Tue Apr 06, 2004 12:51 pm Post subject: |
|
|
good i dea il try that next _________________ "Help us, Help you" - BotDepot |
|
| Back to top |
|
 |
jonphamta Senior Member

Joined: 20 Jan 2004 Posts: 247
   
|
Posted: Sun Apr 11, 2004 3:06 am Post subject: |
|
|
why dont you: *Make a new account *download the SDBA trivia bot *use the 'Call' command to invite the bot
And there you have it  |
|
| Back to top |
|
 |
JTW God Like

Joined: 07 Mar 2004 Posts: 582 Location: Maidstone
  votes: 4
|
Posted: Sun Apr 11, 2004 5:53 am Post subject: |
|
|
good idea  Thanks _________________ "Help us, Help you" - BotDepot |
|
| Back to top |
|
 |
Stephen Senior Member

Joined: 03 Dec 2003 Posts: 159
   
|
Posted: Sun Apr 11, 2004 6:08 am Post subject: |
|
|
| Code: | | sub trivia<br />{<br /> my ($bot, $self, $user, $msg) = @_;<br /><br /> if ($msg eq '')<br /> {<br /> if (!exists $self->{callback})<br /> {<br /> $self->{callback} = 'trivia';<br /> $self->{trivia} = {};<br /> my $trivia = $self->{trivia};<br /> $trivia->{part} = 'one';<br /> &question();<br /> }<br /> }<br /> else<br /> {<br /> my $trivia = $self->{trivia};<br /> if ($trivia->{part} eq 'one')<br /> {<br /> if ($msg eq "stop")<br /> {<br /> $self->{callback} = '';<br /> delete $self->{trivia};<br /> return "You have left the trivia.";<br /> }<br /> if ($msg eq $trivia->{answer}) <br /> {<br /> return "You have guessed the correct answer!";<br /> &question();<br /> }<br /> else<br /> {<br /> return "You guessed wrong!";<br /> }<br /> }<br /> }<br /><br />}<br /><br />sub question<br />{<br /> my ($bot, $self, $user, $msg) = @_;<br /> my $trivia = $self->{trivia};<br /><br /> open (FILE, "./trivia.txt");<br /> my @trivia = <FILE>;<br /> close FILE;<br /> chomp @trivia;<br /><br /> $full = $trivia[int(rand(scalar(@trivia)))];<br /><br /> my ($trivia->{question},$trivia->{answer}) = split (/==/,$full,2);<br /> return $trivia->{question};<br />}<br /><br />{<br />}; |
Format:
==
Save the questions and answers to a txt file called trivia in the bots directory.
Sorry this code is untested  |
|
| Back to top |
|
 |
Stephen Senior Member

Joined: 03 Dec 2003 Posts: 159
   
|
Posted: Thu Apr 15, 2004 3:48 am Post subject: |
|
|
Why do people keep taking points off me for this command.
1stly I cant use andromeda because it doesnt work for me. That means i cant test andromeda commands so why take points from someone who posted a command that will proberly work. Also no one has said it doesnt work! |
|
| Back to top |
|
 |
eric256 The Keymaker

Joined: 03 May 2006 Posts: 2292 Location: Colorado
     
|
Posted: Thu Apr 15, 2004 2:18 pm Post subject: |
|
|
Don't post commands that you can't test. Oh and only 1 person downvoted you for it so get over it. _________________ Eric256
Proud previous owner and current admin of Bot-depot.com |
|
| Back to top |
|
 |
|