rbot 0.9.9
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +16 -0
- data/COPYING +21 -0
- data/ChangeLog +418 -0
- data/INSTALL +8 -0
- data/README +44 -0
- data/REQUIREMENTS +34 -0
- data/TODO +5 -0
- data/Usage_en.txt +129 -0
- data/bin/rbot +81 -0
- data/data/rbot/contrib/plugins/figlet.rb +20 -0
- data/data/rbot/contrib/plugins/ri.rb +83 -0
- data/data/rbot/contrib/plugins/stats.rb +232 -0
- data/data/rbot/contrib/plugins/vandale.rb +49 -0
- data/data/rbot/languages/dutch.lang +73 -0
- data/data/rbot/languages/english.lang +75 -0
- data/data/rbot/languages/french.lang +39 -0
- data/data/rbot/languages/german.lang +67 -0
- data/data/rbot/plugins/autoop.rb +68 -0
- data/data/rbot/plugins/autorejoin.rb +16 -0
- data/data/rbot/plugins/cal.rb +15 -0
- data/data/rbot/plugins/dice.rb +81 -0
- data/data/rbot/plugins/eightball.rb +19 -0
- data/data/rbot/plugins/excuse.rb +470 -0
- data/data/rbot/plugins/fish.rb +61 -0
- data/data/rbot/plugins/fortune.rb +22 -0
- data/data/rbot/plugins/freshmeat.rb +98 -0
- data/data/rbot/plugins/google.rb +51 -0
- data/data/rbot/plugins/host.rb +14 -0
- data/data/rbot/plugins/httpd.rb.disabled +35 -0
- data/data/rbot/plugins/insult.rb +258 -0
- data/data/rbot/plugins/karma.rb +85 -0
- data/data/rbot/plugins/lart.rb +181 -0
- data/data/rbot/plugins/math.rb +122 -0
- data/data/rbot/plugins/nickserv.rb +89 -0
- data/data/rbot/plugins/nslookup.rb +43 -0
- data/data/rbot/plugins/opme.rb +19 -0
- data/data/rbot/plugins/quakeauth.rb +51 -0
- data/data/rbot/plugins/quotes.rb +321 -0
- data/data/rbot/plugins/remind.rb +228 -0
- data/data/rbot/plugins/roshambo.rb +54 -0
- data/data/rbot/plugins/rot13.rb +10 -0
- data/data/rbot/plugins/roulette.rb +147 -0
- data/data/rbot/plugins/rss.rb.disabled +414 -0
- data/data/rbot/plugins/seen.rb +89 -0
- data/data/rbot/plugins/slashdot.rb +94 -0
- data/data/rbot/plugins/spell.rb +36 -0
- data/data/rbot/plugins/tube.rb +71 -0
- data/data/rbot/plugins/url.rb +88 -0
- data/data/rbot/plugins/weather.rb +649 -0
- data/data/rbot/plugins/wserver.rb +71 -0
- data/data/rbot/plugins/xmlrpc.rb.disabled +52 -0
- data/data/rbot/templates/keywords.rbot +4 -0
- data/data/rbot/templates/lart/larts +98 -0
- data/data/rbot/templates/lart/praises +5 -0
- data/data/rbot/templates/levels.rbot +30 -0
- data/data/rbot/templates/users.rbot +1 -0
- data/lib/rbot/auth.rb +203 -0
- data/lib/rbot/channel.rb +54 -0
- data/lib/rbot/config.rb +363 -0
- data/lib/rbot/dbhash.rb +112 -0
- data/lib/rbot/httputil.rb +141 -0
- data/lib/rbot/ircbot.rb +808 -0
- data/lib/rbot/ircsocket.rb +185 -0
- data/lib/rbot/keywords.rb +433 -0
- data/lib/rbot/language.rb +69 -0
- data/lib/rbot/message.rb +256 -0
- data/lib/rbot/messagemapper.rb +262 -0
- data/lib/rbot/plugins.rb +291 -0
- data/lib/rbot/post-install.rb +8 -0
- data/lib/rbot/rbotconfig.rb +36 -0
- data/lib/rbot/registry.rb +271 -0
- data/lib/rbot/rfc2812.rb +1104 -0
- data/lib/rbot/timer.rb +201 -0
- data/lib/rbot/utils.rb +83 -0
- data/setup.rb +1360 -0
- metadata +129 -0
@@ -0,0 +1,49 @@
|
|
1
|
+
#----------------------------------------------------------------#
|
2
|
+
# Filename: vandale.rb
|
3
|
+
# Description: Rbot plugin. Looks up a word in the Dutch VanDale
|
4
|
+
# dictionary
|
5
|
+
# Author: eWoud - ewoud.nuyts<AT>student.kuleuven.ac.be
|
6
|
+
# requires GnuVD www.djcbsoftware.nl/projecten/gnuvd/
|
7
|
+
#----------------------------------------------------------------#
|
8
|
+
|
9
|
+
class VanDalePlugin < Plugin
|
10
|
+
def help(plugin, topic="")
|
11
|
+
"vandale [<word>] => Look up in the VanDale dictionary"
|
12
|
+
end
|
13
|
+
def privmsg(m)
|
14
|
+
case m.params
|
15
|
+
when (/^([\w-]+)$/)
|
16
|
+
ret = Array.new
|
17
|
+
Utils.safe_exec("/usr/local/bin/gnuvd", m.params).each{|line| if line.length > 5 then ret << line end}
|
18
|
+
m.reply ret.delete_at(0)
|
19
|
+
while ret[0] =~ /^[[:alpha:]_]*[0-9]/
|
20
|
+
m.reply ret.delete_at(0)
|
21
|
+
end
|
22
|
+
while ret[0] =~ /^[0-9]/
|
23
|
+
m.reply ret.delete_at(0)
|
24
|
+
end
|
25
|
+
i = 0
|
26
|
+
while i < ret.length
|
27
|
+
ret[i] = ret[i].slice(/^[[:graph:]_]*/)
|
28
|
+
if ret[i].length == 0 or ret[i] =~ /^[0-9]/
|
29
|
+
then
|
30
|
+
ret.delete_at(i)
|
31
|
+
else
|
32
|
+
i = i+1
|
33
|
+
end
|
34
|
+
end
|
35
|
+
if ret.length != 0 then
|
36
|
+
m.reply "zie ook " + ret.join(", ")
|
37
|
+
end
|
38
|
+
return
|
39
|
+
when nil
|
40
|
+
m.reply "incorrect usage: " + help(m.plugin)
|
41
|
+
return
|
42
|
+
else
|
43
|
+
m.reply "incorrect usage: " + help(m.plugin)
|
44
|
+
return
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
plugin = VanDalePlugin.new
|
49
|
+
plugin.register("vandale")
|
@@ -0,0 +1,73 @@
|
|
1
|
+
okay:
|
2
|
+
ok
|
3
|
+
ok dan :)
|
4
|
+
goed
|
5
|
+
mooi
|
6
|
+
voila
|
7
|
+
in orde
|
8
|
+
't is gebeurd
|
9
|
+
zeker
|
10
|
+
dat kan ik!
|
11
|
+
komt in orde
|
12
|
+
k
|
13
|
+
ik zal het eens doen
|
14
|
+
dunno:
|
15
|
+
geen idee
|
16
|
+
dat weet ik niet
|
17
|
+
dat gaat m'n petje te boven
|
18
|
+
*haal schouder op*
|
19
|
+
vraag dat aan iemand anders
|
20
|
+
dat moet je niet aan mij vragen
|
21
|
+
wie weet dat?
|
22
|
+
dat kan ik niet
|
23
|
+
laat je eens nakijken...
|
24
|
+
wat vraag je nu?
|
25
|
+
dunno_about_X:
|
26
|
+
maar ik weet niks over %s
|
27
|
+
Ik heb nog nooit van %s gehoord :(
|
28
|
+
maar wat is %s?
|
29
|
+
insult:
|
30
|
+
%s: idioot!
|
31
|
+
%s: :(
|
32
|
+
%s: Ik haat je:(
|
33
|
+
%s: val dood!
|
34
|
+
%s: Ik ben beledigd!
|
35
|
+
hello:
|
36
|
+
hallo :)
|
37
|
+
hey!
|
38
|
+
hi
|
39
|
+
yo
|
40
|
+
yow
|
41
|
+
joe
|
42
|
+
jowjowjow
|
43
|
+
hello_X:
|
44
|
+
hallo %s :)
|
45
|
+
%s: hallo
|
46
|
+
hey %s :)
|
47
|
+
%s: hi!
|
48
|
+
yo %s!
|
49
|
+
joe %s!
|
50
|
+
alles ok %s?
|
51
|
+
%s: alles goed?
|
52
|
+
welcome:
|
53
|
+
geen probleem
|
54
|
+
't is niks
|
55
|
+
altijd welkom
|
56
|
+
graag gedaan
|
57
|
+
np :)
|
58
|
+
thanks:
|
59
|
+
danku :)
|
60
|
+
bedankt!
|
61
|
+
thx :)
|
62
|
+
=D
|
63
|
+
je bent een schatje :)
|
64
|
+
thanks_X:
|
65
|
+
%s: danku :)
|
66
|
+
%s: bedankt!
|
67
|
+
%s: =D
|
68
|
+
%s: thx :)
|
69
|
+
%s: je bent een schatje :)
|
70
|
+
quit:
|
71
|
+
ok ik ben weg
|
72
|
+
yo
|
73
|
+
ciao
|
@@ -0,0 +1,75 @@
|
|
1
|
+
okay:
|
2
|
+
okay
|
3
|
+
okay then :)
|
4
|
+
okies!
|
5
|
+
fine
|
6
|
+
done
|
7
|
+
can do!
|
8
|
+
alright
|
9
|
+
sure
|
10
|
+
aight
|
11
|
+
lemme take care of that for you
|
12
|
+
dunno:
|
13
|
+
dunno
|
14
|
+
beats me
|
15
|
+
no idea
|
16
|
+
no clue
|
17
|
+
...eh?
|
18
|
+
*shrug*
|
19
|
+
don't ask me
|
20
|
+
who knows?
|
21
|
+
I can't do that Dave.
|
22
|
+
you best check yo'self!
|
23
|
+
dunno_about_X:
|
24
|
+
but I dunno anything about %s
|
25
|
+
I never heard of %s :(
|
26
|
+
%s? what's that then?
|
27
|
+
but what's %s?
|
28
|
+
insult:
|
29
|
+
%s: wanker!
|
30
|
+
%s: :(
|
31
|
+
%s: I hate you :(
|
32
|
+
%s: die!
|
33
|
+
%s: I'm offended!
|
34
|
+
%s: you hurt my feelings
|
35
|
+
hello:
|
36
|
+
hello :)
|
37
|
+
hola :)
|
38
|
+
salut
|
39
|
+
hey!
|
40
|
+
word.
|
41
|
+
hi
|
42
|
+
yo
|
43
|
+
'sup?
|
44
|
+
hello_X:
|
45
|
+
hello %s :)
|
46
|
+
%s: hey there
|
47
|
+
%s: hola :)
|
48
|
+
%s: salut
|
49
|
+
hey %s :)
|
50
|
+
%s: word
|
51
|
+
%s: hi!
|
52
|
+
yo %s!
|
53
|
+
%s: 'sup?
|
54
|
+
'sup %s?
|
55
|
+
welcome:
|
56
|
+
no probbie
|
57
|
+
you're welcome
|
58
|
+
de nada
|
59
|
+
any time
|
60
|
+
np :)
|
61
|
+
thanks:
|
62
|
+
thanks :)
|
63
|
+
schweet!
|
64
|
+
ta :)
|
65
|
+
=D
|
66
|
+
cheers!
|
67
|
+
thanks_X:
|
68
|
+
%s: thanks :)
|
69
|
+
%s: schweet!
|
70
|
+
%s: =D
|
71
|
+
%s: ta :)
|
72
|
+
%s: cheers
|
73
|
+
quit:
|
74
|
+
okay bye
|
75
|
+
seeya
|
@@ -0,0 +1,39 @@
|
|
1
|
+
okay:
|
2
|
+
d'accord
|
3
|
+
dunno:
|
4
|
+
de quoi est mort votre dernier esclave?
|
5
|
+
je vous aurais bien aide, mais je ne vous aime pas
|
6
|
+
faites-le vous-m�me
|
7
|
+
parle � mon cul, ma t�te est malade
|
8
|
+
je ne sais pas
|
9
|
+
je ne peut pas faire ca Dave.
|
10
|
+
dunno_about_X:
|
11
|
+
qu'est-ce c'est %s?
|
12
|
+
insult:
|
13
|
+
%s: putin!
|
14
|
+
%s: :(
|
15
|
+
%s: je te d�teste :(
|
16
|
+
%s: tu es completement debile
|
17
|
+
%s: mais t'as une t�te a faire sauter les plaques d'egouts!
|
18
|
+
%s: est-ce que vous �tes ivre?
|
19
|
+
hello:
|
20
|
+
bonjour
|
21
|
+
salut
|
22
|
+
bonsoir
|
23
|
+
hello_X:
|
24
|
+
bonjour %s :)
|
25
|
+
%s: salut
|
26
|
+
welcome:
|
27
|
+
de rien
|
28
|
+
aucun probleme
|
29
|
+
thanks:
|
30
|
+
merci :)
|
31
|
+
tu es trop gentil!
|
32
|
+
je vous remerci bien
|
33
|
+
thanks_X:
|
34
|
+
%s: merci :)
|
35
|
+
%s: tu es trop gentil!
|
36
|
+
%s: je vous remerci bien
|
37
|
+
quit:
|
38
|
+
d'accord, au revoir
|
39
|
+
a demain
|
@@ -0,0 +1,67 @@
|
|
1
|
+
okay:
|
2
|
+
okay
|
3
|
+
okay na dann :)
|
4
|
+
gut
|
5
|
+
gemacht
|
6
|
+
wird gemacht!
|
7
|
+
also los
|
8
|
+
sicher
|
9
|
+
klar
|
10
|
+
lass mich sorge tragen :-)
|
11
|
+
dunno:
|
12
|
+
kann nicht
|
13
|
+
schlag mich
|
14
|
+
habe keine Idee
|
15
|
+
habe keine Ahnung
|
16
|
+
*achselzuck*
|
17
|
+
frag mich nicht
|
18
|
+
wer weiss?
|
19
|
+
ich kann es nicht tun
|
20
|
+
am besten du schaust selber nach
|
21
|
+
dunno_about_X:
|
22
|
+
ich weiss nichts uber %s
|
23
|
+
was zum Teufel ist %s?
|
24
|
+
insult:
|
25
|
+
%s: Arsch!
|
26
|
+
%s: :(
|
27
|
+
%s: Ich hasse dich :(
|
28
|
+
%s: Stirb!
|
29
|
+
%s: Ich bin beleidigt!
|
30
|
+
hello:
|
31
|
+
hallo :)
|
32
|
+
hola :)
|
33
|
+
salut
|
34
|
+
hey!
|
35
|
+
sag nichts.
|
36
|
+
hi
|
37
|
+
yo
|
38
|
+
Was geht?
|
39
|
+
hello_X:
|
40
|
+
hallo %s :)
|
41
|
+
%s: guggus
|
42
|
+
%s: hola :)
|
43
|
+
%s: salut
|
44
|
+
hey %s :)
|
45
|
+
%s: sag nichts
|
46
|
+
%s: hi!
|
47
|
+
yo %s!
|
48
|
+
%s: Was geht?
|
49
|
+
Was geht %s?
|
50
|
+
welcome:
|
51
|
+
no probbie
|
52
|
+
you're welcome
|
53
|
+
de nada
|
54
|
+
any time
|
55
|
+
np :)
|
56
|
+
thanks:
|
57
|
+
Danke :)
|
58
|
+
juhu :)
|
59
|
+
:-D
|
60
|
+
Prost!
|
61
|
+
thanks_X:
|
62
|
+
%s: danke :)
|
63
|
+
%s: :-D
|
64
|
+
%s: juhu :)
|
65
|
+
%s: Prost
|
66
|
+
quit:
|
67
|
+
forkbomb rockt
|
@@ -0,0 +1,68 @@
|
|
1
|
+
class AutoOP < Plugin
|
2
|
+
@@handlers = {
|
3
|
+
"addop" => "handle_addop",
|
4
|
+
"rmop" => "handle_rmop",
|
5
|
+
"listop" => "handle_listop"
|
6
|
+
}
|
7
|
+
|
8
|
+
def help(plugin, topic="")
|
9
|
+
"perform autoop based on hostmask - usage: addop <hostmask>, rmop <hostmask>, listop"
|
10
|
+
end
|
11
|
+
|
12
|
+
def join(m)
|
13
|
+
if(!m.address?)
|
14
|
+
@registry.each { |mask,channels|
|
15
|
+
if(Irc.netmaskmatch(mask, m.source) && channels.include?(m.channel))
|
16
|
+
@bot.mode(m.channel, "+o", m.sourcenick)
|
17
|
+
end
|
18
|
+
}
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def privmsg(m)
|
23
|
+
if(m.private?)
|
24
|
+
if (!m.params || m.params == "list")
|
25
|
+
handle_listop(m)
|
26
|
+
elsif (m.params =~ /^add\s+(.+)$/)
|
27
|
+
handle_addop(m, $1)
|
28
|
+
elsif (m.params =~ /^rm\s+(.+)$/)
|
29
|
+
handle_rmop(m, $1)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def handle_addop(m, params)
|
35
|
+
ma = /^(.+?)(\s+(.+))?$/.match(params)
|
36
|
+
channels = ma[2] ? ma[2] : @bot.config['JOIN_CHANNELS']
|
37
|
+
if(ma[1] && channels)
|
38
|
+
@registry[ma[1]] = channels.split(/,\s*/).collect { |x|
|
39
|
+
x.strip
|
40
|
+
}
|
41
|
+
m.okay
|
42
|
+
else
|
43
|
+
m.reply @bot.lang.get('dunno')
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def handle_rmop(m, params)
|
48
|
+
if(!@registry.delete(params))
|
49
|
+
m.reply @bot.lang.get('dunno')
|
50
|
+
else
|
51
|
+
m.okay
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def handle_listop(m)
|
56
|
+
if(@registry.length)
|
57
|
+
@registry.each { |mask,channels|
|
58
|
+
m.reply "#{mask} in #{channels.join(', ')}"
|
59
|
+
}
|
60
|
+
else
|
61
|
+
m.reply "No entrys"
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
plugin = AutoOP.new
|
67
|
+
plugin.register("autoop")
|
68
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class AutoRejoinPlugin < Plugin
|
2
|
+
def help(plugin, topic="")
|
3
|
+
"performs an automatic rejoin if the bot is kicked from a channel"
|
4
|
+
end
|
5
|
+
def kick(m)
|
6
|
+
if m.address?
|
7
|
+
@bot.timer.add_once(10, m) {|m|
|
8
|
+
@bot.join m.channel
|
9
|
+
@bot.say m.channel, @bot.lang.get("insult") % m.sourcenick
|
10
|
+
}
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
plugin = AutoRejoinPlugin.new
|
16
|
+
plugin.register("autorejoin")
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class CalPlugin < Plugin
|
2
|
+
def help(plugin, topic="")
|
3
|
+
"cal [month year] => show current calendar [optionally specify month and year]"
|
4
|
+
end
|
5
|
+
def cal(m, params)
|
6
|
+
if params.has_key?(:month)
|
7
|
+
m.reply Utils.safe_exec("cal", params[:month], params[:year])
|
8
|
+
else
|
9
|
+
m.reply Utils.safe_exec("cal")
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
plugin = CalPlugin.new
|
14
|
+
plugin.map 'cal :month :year', :requirements => {:month => /^\d+$/, :year => /^\d+$/}
|
15
|
+
plugin.map 'cal'
|
@@ -0,0 +1,81 @@
|
|
1
|
+
##################
|
2
|
+
# Filename: dice.rb
|
3
|
+
# Description: Rbot plugin. Rolls rpg style dice
|
4
|
+
# Author: David Dorward (http://david.us-lot.org/ - you might find a more up to date version of this plugin there)
|
5
|
+
# Version: 0.3.2
|
6
|
+
# Date: Sat 6 Apr 2002
|
7
|
+
#
|
8
|
+
# You can get rbot from: http://www.linuxbrit.co.uk/rbot/
|
9
|
+
#
|
10
|
+
# Changelog
|
11
|
+
# 0.1 - Initial release
|
12
|
+
# 0.1.1 - bug fix, only 1 digit for number of dice sides on first roll
|
13
|
+
# 0.3.0 - Spelling correction on changelog 0.1.1
|
14
|
+
# - Return results of each roll
|
15
|
+
# 0.3.1 - Minor documentation update
|
16
|
+
# 0.3.2 - Bug fix, could not subtract numbers (String can't be coerced into Fixnum)
|
17
|
+
#
|
18
|
+
# TODO: Test! Test! Test!
|
19
|
+
# Comment!
|
20
|
+
# Fumble/Critical counter (1's and x's where x is sides on dice)
|
21
|
+
####################################################
|
22
|
+
|
23
|
+
class DiceDisplay
|
24
|
+
attr_reader :total, :view
|
25
|
+
def initialize(view, total)
|
26
|
+
@total = total
|
27
|
+
@view = view
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
class DicePlugin < Plugin
|
32
|
+
def help(plugin, topic="")
|
33
|
+
"dice <string> (where <string> is something like: d6 or 2d6 or 2d6+4 or 2d6+1d20 or 2d6+1d5+4d7-3d4-6) => Rolls that set of virtual dice"
|
34
|
+
end
|
35
|
+
|
36
|
+
def rolldice(d)
|
37
|
+
dice = d.split(/d/)
|
38
|
+
r = 0
|
39
|
+
unless dice[0] =~ /^[0-9]+/
|
40
|
+
dice[0] = 1
|
41
|
+
end
|
42
|
+
for i in 0...dice[0].to_i
|
43
|
+
r = r + rand(dice[1].to_i) + 1
|
44
|
+
end
|
45
|
+
return r
|
46
|
+
end
|
47
|
+
|
48
|
+
def iddice(d)
|
49
|
+
porm = d.slice!(0,1)
|
50
|
+
if d =~ /d/
|
51
|
+
r = rolldice(d)
|
52
|
+
else
|
53
|
+
r = d
|
54
|
+
end
|
55
|
+
if porm == "-"
|
56
|
+
r = 0 - r.to_i
|
57
|
+
end
|
58
|
+
viewer = DiceDisplay.new("[" + porm.to_s + d.to_s + "=" + r.to_s + "] ", r)
|
59
|
+
return viewer
|
60
|
+
end
|
61
|
+
|
62
|
+
def privmsg(m)
|
63
|
+
unless(m.params && m.params =~ /^[0-9]*d[0-9]+([+-]([0-9]+|[0-9]*d[0-9])+)*$/)
|
64
|
+
m.reply "incorrect usage: " + help(m.plugin)
|
65
|
+
return
|
66
|
+
end
|
67
|
+
a = m.params.scan(/^[0-9]*d[0-9]+|[+-][0-9]*d[0-9]+|[+-][0-9]+/)
|
68
|
+
r = rolldice(a[0])
|
69
|
+
t = "[" + a[0].to_s + "=" + r.to_s + "] "
|
70
|
+
for i in 1...a.length
|
71
|
+
tmp = iddice(a[i])
|
72
|
+
r = r + tmp.total.to_i
|
73
|
+
t = t + tmp.view.to_s
|
74
|
+
end
|
75
|
+
m.reply r.to_s + " | " + t
|
76
|
+
end
|
77
|
+
end
|
78
|
+
plugin = DicePlugin.new
|
79
|
+
plugin.register("dice")
|
80
|
+
##############################################
|
81
|
+
#fin
|