User Control Panel
Advertisements

HELP US, HELP YOU!

random yoda remarks - Maya

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands
View unanswered posts
Author Message
draget
Not Yet a God
Not Yet a God


Joined: 29 Dec 2004
Posts: 367
Location: Australia
Reputation: 32.2Reputation: 32.2Reputation: 32.2

PostPosted: Wed Feb 16, 2005 10:19 am    Post subject: Reply with quote

I have made another attempt at a command, very basic though! Decided; you guys have helped me so I thinks its time I helped you (thought about motto)!

This one will for every one in 20 messages reply, echoing it yoda style.

To install in Maya 4: put this code anywhere into message.pl

Others: Written for Maya 4 but can easily be converted, just put it in the message sub.


Code:
# yoda --------------------------------------------------------------------------------------<br /># addition for Maya by draget. Credit to Thomashp as it uses his nice service.<br /><br />use LWP::Simple;<br /><br />#get number 20:1 are the odds I use but you may wish to change this<br /><br />my $randtwenty = int(rand(20));<br /><br /><br />#yoda style if it equals 5 (5 was the first number that popped into my head)<br /><br />if($randtwenty == 5) {<br /><br /><br />#get the the yoda translations from Thomashp's nice service<br /><br />my $yodastyle = get("http://www.thomashp.com/bw/yoda.cgi?direct=$msg");<br /><br /><br />#this is the maya send format, for others this will need to be changed<br /><br />&send($self, "$yodastyle (Yoda style)", $username);<br /><br />}


Comments/suggestions? Please no abuse though.

I'll say it again: Credit to Thomashp as it uses his great service.

Extra note: if your bot already has the line use LWP::Simple; at the top of the bot.pl file you won't need to put it again, without it there's one less line of code for the bot to go through.
Back to top
darkmonkey
The Merovingian
The Merovingian


Joined: 18 Apr 2004
Posts: 2557
Location: London, England
Reputation: 39.3Reputation: 39.3Reputation: 39.3Reputation: 39.3
votes: 7

PostPosted: Wed Feb 16, 2005 11:32 am    Post subject: Reply with quote

Nice command. Might lag the bot a bit, though.
_________________
~ Josh
[ Need bot hosting on a dedicated server? PM me. ]
Back to top
draget
Not Yet a God
Not Yet a God


Joined: 29 Dec 2004
Posts: 367
Location: Australia
Reputation: 32.2Reputation: 32.2Reputation: 32.2

PostPosted: Wed Feb 16, 2005 11:41 am    Post subject: Reply with quote

QUOTE(darkmonkey @ Feb 16 2005, 03:32 AM)
Nice command. Might lag the bot a bit, though.

Thanks DM!

My bot doesn't seem to lag noticeably.
Back to top
draget
Not Yet a God
Not Yet a God


Joined: 29 Dec 2004
Posts: 367
Location: Australia
Reputation: 32.2Reputation: 32.2Reputation: 32.2

PostPosted: Fri Feb 18, 2005 2:02 pm    Post subject: Reply with quote

Code:
# yoda ----------------------------------------------------------------------------------------------------------<br /># addition for Maya by draget. Credit to Thomashp as it usaer his nice service.<br /><br />unless($msg =~ /^%/) {<br /><br />#get number 15:1 are the odds I use but you may wish to change this<br /><br />my $randtwenty = int(rand(20));<br /><br /><br />#yoda style if it equals 5 (5 was the first number that popped into my head)<br /><br />if($randtwenty == 5) {<br /><br /><br />#get the the yoda translations from Thomashp's nice service<br /><br />my $yodastyle = get("http://www.thomashp.com/bw/yoda.cgi?direct=$msg");<br /><br /><br />#this is the maya send format, for others this will need to be changed<br /><br />&send($self, "$yodastyle (Yoda style)", $username);<br /><br />}<br /><br />}


That version will work a bit better as it filters commands.

Code:
<br />unless($msg =~ /^%/) {
You will need to change the % in that line to whatever your command character is.
Back to top
mat007
Almost An Agent
Almost An Agent


Joined: 12 Jan 2004
Posts: 1375

Reputation: 15.8Reputation: 15.8
votes: 2

PostPosted: Fri Feb 18, 2005 2:12 pm    Post subject: Reply with quote

it wont work better as it searches for % all thru the msg.

so add ^ at the begging of the regex that searches the begining
Back to top
draget
Not Yet a God
Not Yet a God


Joined: 29 Dec 2004
Posts: 367
Location: Australia
Reputation: 32.2Reputation: 32.2Reputation: 32.2

PostPosted: Fri Feb 18, 2005 2:29 pm    Post subject: Reply with quote

ok thanks, edited above........
Back to top
thomashp
Member
Member


Joined: 22 Feb 2004
Posts: 121
Location: Richmond, VA
Reputation: 29.3Reputation: 29.3Reputation: 29.3

PostPosted: Fri Feb 18, 2005 2:43 pm    Post subject: Reply with quote

thanks for using my service!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group