b3nw avatar b3nw committed bd76cc1

Initial Rev

Comments (0)

Files changed (1)

+__module_name__ = "@wallops" 
+__module_version__ = "1.0.1"
+__module_description__ = "Collects WallOps and Other Server Messages into 1 Window"
+__module_author__ = "Ben W. <ben@rizon.net>"
+
+import xchat
+
+def on_wallop(word, word_eol, userdata):
+	if xchat.find_context(channel='@wallops') is None:
+		xchat.command('QUERY @wallops')
+	wallops = xchat.find_context(channel='@wallops')
+	nick = word[0].split("!")
+	#print in @wallops
+	wallops.prnt("\00313-%s-\017 %s" % (nick[0].strip(":"), word_eol[4]))
+	return xchat.EAT_ALL
+
+def on_notice(word, word_eol, userdata):
+	if xchat.find_context(channel='@notices') is None:	
+		xchat.command('QUERY @notices')
+	notice = xchat.find_context(channel='@notices')
+	nick = word[0].strip(":").split("!")
+	#print in both the active window and the @notice window unless its a server notice...
+	if(nick[0] != xchat.get_info("server")):
+		xchat.prnt("\00313-%s-\017 %s" % (nick[0], word_eol[3].strip(":")))
+        notice.prnt("\00313-%s-\017 %s" % (nick[0], word_eol[3].strip(":")))
+	return xchat.EAT_ALL
+
+def on_snotice(word, word_eol, userdata):
+        if xchat.find_context(channel='@snotices') is None:
+                xchat.command('QUERY @snotices')
+        notice = xchat.find_context(channel='@snotices')
+        nick = word[0].strip(":").split("!")
+        #print in both the active window and the @notice window unless its a server notice...
+        if(nick[0] != xchat.get_info("server")):
+                xchat.prnt("\00313-%s-\017 %s" % (nick[0], word_eol[3].strip(":")))
+        notice.prnt("\00313-%s-\017 %s" % (nick[0], word_eol[3].strip(":")))
+        return xchat.EAT_ALL
+
+
+
+def on_unload(userdata):
+	print "Unloading Wallops Script...."
+
+xchat.hook_server("WALLOPS", on_wallop)
+xchat.hook_print("Receive Wallops", on_wallop)
+xchat.hook_print("NOTICE", on_notice)
+xchat.hook_server("NOTICE", on_snotice)
+xchat.hook_unload(on_unload)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.