With the help of Kulver's index-of and his examples of XChat plug-ins I came up with my own. It is pretty simple and does make my life easier since I have 2 nicks for away and active.
You can find a breif explanation on my
blog.
Anyways here's le plugin:
import xchat
__module_name__ = "PyAway"
__module_version__ = "1.0"
__module_description__ = "Changes nick to away, and identifys with the nickserv"
awaynick = "techb_away"
backnick = "techb"
passwrd = "letmein"
def toggleAway(words, words_eol, userdata):
if xchat.get_info("nick") == backnick:
xchat.command("nick %s" % awaynick)
xchat.command("msg nickserv identify %s" % passwrd)
elif xchat.get_info("nick") == awaynick:
xchat.command("nick %s" % backnick)
xchat.command("msg nickserv identify %s" % passwrd)
return xchat.EAT_ALL
xchat.hook_command("away_", toggleAway)
print "Loaded away.py \nUse /away_ to toggle."
The only thing that's not on my blog is the xchat.EAT_ALL. This is to let xchat know not to regard the new command. Else, in the server window, it will show "away_ is an unknown command".
Place in the .xchat2 dir, located in /home/.xchat in linux, and use /py load away.py to load. Anytime you restart it will load automagically. If you don't see .xchat2 in home, hit ctrl+h to see hidden files. Windows users, sorry I don't use windows, but I would imagine its in C:\xchat2\ or C:\[user]\xchat2 or something.