Skip to content
Python module for Eggdrop
C
Branch: master
Clone or download
Latest commit c632315 Apr 21, 2012
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore add gitignore file Apr 5, 2011
LICENSE add LICENSE Apr 9, 2011
Makefile small cleanup Apr 9, 2011
README.md Update README.md Apr 21, 2012
api.c small cleanup Apr 9, 2011
api.h made buildable inside source tree Apr 9, 2011
khash.h added hash tables for tracking mods and callbacks Apr 7, 2011
modinfo made buildable inside source tree Apr 9, 2011
pymod.c small cleanup Apr 9, 2011
pymod.h move callback table, more bind scaffold Apr 8, 2011

README.md

python.mod

    NOTE: This project has gone largely unmaintained since 2011. I ran into
          event model issues I had ideas about fixing, but frankly this
          project just isn't a priority right now.
          
          Feel free to fork and adapt as you see fit, but be aware that the
          module is mostly non-functional.

Tcl is awful. Seriously, awful. This module allows you to write Eggdrop scripts in Python instead.

This module is still very young, immature, and untested. Still, beats writing Tcl.

Installation

  1. Extract the python.mod directory into your Eggdrop source tree under src/mod
  2. Edit src/mod/python.mod/Makefile to point to the proper include/lib paths for Python
  3. From the root of the source tree, run make iconfig and enable the module
  4. Build using make and/or make install
  5. In eggdrop.conf use loadmodule python to enable the loadpython directive
  6. Use loadpython to load and instantiate Python modules

Example Usage

in eggdrop.conf

loadmodule python      # load python.mod
set python-isolate 1   # use interpreter isolation? (0/1)
loadpython splat       # load splat.py

in splat.py

import eggdrop

def ctcp_splat(nick, mask, handle, dest, keyword, text):
    eggdrop.putlog("Got splat'd by %s (%s)!" % (nick, mask))
    eggdrop.putserv("PRIVMSG %s :it's not nice to throw things" % nick)

eggdrop.bind('ctcp', '-', 'splat', ctcp_splat)
eggdrop.putlog("*** splat module loaded")
You can’t perform that action at this time.