All pastes #287070 Raw Edit

Wolfman2000

public python v1 · immutable
#287070 ·published 2006-12-21 03:29 UTC
rendered paste body
import xchatfrom hazards import botvgh_hazhelper__module_name__ = "BOTVGH Arena Helper Tools"__module_version__ = "1.0"__module_description__ = "Various scripts to help manage hazards."# Use xchat.command("say " + stuff) to have all see it.# Use \x03 to pass color combinations.# Use \x02 for bolding.# Use \x1F for underlining.if __name__ == "__main__":	HazH = botvgh_hazhelper.HazardHelper()	xchat.hook_command("haz", HazH.HazRoll, \							 help="/haz getset [<set>] to get the random set.  "\							+"/haz <set> [<number>] to get the hazard itself.")##############################################################################################################import xchatimport randomimport hazard_masterlistimport hazard_spaceballsimport hazard_simpsons__module_name__ = "BOTVGH Arena Hazard Helper"__module_version__ = "1.0"__module_description__ = "The scripts that make hazards go off."hazSet = []hazSet.append("\x02Ref's Choice\x02!  He can use whatever is available, "\				+ "plus whatever is not! (no command)")hazSet.append("\x02Spaceballs\x02!  Mel Brooks' gold mine of a comedy "\				+ "should have some laughs for everyone.  May the schwartz "\				+ "be with you! (/haz spaceballs)")hazSet.append("\x02Simpsons\x02!  16 years young, and still going strong.  "\				+ "Don't have a cow with what's inside here! (/haz simpsons)")hazSet.append("\x02Master List\x02!  Just put everything together and have "\				+ "fun with it...heh heh heh.  (/haz master)")class HazardHelper(object):	"""The various methods for calling Hazards are done here."""	def getHazardSet(self, seed = -1):		if seed == -1:			seed = random.randint(1,len(hazSet))		return hazSet[seed - 1]	def HazRoll(self, word, word_eol, userdata):		"""		HazRoll is called every time a random (or rigged) script		is required.  Follow the commands as listed.		"""		# /haz getset [<setNumber>]		SetSpeak = "say The hazard set of the day is: "		if len(word) == 2 and word[1] == "getset":			xchat.command(SetSpeak + self.getHazardSet())		elif len(word) == 3 and word[1] == "getset":			xchat.command(SetSpeak + self.getHazardSet(int(word[2])))		# /haz spaceballs [<number>]		elif len(word) == 2 and word[1] == "spaceballs":			xchat.command("say %s" % hazard_spaceballs.getHazard())		elif len(word) == 3 and word[1] == "spaceballs":			xchat.command("say %s" % hazard_spaceballs.getHazard(int(word[2])))		# /haz simpsons [<number>]		elif len(word) == 2 and word[1] == "simpsons":			xchat.command("say %s" % hazard_simpsons.getHazard())		elif len(word) == 3 and word[1] == "simpsons":			xchat.command("say %s" % hazard_simpsons.getHazard(int(word[2])))		# /haz master [<number>]		elif len(word) == 2 and word[1] == "master":			xchat.command("say %s" % hazard_masterlist.getHazard())		elif len(word) == 3 and word[1] == "master":			xchat.command("say %s" % hazard_masterlist.getHazard(int(word[2])))		# Umm...you goofed.		else:			xchat.command("say \x02ERROR!\x02  Check your roll commands.")		return xchat.EAT_ALL