annotate plugins/xxsmiley.py @ 0:4385a7d0efd1 grumpy-goblin

Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
author sirebral
date Tue, 14 Jul 2009 16:41:58 -0500
parents
children c54768cffbd4
rev   line source
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1 import os
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2 import orpg.pluginhandler
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3 import orpg.dirpath
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
5 class Plugin(orpg.pluginhandler.PluginHandler):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
6 # Initialization subroutine.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
7 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
8 # !self : instance of self
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
9 # !chat : instance of the chat window to write to
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
10 def __init__(self, plugindb, parent):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
11 orpg.pluginhandler.PluginHandler.__init__(self, plugindb, parent)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
12
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
13 # The Following code should be edited to contain the proper information
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
14 self.name = 'Smilies!'
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
15 self.author = 'mDuo13'
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
16 self.help = "This plugin turns text smilies like >=) or :D into images. There are 15\n"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
17 self.help += "images. Also, you can type '/smiley' to get a list of what emoticons are\n"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
18 self.help += "converted to what images."
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
19
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
20 self.smileylist = {}
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
21
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
22 def plugin_enabled(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
23 #This is where you set any variables that need to be initalized when your plugin starts
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
24
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
25 self.plugin_addcommand('/smiley', self.on_smiley, '- [add|remove|help] The Smiley command')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
26
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
27 smlist = {
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
28 '>:-(' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley7.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
29 ':/' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley5.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
30 ':|' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley6.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
31 ':(' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley9.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
32 ' />:(' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley7.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
33 ' />=(' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley7.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
34 '=)' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley0.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
35 '=D' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley1.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
36 ';)' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley3.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
37 '=/' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley5.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
38 '=|' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley6.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
39 '=(' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley9.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
40 ':)' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley0.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
41 ':D' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley1.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
42 'B)' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley2.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
43 ':p' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley4.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
44 '=\\' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley5.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
45 ':P' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley4.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
46 '=P' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley4.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
47 '^_^' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley12.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
48 '^-^' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley12.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
49 '^.^' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley12.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
50 'n_n' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley12.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
51 'n.n' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley12.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
52 'n,n' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley12.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
53 'I-)' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley13.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
54 'n.n;' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley14.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
55 'n.n;;' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley14.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
56 'n_n;' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley14.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
57 ':-)' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley0.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
58 ':-D' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley1.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
59 ':-P' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley2.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
60 ':-p' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley4.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
61 ':-/' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley5.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
62 ':-|' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley6.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
63 ':-(' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley9.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
64 ':-\\' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley5.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
65 '-)' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_smile.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
66 ';-)' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_wink.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
67 ':->' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_smile2.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
68 ':-D' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_biggrin.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
69 ':-P' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_razz.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
70 ':-o' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_surprised.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
71 ':mrgreen:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_mrgreen.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
72 ':lol:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_lol.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
73 ':-(' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_sad.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
74 ':-|' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_neutral.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
75 ':-?' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_confused.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
76 ':-x' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_mad.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
77 ':shock:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_eek.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
78 ':cry:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_cry.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
79 ';_;' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_cry.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
80 ':oops:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_redface.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
81 '8-)' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_cool.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
82 ':evil:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_evil.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
83 ':twisted:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_twisted.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
84 ':roll:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_rolleyes.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
85 ':!:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_exclaim.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
86 ':?:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_question.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
87 ':idea:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_idea.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
88 ':arrow:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_arrow.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
89 ':ubergeek:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_e_ugeek.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
90 ':geek:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_e_geek.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
91 ':fairy:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/fairy.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
92 ':hood:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/hood.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
93 ':gnome:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/gnome.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
94 ':link:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/link.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
95 ':mummy:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/mummy.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
96 ':ogre:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/ogre.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
97 ':medusa:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/medusa.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
98 ':mimic:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/mimic.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
99 ':skull:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/skull.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
100 ':zombie:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/zombie.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
101 ':chocobo:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/chocobo.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
102 ':darkside:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/darkside.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
103 ':flyingspaghetti:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/flyingspaghetti.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
104 ':rupee:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/rupee.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
105 ':ros:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/ros.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
106 ':skeleton:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/skeleton.gif" /> ',
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
107 ':samurai:' : ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/samurai.gif" /> '}
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
108
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
109 self.smileylist = self.plugindb.GetDict("xxsmiley", "smileylist", smlist)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
110
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
111 def plugin_disabled(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
112 #Here you need to remove any commands you added, and anything else you want to happen when you disable the plugin
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
113 #such as closing windows created by the plugin
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
114
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
115 self.plugin_removecmd('/smiley')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
116 self.plugindb.SetDict("xxsmiley", "smileylist", self.smileylist)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
117
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
118 def on_smiley(self, cmdargs):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
119 #this is just an example function for a command you create create your own
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
120 if not len(cmdargs):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
121 self.chat.InfoPost("Available Smilies:")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
122 the_list = ' <table border="1">'
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
123 for key in self.smileylist.keys():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
124 the_list += ' <tr><td>' + key + ' </td><td>' + self.smileylist[key] + ' </td></tr>'
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
125 the_list += "</table>"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
126 self.chat.InfoPost(the_list)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
127 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
128
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
129 args = cmdargs.split(None, -1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
130
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
131 if args[0] == 'add' and len(args) == 3:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
132 if args[2].find('http') > -1:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
133 self.smileylist[args[1]] = ' <img src="' + args[2] + '" alt="' + args[1] + '" />'
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
134 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
135 self.smileylist[args[1]] = ' <img src="' + orpg.dirpath.dir_struct["plugins"] + 'images/' + args[2] + '" />' + "\n"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
136
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
137 self.chat.InfoPost('Added ' + args[1] + '&nbsp&nbsp&nbsp : &nbsp&nbsp&nbsp' + self.smileylist[args[1]])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
138
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
139 elif args[0] == 'remove' and len(args) == 2:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
140 if self.smileylist.has_key(args[1]):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
141 del self.smileylist[args[1]]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
142 self.chat.InfoPost('Removed ' + args[1])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
143 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
144 self.chat.InfoPost(args[1] + ' was not a smiley!')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
145
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
146 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
147 self.chat.InfoPost('/smiley - Lists all avaliable smilies')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
148 self.chat.InfoPost('/smiley add {smiley} {imagefile} - Add a smily to the list. The {smiley} can be any string of text that does not contain a space. The {imagefile} should be an image in the openrpg/plugins/images directory')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
149 self.chat.InfoPost('/smiley remove {smiley} - Remove {smiley} from the list')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
150
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
151 self.plugindb.SetDict("xxsmiley", "smileylist", self.smileylist)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
152
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
153 def doSmiley(self, text):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
154 for key, value in self.smileylist.iteritems():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
155 text = text.replace(key, value)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
156
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
157 return text
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
158
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
159 def plugin_incoming_msg(self, text, type, name, player):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
160 text = self.doSmiley(text)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
161
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
162 return text, type, name
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
163
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
164 def post_msg(self, text, myself):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
165 if myself:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
166 text = self.doSmiley(text)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
167
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
168 return text