|
| Author |
Message |
Cer Upgraded Agent

Joined: 03 Feb 2004 Posts: 3776 Location: Michigan
  votes: 4
|
Posted: Fri Dec 31, 2004 6:53 pm Post subject: |
|
|
Here's a customizable Leviathan command for how to keep an idiot occupied. If you want to modify it to something else, all you do is change the command name (filename/sub), and then edit the variables and array!
Here's the code:
| Code: | | # . . <Leviathan><br /># .:...:: Command Name // !idiot<br /># .:: ::. Description // How to keep an idiot busy.<br /># ..:;;. ' .;;:.. Usage // !idiot<br /># . ''' . Permissions // Public.<br /># :;,:,;: Listener // All<br /># : : Copyright // 2005 AiChaos Inc.<br /><br />sub idiot {<br /> my ($self,$client,$msg) = @_;<br /><br /> # Hashref keys (name of callback and key to store the step in).<br /> my $callback = 'idiot';<br /> my $key = '_idiot';<br /><br /> # Array of things to say.<br /> my @ramble = (<br /> "I'm about to teach you how to keep an idiot occupied. You ready?",<br /> "Are you sure you want to know how to keep an idiot occupied?",<br /> "Are you absolutely sure?",<br /> "How about absolutely positively sure?",<br /> "Alright, I'm about to tell you. You still want to know?",<br /> "Just say the word one more time and I'll tell you.",<br /> "Congratulations, you now know how to keep an idiot occupied!",<br /> );<br /><br /> # Callback?<br /> if ($chaos->{clients}->{$client}->{callback} eq $callback) {<br /> # Exiting?<br /> if ($msg =~ /exit/i) {<br /> # Exit.<br /> delete $chaos->{clients}->{$client}->{callback};<br /> delete $chaos->{clients}->{$client}->{$key};<br /> return "Aww... you're no fun!";<br /> }<br /> else {<br /> # Give them the next step.<br /> my $step = $chaos->{clients}->{$client}->{$key};<br /> my $last = (scalar(@ramble)) - 1;<br /> if ($step == $last) {<br /> # Last step.<br /> delete $chaos->{clients}->{$client}->{callback};<br /> delete $chaos->{clients}->{$client}->{$key};<br /> return $ramble[$last];<br /> }<br /> else {<br /> # Continue rambling.<br /> $chaos->{clients}->{$client}->{$key}++;<br /> return $ramble[$step];<br /> }<br /> }<br /> }<br /> else {<br /> # Set the callback and counter.<br /> $chaos->{clients}->{$client}->{callback} = $callback;<br /> $chaos->{clients}->{$client}->{$key} = 1;<br /><br /> # Return step #0.<br /> return $ramble[0];<br /> }<br />}<br />{<br /> Category => 'Fun Stuff',<br /> Description => 'How to keep an idiot occupied.',<br /> Usage => '!idiot',<br /> Listener => 'All',<br />}; |
_________________ Current Site (2008) http://www.cuvou.com/ |
|
| Back to top |
|
 |
pfingy Newbie

Joined: 28 Dec 2004 Posts: 35
  
|
Posted: Sat Jan 01, 2005 12:30 am Post subject: |
|
|
ok i put it on but it gives me an error.
| Code: | | That is not a vaild command. Type !menu for a list of commands |
|
|
| Back to top |
|
 |
djwk Young One

Joined: 09 Mar 2004 Posts: 86
   
|
Posted: Sat Jan 01, 2005 2:49 am Post subject: |
|
|
That error is not caused by the invalid syntax, it is how your bot is configured.
You must of added the command in the wrong place as it is not recognising the !idiot command.
oh and well done on the command Cer i looked at it and had to laugh 
Alex |
|
| Back to top |
|
 |
pfingy Newbie

Joined: 28 Dec 2004 Posts: 35
  
|
Posted: Sat Jan 01, 2005 10:33 pm Post subject: |
|
|
| what would the directory you would want to put it in? |
|
| Back to top |
|
 |
djwk Young One

Joined: 09 Mar 2004 Posts: 86
   
|
Posted: Sat Jan 01, 2005 11:41 pm Post subject: |
|
|
If you read this post before i edited it sorry,
Its a sub command so you need to create a file called idiot.pl in your commands folder in public or sumets like that depending on your template.
then in idiot.pl put the code in the first post into it
then try |
|
| Back to top |
|
 |
pfingy Newbie

Joined: 28 Dec 2004 Posts: 35
  
|
Posted: Sun Jan 02, 2005 12:05 am Post subject: |
|
|
| can you just put your Commands Folder up for Download so that i can pull the command out? |
|
| Back to top |
|
 |
djwk Young One

Joined: 09 Mar 2004 Posts: 86
   
|
Posted: Sun Jan 02, 2005 12:26 am Post subject: |
|
|
I don't use a sub bot, I am not using this command either, was just trying to help you out.
Just have a look round to see if you can find where to put idiot.pl
Alex |
|
| Back to top |
|
 |
alienz Almost An Agent

Joined: 22 Mar 2004 Posts: 1436 Location: Mars
 
|
Posted: Sun Jan 02, 2005 1:32 am Post subject: |
|
|
The command is for Leviathan , not Juggernaut. If Leviathan has a commands folder, then it would go there. _________________ Check out Botworld! A dev resource for things bot.
Downloads, articles, news, fourm and more.
http://botworld.marzopolis.com |
|
| Back to top |
|
 |
Cer Upgraded Agent

Joined: 03 Feb 2004 Posts: 3776 Location: Michigan
  votes: 4
|
Posted: Sun Jan 02, 2005 2:34 am Post subject: |
|
|
At the bottom of my post, it says "Attached File" and then a link that reads "idiot.pl" - right-click on that, click "Save As", and put it in your "Leviathan/commands" folder (or any sub-folders; mine personally is in the "funstuff" folder). _________________ Current Site (2008) http://www.cuvou.com/ |
|
| Back to top |
|
 |
pfingy Newbie

Joined: 28 Dec 2004 Posts: 35
  
|
Posted: Sun Jan 02, 2005 5:45 am Post subject: |
|
|
| That's what i did exactly. |
|
| Back to top |
|
 |
Cer Upgraded Agent

Joined: 03 Feb 2004 Posts: 3776 Location: Michigan
  votes: 4
|
Posted: Sun Jan 02, 2005 1:50 pm Post subject: |
|
|
Did you reload the bot afterwards? When you add/modify code in the bot (commands are classified as code), you need to reload it. You can do that by sending the bot a !reload command (provided you did set yourself as a Master in the data/authority/master.txt), or you can shut down and restart the bot.  _________________ Current Site (2008) http://www.cuvou.com/ |
|
| Back to top |
|
 |
|