rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
QMAKESEARCHPATH = [ os.path.join(os.path.join(os.environ["QTDIR"], "bin"), QMAKE_EXECUTABLE) ] | QMAKESEARCHPATH = [ os.path.join(os.path.join(qt_dir, "bin"), QMAKE_EXECUTABLE) ] | def checkQt(): sys.stdout.write("Checking QT Configuration:\n") if sys.platform == "win32": QMAKE_EXECUTABLE = "qmake.exe" else: QMAKE_EXECUTABLE = "qmake" sys.stdout.write( " Checking QTDIR enviroment variable: " ) if ( os.environ.has_key("QTDIR") and os.path.exists( os.environ["QTDIR"] ) ): sys.stdout.write( gree... |
checkQt() | checkQt (options) | def main(): # Options for qmake DEFINES = "" CONFIG = "" # Setup command line parser parser = OptionParser(version="%prog 0.4") parser.add_option("--dsp", action="store_true", dest="dsp", help="also Generate Visual Studio project files") parser.add_option("--nocolor", action="store_true", dest="nocolor", help="disable ... |
sys.stdout.write("Checking MySQL Configuration:\n") | sys.stdout.write(green("Enabled") + "\n") | def main(): # Options for qmake DEFINES = "" CONFIG = "" # Setup command line parser parser = OptionParser(version="%prog 0.4") parser.add_option("--dsp", action="store_true", dest="dsp", help="also Generate Visual Studio project files") parser.add_option("--nocolor", action="store_true", dest="nocolor", help="disable ... |
sys.stdout.write("Enabled\n") else: sys.stdout.write("Disabled\n") | def main(): # Options for qmake DEFINES = "" CONFIG = "" # Setup command line parser parser = OptionParser(version="%prog 0.4") parser.add_option("--dsp", action="store_true", dest="dsp", help="also Generate Visual Studio project files") parser.add_option("--nocolor", action="store_true", dest="nocolor", help="disable ... | |
sys.stdout.write("Generating makefile... ") | sys.stdout.write("\nGenerating makefile... ") | def main(): # Options for qmake DEFINES = "" CONFIG = "" # Setup command line parser parser = OptionParser(version="%prog 0.4") parser.add_option("--dsp", action="store_true", dest="dsp", help="also Generate Visual Studio project files") parser.add_option("--nocolor", action="store_true", dest="nocolor", help="disable ... |
try: args = args.split( ' ' ) if len( args ) >= 5: return False if len( args ) == 1: action = args[0] action = action.lower() if action == 'reload': char.log( LOG_MESSAGE, "Reloaded accounts.\n" % char.serial ) wolfpack.accounts.reload() return True elif action == 'save': char.log( LOG_MESSAGE, "Saved accounts.\n" ... | args = args.split( ' ' ) if len( args ) >= 5: useageerror( socket ) return False if len( args ) == 1: action = args[0] action = action.lower() if action == 'reload': char.log( LOG_MESSAGE, "Reloaded accounts.\n" % char.serial ) wolfpack.accounts.reload() return True elif action == 'save': char.log( LOG_MESSAGE, "Sa... | def commandAccount( socket, cmd, args ): char = socket.player args = args.strip() if len(args) == 0: socket.sysmessage( usage0 ) socket.sysmessage( usage1 ) socket.sysmessage( usage2 ) socket.sysmessage( usage3 ) socket.sysmessage( usage4 ) return False elif len( args ) > 0: # Command with arguments try: args = args.sp... |
minskill = (1.0 - chance) * 1200 | minskill = min(char.skill[skill], (1.0 - chance) * 1200) | def checkskill(char, skill, chance): # Normalize chance = min(1.0, max(0.02, chance)) minskill = (1.0 - chance) * 1200 maxskill = 1200 char.checkskill(skill, minskill, maxskill) return chance >= random.random() |
if not item.getoutchar() == char: | if not item.getoutmostchar() == char: | def onUse( char, item ): if not item.getoutchar() == char: char.socket.clilocmessage( 1042001 ) # That must be in your pack for you to use it. return True if not actions.has_key( item.baseid ): menu = findmenu('COOKING') if menu: menu.send(char, [item.serial]) return True # simply open the sack if item.baseid in ["10... |
return True if not actions.has_key( item.baseid ): menu = findmenu('COOKING') if menu: menu.send(char, [item.serial]) | def onUse( char, item ): if not item.getoutchar() == char: char.socket.clilocmessage( 1042001 ) # That must be in your pack for you to use it. return True if not actions.has_key( item.baseid ): menu = findmenu('COOKING') if menu: menu.send(char, [item.serial]) return True # simply open the sack if item.baseid in ["10... | |
return | return True if not actions.has_key( item.baseid ): menu = findmenu('COOKING') if menu: menu.send(char, [item.serial]) return True | def onUse( char, item ): if not item.getoutchar() == char: char.socket.clilocmessage( 1042001 ) # That must be in your pack for you to use it. return True if not actions.has_key( item.baseid ): menu = findmenu('COOKING') if menu: menu.send(char, [item.serial]) return True # simply open the sack if item.baseid in ["10... |
return | def Dough( char, args, target ): dough = wolfpack.finditem( args[0] ) if not dough or not target.item: return False backpack = char.getbackpack() if not target.item.getoutmostchar() == char: char.socket.clilocmessage( 1042001 ) # That must be in your pack for you to use it. return True # Eggs if target.item.baseid ==... | |
player.mana = player.mana - self.mana | def make(self, player, args, nodelay=0): if not checktool(player, wolfpack.finditem(args[0]), 0): return False # spell scrolls # FIXME : spell no. is not correct if self.titleid > 1027980 and self.titleid < 1028045: if self.titleid == 1027981: self.spell = 6 elif self.titleid > 1027988: self.spell = self.titleid - 1027... | |
elif player.checkskill(TAILORING, 0, 1000): | elif player.checkskill(BOWCRAFT, 0, 1000): | def repair(self, player, arguments, target): if not checktool(player, wolfpack.finditem(arguments[0])): return |
if len(arguments) > 0: if wolfpack.getdefinition(WPDT_ITEM, arguments): socket.sysmessage("Where do you want to place the item '%s'?" % arguments) socket.attachtarget("commands.add.additem", [arguments]) elif wolfpack.getdefinition(WPDT_NPC, arguments): socket.sysmessage("Where do you want to spawn the npc '%s'?" % arg... | if len(arguments) > 0: if wolfpack.getdefinition(WPDT_ITEM, arguments): socket.sysmessage("Where do you want to place the item '%s'?" % arguments) socket.attachtarget("commands.add.additem", [arguments]) elif wolfpack.getdefinition(WPDT_NPC, arguments): socket.sysmessage("Where do you want to spawn the npc '%s'?" % arg... | def add(socket, command, arguments): if len(arguments) > 0: if wolfpack.getdefinition(WPDT_ITEM, arguments): socket.sysmessage("Where do you want to place the item '%s'?" % arguments) socket.attachtarget("commands.add.additem", [arguments]) elif wolfpack.getdefinition(WPDT_NPC, arguments): socket.sysmessage("Where do y... |
generateAddMenu() wolfpack.registercommand('add', add) | wolfpack.registercommand('add', add) | def onLoad(): generateAddMenu() wolfpack.registercommand('add', add) |
socket.sendpacket( trade ) | trade.send( socket ) | def sendtradepacket( socket, action, partnerserial, box1serial, box2serial, playername ): #Sending 0x6F packet. Length may vary when playername is defined packetlength = 0x10 trade = wolfpack.packet( 0x6F, packetlength ) if playername != "": packetlength += len( playername ) + 2 trade.resize( packetlength ) trade.setb... |
char.stealthedsteps = 5 | char.stealthedsteps = int(ceil(char.skill[STEALTH] / 50.0)) | def stealth( char, skill ): if char.socket.hastag( 'skill_delay' ): cur_time = servertime() if cur_time < char.socket.gettag( 'skill_delay' ): char.socket.clilocmessage( 500118, "", 0x3b2, 3 ) return 1 else: char.socket.deltag( 'skill_delay' ) # use hiding first if not char.hidden: char.socket.clilocmessage( 502725, "... |
self.allowrepair = 1 self.submaterial3missing = 1060884 self.submaterial2missing = 1060884 self.submaterial1missing = 1044037 self.submaterial1noskill = 1044268 | self.allowrepair = 0 self.allowenhance = 0 self.allowsmelt = 0 self.submaterial3 = METALS self.submaterial4 = CLOTH self.submaterial1missing = 1041524 self.submaterial2missing = 1042598 self.submaterial3missing = 1042081 self.submaterial4missing = 1042081 self.submaterial1noskill = 500586 | def __init__(self, id, parent, title): MakeMenu.__init__(self, id, parent, title) self.allowmark = 1 self.allowrepair = 1 #self.allowenhance = 1 #self.allowsmelt = 1 self.submaterial3missing = 1060884 self.submaterial2missing = 1060884 self.submaterial1missing = 1044037 self.submaterial1noskill = 1044268 self.gumptype ... |
action.submaterial2 = hex2dec(subchild.getattribute('amount', '0')) | action.submaterial3 = hex2dec(subchild.getattribute('amount', '0')) | itemdef = child.getattribute('definition') |
action.submaterial3 = hex2dec(subchild.getattribute('amount', '0')) | action.submaterial4 = hex2dec(subchild.getattribute('amount', '0')) | itemdef = child.getattribute('definition') |
try: penalty = hex2dec(subchild.getattribute('penalty','0')) except: console.log(LOG_ERROR, "%s element with invalid max value in menu %s.\n" % (subchild.name, menu.id)) action.skills[skill] = [minimum, maximum, penalty] | action.skills[skill] = [minimum, maximum] | itemdef = child.getattribute('definition') |
if not char.canreach( target.char, 4 ): char.socket.clilocmessage( 0x7A27F, "", 0x3b2, 3 ) return False | if target.char: if not char.canreach( target.char, 4 ): char.socket.clilocmessage( 0x7A27F, "", 0x3b2, 3 ) return False | def response( char, args, target ): if skills.skilltable[ ARMSLORE ][ skills.UNHIDE ] and char.hidden: char.removefromview() char.hidden = False char.update() backpack = char.getbackpack() item = target.item if item: if not item.getoutmostchar() == char: top = item.getoutmostitem() if top.container and top.container... |
if not player.cansee(target.pos, 1): | if not player.canreach(target.pos, 3): | def response(player, args, target): if player.guild: player.socket.sysmessage('You have to leave your guild before founding a new one.') return deed = wolfpack.finditem(args[0]) if deed: if deed.getoutmostchar() != player: player.socket.clilocmessage(500364) elif not player.cansee(deed) or not player.canpickup(deed):... |
elif target.pos.distance(player.pos) > 3: player.socket.clilocmessage(500251) | def response(player, args, target): if player.guild: player.socket.sysmessage('You have to leave your guild before founding a new one.') return deed = wolfpack.finditem(args[0]) if deed: if deed.getoutmostchar() != player: player.socket.clilocmessage(500364) elif not player.cansee(deed) or not player.canpickup(deed):... | |
overview += '<td>-& else: overview += "<td> </td>\n"; | overview += '<td width="15%%">-& else: overview += "<td width=\"15%\"> </td>\n"; | def propertycmp(a, b): return cmp(a['property'], b['property']) |
x = 0 y = 0 z = 0 | def parseWsc( file, map ): warnings = '' count = 0 while 1: line = file.readline() if not line: break # Replace \r and \n's line = line.replace( "\r", "" ) line = line.replace( "\n", "" ) # SECTION WORLDITEM : 17 byte if line[:17] == 'SECTION WORLDITEM': item = {} while 1: line = file.readline() if not line or le... | |
else: z = 0 | def parseWsc( file, map ): warnings = '' count = 0 while 1: line = file.readline() if not line: break # Replace \r and \n's line = line.replace( "\r", "" ) line = line.replace( "\n", "" ) # SECTION WORLDITEM : 17 byte if line[:17] == 'SECTION WORLDITEM': item = {} while 1: line = file.readline() if not line or le... | |
newitem.moveto( x, y, z, map ) | newposition = "%i,%i,%i,%i" % (x, y, z, map) newitem.pos = newposition | def parseWsc( file, map ): warnings = '' count = 0 while 1: line = file.readline() if not line: break # Replace \r and \n's line = line.replace( "\r", "" ) line = line.replace( "\n", "" ) # SECTION WORLDITEM : 17 byte if line[:17] == 'SECTION WORLDITEM': item = {} while 1: line = file.readline() if not line or le... |
item.container = backpack amount -= min( [ amount, 65535 ] ) | amount -= item.amount if not wolfpack.utilities.tocontainer(item, backpack): item.update() | def onSpeech( listener, speaker, text, keywords ): for keyword in keywords: # withdraw if keyword == 0x0: # Search for the amount we want to withdraw (should be the only digits in there) result = amountre.search( text ) amount = 0 if result: amount = int( result.group( 1 ) ) # Invalid Withdraw Amount if not amount: #... |
self.definition = definition | self.definition = str(definition) | def __init__(self, parent, title, itemid, definition, amount = 1): MakeAction.__init__(self, parent, title) self.itemid = itemid self.definition = definition self.amount = amount self.otherhtml = '' self.materialshtml = '' self.skillshtml = '' self.hasdetails = 1 |
if char.player and char.controlslots + 2 > 5: | if char.player and char.controlslots + 1 > 5: | def cast(self, char, mode, args=[], target=None, item=None): if char.player and char.controlslots + 2 > 5: if char.socket: char.socket.clilocmessage(1049645) return return Spell.cast(self, char, mode) |
if char.player and char.controlslots + 2 > 5: | if char.player and char.controlslots + 1 > 5: | def target(self, char, mode, targettype, target, args, item): char.turnto(target) |
creature.tamed = 1 creature.addevent('speech.pets') creature.controlslots = 2 creature.owner = char creature.summontime = wolfpack.time.servertime() + int(char.skill[MAGERY] * 400) creature.summoned = 1 creature.ai = "Animal_Domestic" creature.soundeffect(0x215) | if creature.controlslots + char.controlslots > 5: creature.delete() char.socket.clilocmessage(1049645) else: creature.tamed = 1 creature.addevent('speech.pets') creature.owner = char creature.summontime = wolfpack.time.servertime() + int(char.skill[MAGERY] * 400) creature.summoned = 1 creature.ai = "Animal_Domestic" cr... | def target(self, char, mode, targettype, target, args, item): char.turnto(target) |
socket.clilocmessage( 500235, '', GRAY ) | socket.clilocmessage( 500235 ) | def healPotion( char, potion, healtype ): socket = char.socket if not canUsePotion( char, potion ): return False if char.poison > -1: # You can not heal yourself in your current state. socket.clilocmessage(1005000) return False if char.hitpoints >= char.maxhitpoints: socket.clilocmessage(1049547) if char.hitpoints > c... |
socket.sysmessage( 'You have had ' + str( amount ) + ' hit points of damage healed.', GRAY ) | socket.sysmessage( 'You have had ' + str( amount ) + ' hit points of damage healed.' ) | def healPotion( char, potion, healtype ): socket = char.socket if not canUsePotion( char, potion ): return False if char.poison > -1: # You can not heal yourself in your current state. socket.clilocmessage(1005000) return False if char.hitpoints >= char.maxhitpoints: socket.clilocmessage(1049547) if char.hitpoints > c... |
char.log(LOG_MESSAGE, "Casting spell %u (%s) from %s.\n" % (self.spellid, self.__class__.__name__, source)) | if type(self.spellid) == int: char.log(LOG_MESSAGE, "Casting spell %u (%s) from %s.\n" % (self.spellid, self.__class__.__name__, source)) else: char.log(LOG_MESSAGE, "Casting spell %s from %s.\n" % (self.__class__.__name__, source)) | def precast(self, char, mode=0, args=[], target = None, item = None): socket = char.socket # Casting from a scroll and no scroll was passed if mode == MODE_SCROLL and not item: return # Casting from a wand and no wand was passed if mode == MODE_WAND and not item: return |
pos = player.pos pos.x = target[0] pos.y = target[1] pos.z = target[2] if len(target) > 3: pos.map = target[3] | try: m = target[3] except: m = player.pos.map pos = wolfpack.coord( target[0], target[1], target[2], m ) | def onCollide(player, item): if item.hastag('playersonly') and player.npc: return False if not item.hastag('target'): if player.socket: player.socket.sysmessage( tr('This gate leads nowhere...') ) else: console.log(LOG_ERROR, tr("NPC [%x] using gate [%x] without target.\n") % (player.serial, item.serial)) return False... |
if not utilities.isMapAvailableTo(player, pos.map): | if not utilities.isValidPosition( pos ): player.socket.sysmessage( tr('This gate leads nowhere...') ) return False if not utilities.isMapAvailableTo( player, pos.map ): | def onCollide(player, item): if item.hastag('playersonly') and player.npc: return False if not item.hastag('target'): if player.socket: player.socket.sysmessage( tr('This gate leads nowhere...') ) else: console.log(LOG_ERROR, tr("NPC [%x] using gate [%x] without target.\n") % (player.serial, item.serial)) return False... |
follower.update(0) | follower.update() | def onCollide(player, item): if item.hastag('playersonly') and player.npc: return False if not item.hastag('target'): if player.socket: player.socket.sysmessage( tr('This gate leads nowhere...') ) else: console.log(LOG_ERROR, tr("NPC [%x] using gate [%x] without target.\n") % (player.serial, item.serial)) return False... |
player.update(0) | player.update() | def onCollide(player, item): if item.hastag('playersonly') and player.npc: return False if not item.hastag('target'): if player.socket: player.socket.sysmessage( tr('This gate leads nowhere...') ) else: console.log(LOG_ERROR, tr("NPC [%x] using gate [%x] without target.\n") % (player.serial, item.serial)) return False... |
if lowerreagentcost == 0 or lowerreagentcost > random.randint(0, 99): | if lowerreagentcost == 0 or lowerreagentcost < random.randint(0, 99): | def consumerequirements(self, char, mode, args=[], target=None, item=None): if char.gm: return True |
npc.say('CHECKING SLAYING: ' + str(self.npcs)) | def slays(self, npc): npc.say('CHECKING SLAYING: ' + str(self.npcs)) if not npc.hasstrproperty('slayer_group'): return False | |
chance = ( (player.skill[CARPENTRY] - minskill) / (maxskill - minskill) ) / 5.0 | if minskill == maxskill or maxskill == 0: maxskill += 1 chance = ( (player.skill[CARPENTRY]) / (maxskill) ) / 5.0 | def getexceptionalchance(self, player, arguments): # Only works if this item requires carpentry if not self.skills.has_key(CARPENTRY): return False |
if not found: | if not found or found.rank > socket.player.rank: | def goname(socket, command, arguments): if len(arguments) == 0: socket.sysmessage('Usage: goname <name>') return chars = wolfpack.chariterator() char = chars.first found = None name = hash(arguments.lower()) while char: if hash(char.name.lower()) == name: found = char break char = chars.next if not found: socket.s... |
if char: | if char and char.rank <= socket.player.rank: | def gouid(socket, command, arguments): try: uid = hex2dec(arguments) except: socket.symsessage('Usage: gouid <serial>') return if uid > 0x40000000: item = wolfpack.finditem(uid) if item: container = item.getoutmostitem() if container.container: container = container.container # Going to container socket.sysmessage('... |
char.socket.clilocmessage(500295) | char.socket.clilocmessage(500294) | def onUse( char, item ): # Bandages have to be in backpack if item.getoutmostchar() != char: char.socket.clilocmessage(500295) return 1 # Already Bandaging ?? if char.socket.hastag( 'using_bandages' ): char.socket.sysmessage( 'You are already using bandages.' ) return 1 # Display Target if item.id == 0xe21 or item.id... |
char.socket.sysmessage("You can't reach that.") | char.socket.clilocmessage(500312) | def wash_response( char, args, target ): bandages = wolfpack.finditem( args[0] ) if not bandages: return if (target.item and target.item.getoutmostchar() and target.item.getoutmostchar() != char) or not char.canreach(target.pos, 5): char.socket.sysmessage("You can't reach that.") return # Did we target something wet... |
char.socket.clilocmessage(500313) | char.socket.clilocmessage(500312) | def validCorpseTarget( char, target ): if not target: return 0 if not char.gm and not char.canreach( target, 2 ): char.socket.clilocmessage(500313) return 0 if target.id != 0x2006: char.socket.clilocmessage(500971) return 0 # Check Owner if not target.owner or not target.owner.dead: char.socket.clilocmessage(500971)... |
char.socket.clilocmessage(500971) | char.socket.clilocmessage(500970) | def validCorpseTarget( char, target ): if not target: return 0 if not char.gm and not char.canreach( target, 2 ): char.socket.clilocmessage(500313) return 0 if target.id != 0x2006: char.socket.clilocmessage(500971) return 0 # Check Owner if not target.owner or not target.owner.dead: char.socket.clilocmessage(500971)... |
if not target.poison and target.health >= target.maxhitpoints: | if not target.poison > -1 and target.health >= target.maxhitpoints: | def validCharTarget( char, target ): # Do we have a valid target if not target: char.socket.sysmessage( 'You have to target a living thing.' ) return 0 if not char.canreach( target, 2 ): char.socket.sysmessage( 'You are too far away to apply bandages on %s' % target.name ) return 0 # Already at full health if not tar... |
char.socket.clilocmessage(1061289) else: char.socket.clilocmessage(500956) | char.socket.clilocmessage(1061288) else: char.socket.clilocmessage(500955) | def validCharTarget( char, target ): # Do we have a valid target if not target: char.socket.sysmessage( 'You have to target a living thing.' ) return 0 if not char.canreach( target, 2 ): char.socket.sysmessage( 'You are too far away to apply bandages on %s' % target.name ) return 0 # Already at full health if not tar... |
char.socket.clilocmessage(1002086) | char.socket.sysmessage("1") | def bandage_response( char, args, target ): corpse = None if target.item: if validCorpseTarget( char, target.item ): corpse = target.item else: return elif target.char and not validCharTarget( char, target.char ): return elif not target.char: char.socket.sysmessage( 'You have to target either a corpse or a creature.... |
char.socket.clilocmessage(1002086) return if target.char and target.char.poison and ( char.skill[ HEALING ] < 600 or char.skill[ ANATOMY ] < 600 ): char.socket.clilocmessage(1002086) | char.socket.sysmessage("You are not skilled enough for that.") return if target.char and target.poison > -1 and ( char.skill[ HEALING ] < 600 or char.skill[ ANATOMY ] < 600 ): char.socket.sysmessage("You are not skilled enough for that.") | def bandage_response( char, args, target ): corpse = None if target.item: if validCorpseTarget( char, target.item ): corpse = target.item else: return elif target.char and not validCharTarget( char, target.char ): return elif not target.char: char.socket.sysmessage( 'You have to target either a corpse or a creature.... |
if not corpse and not target.char.dead and not target.char.poison: | if not corpse and not target.char.dead and not target.char.poison > -1: | def bandage_response( char, args, target ): corpse = None if target.item: if validCorpseTarget( char, target.item ): corpse = target.item else: return elif target.char and not validCharTarget( char, target.char ): return elif not target.char: char.socket.sysmessage( 'You have to target either a corpse or a creature.... |
char.addtimer( random.randint( 2500, 5000 ), 'bandages.bandage_timer', [ 2, success, target.char.serial, baseid ] ) | char.addtimer( random.randint( 5000, 10000 ), 'bandages.bandage_timer', [ 2, success, target.char.serial, baseid ] ) | def bandage_response( char, args, target ): corpse = None if target.item: if validCorpseTarget( char, target.item ): corpse = target.item else: return elif target.char and not validCharTarget( char, target.char ): return elif not target.char: char.socket.sysmessage( 'You have to target either a corpse or a creature.... |
char.addtimer( random.randint( 1500, 2500 ), 'bandages.bandage_timer', [ 0, success, target.char.serial, baseid ] ) | if target.char.poison > -1: char.addtimer( random.randint( 4000, 7000 ), 'bandages.bandage_timer', [ 0, success, target.char.serial, baseid ] ) else: char.addtimer( random.randint( 3000, 6000 ), 'bandages.bandage_timer', [ 0, success, target.char.serial, baseid ] ) | def bandage_response( char, args, target ): corpse = None if target.item: if validCorpseTarget( char, target.item ): corpse = target.item else: return elif target.char and not validCharTarget( char, target.char ): return elif not target.char: char.socket.sysmessage( 'You have to target either a corpse or a creature.... |
char.addtimer( random.randint( 1500, 2500 ), 'bandages.bandage_timer', [ 0, success, target.char.serial, baseid ] ) | if target.char.poison > -1: char.addtimer( random.randint( 3000, 4000 ), 'bandages.bandage_timer', [ 0, success, target.char.serial, baseid ] ) else: char.addtimer( random.randint( 1500, 3000 ), 'bandages.bandage_timer', [ 0, success, target.char.serial, baseid ] ) | def bandage_response( char, args, target ): corpse = None if target.item: if validCorpseTarget( char, target.item ): corpse = target.item else: return elif target.char and not validCharTarget( char, target.char ): return elif not target.char: char.socket.sysmessage( 'You have to target either a corpse or a creature.... |
for char in wholist[:10]: | wholist = wholist[:10] for char in wholist: | def showWhoGump(player, page): # Collect the current list of sockets first wholist = [] worldsocket = wolfpack.sockets.first() while worldsocket: char = worldsocket.player if char.invisible and char.rank > player.rank: continue if not char.account: continue wholist.append(char) worldsocket = wolfpack.sockets.next() c... |
gump.setArgs( [ page ] ) | gump.setArgs( [ current_page ] ) | def showWhoGump(player, page): # Collect the current list of sockets first wholist = [] worldsocket = wolfpack.sockets.first() while worldsocket: char = worldsocket.player if char.invisible and char.rank > player.rank: continue if not char.account: continue wholist.append(char) worldsocket = wolfpack.sockets.next() c... |
blooditem.decay = 1 | basedef = wolfpack.charbase(corpse.charbaseid) | |
potion.delete() bottle = wolfpack.additem( 'f0e' ) if not tobackpack( bottle, char ): bottle.update() | potions.consumePotion(char, potion, True) | def poisonit( char, args ): potion = wolfpack.finditem(args[ 0 ]) item = wolfpack.finditem(args[ 1 ]) if not potion or not item: return skill = char.skill[ POISONING ] # poison strength : lesser(0), normal, greater, deadly(3) strength = int( potion.gettag( 'potiontype' ) ) - 14 # consume the potion / add a blank bot... |
dispelChance = 50.0 + (100 * ((char.magery / 10.0 - (target.getintproperty('dispeldifficulty', 1) / 10)) / ((target.getintproperty('dispelfocus', 1) / 10) * 2))) / 100.0 | dispelChance = 50.0 + (100 * ((char.magery / 10.0 - (target.getintproperty('dispeldifficulty', 1) / 10.0)) / ((target.getintproperty('dispelfocus', 1) / 10.0) * 2))) / 100.0 | def effect(self, char, target, mode, args, item): dispelChance = 50.0 + (100 * ((char.magery / 10.0 - (target.getintproperty('dispeldifficulty', 1) / 10)) / ((target.getintproperty('dispelfocus', 1) / 10) * 2))) / 100.0 |
if not potiontype in potions: | if not potiontype in POTIONS: | def onUse( char, item ): socket = char.socket # Potions need to be on your body to use them, or in arms reach. if item.getoutmostchar() != char: char.message( "This potion is out of your reach..." ) return False # Lets make sure the tag exists. if not item.hastag( 'potiontype' ): return False else: potiontype = item.g... |
if len( content.strip() ) == 0: | if not content or len(content.strip()) == 0: | def onBookUpdatePage(char, item, page, content): if item.hastag('protected'): char.message('This book is read only.') return if item.hastag( 'pages' ): pages = int(item.gettag('pages')) else: pages = 64 if page > pages or page < 1: return if len( content.strip() ) == 0: item.deltag('page%u' % page) return item.sett... |
return _wolfpack.statics( x, y, map, range ) | return _wolfpack.statics( x, y, map, exact ) | def statics( x, y, map, exact=1 ): if not type( x ) is IntType or not type( y ) is IntType or not type( map ) is IntType or not type( exact ) is IntType: raise TypeError, "x, y and map need to be integer values" else: return _wolfpack.statics( x, y, map, range ) |
def statics( x, y, map ): return _wolfpack.statics( x, y, map ) | def statics( x, y, map ): return _wolfpack.statics( x, y, map ) | |
if mode == MODE_EQUAL and z == z0: | if mode == MODE_NONE: items.append( item ) elif mode == MODE_EQUAL and z == z0: | def tileResponse(player, arguments, target): if( len(arguments) < 7 ): player.socket.sysmessage( "Please select the second corner." ) player.socket.attachtarget( "commands.tilemove.tileResponse", list(arguments) + [target.pos] ) return socket = player.socket xmod = int( arguments[0] ) ymod = int( arguments[1] ) zmod =... |
return 1 | return True | def onWearItem(player, wearer, item, layer): lower = properties.fromitem(item, LOWERREQS) / 100.0 req_str = item.getintproperty( 'req_strength', 0 ) if item.hastag( 'req_strength' ): req_str = int( item.gettag( 'req_strength' ) ) if lower: req_str = int(ceil(req_str) * (1.0 - lower)) req_dex = item.getintproperty( 'r... |
return 1 return 0 | return True return False | def onWearItem(player, wearer, item, layer): lower = properties.fromitem(item, LOWERREQS) / 100.0 req_str = item.getintproperty( 'req_strength', 0 ) if item.hastag( 'req_strength' ): req_str = int( item.gettag( 'req_strength' ) ) if lower: req_str = int(ceil(req_str) * (1.0 - lower)) req_dex = item.getintproperty( 'r... |
target.char.baseid = 'sheep' | target.char.baseid = 'sheep_sheered' | def docarve( char, item, target ): # Corpse => Carve # Wood => Kindling/Logs model = 0 if target.item: if carve_item( char, item, target ): return else: model = target.item.id # This is for sheering only elif target.char and target.char.npc: if target.char.baseid == 'sheep_unsheered': target.char.id = 223 target.char... |
elif target.char.baseid == 'sheep': | elif target.char.baseid == 'sheep' or target.char.baseid == 'sheep_sheered': | def docarve( char, item, target ): # Corpse => Carve # Wood => Kindling/Logs model = 0 if target.item: if carve_item( char, item, target ): return else: model = target.item.id # This is for sheering only elif target.char and target.char.npc: if target.char.baseid == 'sheep_unsheered': target.char.id = 223 target.char... |
if skills.skilltable[ DETECTHIDDEN ][ skills.UNHIDE ] and char.hidden: | if skills.skilltable[ DETECTINGHIDDEN ][ skills.UNHIDE ] and char.hidden: | def response( char, args, target ): if not char: return if skills.skilltable[ DETECTHIDDEN ][ skills.UNHIDE ] and char.hidden: char.removefromview() char.hidden = False char.update() # if we are in our house : reveal all hidden chars in this house # w/o checking skill house = wolfpack.findmulti( char.pos ) # it's our... |
self.stream.write("\\texttt{%s}%s & %s & %s\\\\\n"%(var['name'],load,var['long_name'], | self.stream.write("\\texttt{%s}%s & %s & %s\\\\\n"%(var['name'].replace('_','\_'),load,var['long_name'].replace('_','\_'), | def print_var(self, var): """Write single variable block to stream for ncdf_params.""" |
out[i+1] = out[i+1]+'\t %f%%'%(100.*(stats[i]-stats_comp[i])/(abs(stats_comp[i]))) | if i==4: out[i+1] = out[i+1]+'\t %f'%(stats[i]-stats_comp[i]) else: out[i+1] = out[i+1]+'\t %f%%'%(100.*(stats[i]-stats_comp[i])/(abs(stats_comp[i]))) | def getstats(cffile,time, eismint=False): """Get ice statistics. cffile: CF file object time: time slice to be processed eismint: set to True if it's an EISMINT 2 test (default: False) returns a Numeric array: [volume, area, melt fraction] if it's an eismint 2 file, then the array contains additionally [...,divide th... |
varx[:] = (delta[0]*Numeric.arange(numx-1)).astype(Numeric.Float32) | varx[:] = ((delta[0]*Numeric.arange(numx-1)+(delta[0]/2))+origin[0]).astype(Numeric.Float32) | def usage(): "print short help message" print 'Usage: a2c.py [OPTIONS] infile outfile' print 'create a radial CF topography file based on Sine wave.' print 'infile = input ascii file e.g. input.asc' print 'outfile = output netCDF file e.g. output.nc' print '' print ' -h, --help\n\tthis message' print ' -p, --project... |
varx[:] = (delta[0]*Numeric.arange(numx)).astype(Numeric.Float32) | varx[:] = ((delta[0]*Numeric.arange(numx))+origin[0]).astype(Numeric.Float32) | def usage(): "print short help message" print 'Usage: a2c.py [OPTIONS] infile outfile' print 'create a radial CF topography file based on Sine wave.' print 'infile = input ascii file e.g. input.asc' print 'outfile = output netCDF file e.g. output.nc' print '' print ' -h, --help\n\tthis message' print ' -p, --project... |
vary[:] = (delta[1]*Numeric.arange(numy-1)).astype(Numeric.Float32) | vary[:] = ((delta[1]*Numeric.arange(numy-1)+(delta[1]/2))+origin[1]).astype(Numeric.Float32) | def usage(): "print short help message" print 'Usage: a2c.py [OPTIONS] infile outfile' print 'create a radial CF topography file based on Sine wave.' print 'infile = input ascii file e.g. input.asc' print 'outfile = output netCDF file e.g. output.nc' print '' print ' -h, --help\n\tthis message' print ' -p, --project... |
vary[:] = (delta[1]*Numeric.arange(numy)).astype(Numeric.Float32) | vary[:] = ((delta[1]*Numeric.arange(numy))+origin[1]).astype(Numeric.Float32) | def usage(): "print short help message" print 'Usage: a2c.py [OPTIONS] infile outfile' print 'create a radial CF topography file based on Sine wave.' print 'infile = input ascii file e.g. input.asc' print 'outfile = output netCDF file e.g. output.nc' print '' print ' -h, --help\n\tthis message' print ' -p, --project... |
self.params['lon_0'] = var.longitude_of_central_meridian[0] | self.params['lon_0'] = var.longitude_of_projection_origin[0] | def __init__(self,var): """Initialise. var: CF grid mapping variable.""" CFProj.__init__(self,var) self.params['proj'] = 'stere' # polar variation if var.grid_mapping_name == 'polar_stereographic': self.params['lon_0'] = var.straight_vertical_longitude_from_pole[0] self.params['lat_0'] = var.latitude_of_projection_ori... |
proj.longitude_of_central_meridian = [float(ps[0])] | proj.longitude_of_projection_origin = [float(ps[0])] | def CFProj_parse_GMTproj(projstring): """Parse GMT projection string.""" proj = DummyProj() ps = projstring[1:].split('/') if projstring[0] in ['b','B']: if len(ps) != 4: print 'Error, wrong number of projection arguments' usage() sys.exit(1) proj.grid_mapping_name='albers_conical_equal_area' proj.longitude_of_centra... |
proj.longitude_of_central_meridian = [long_central] | proj.longitude_of_projection_origin = [long_central] | def CFProj_parse_ESRIprj(pFile): """Parse an ESRI projection file. pFile: file object.""" proj = DummyProj() pName = pFile.readline() pName=pName[14:] pStrip = string.strip(pName) if pStrip == 'ALBERS': proj.grid_mapping_name='albers_conical_equal_area' line = pFile.readline() while line != '': line = pFile.readli... |
eis = PyCF.CFgetstats(cffile,-1,eismint=True) - comp | eis = PyCF.CFgetstats(cffile,-1,eismint=True) eis = eis - comp | def coordsystem(self): """Plot coordinate system""" |
eis[i]=eis[i]/abs(comp[i]) | eis[i]=100.*eis[i]/abs(comp[i]) | def coordsystem(self): """Plot coordinate system""" |
if 'spot' not in v and v not in ['level','x0','y0','x1','y1']: | if 'spot' not in v and v not in ['VARSET','level','x0','y0','x1','y1']: | def createVariable(self,name): """Create a CF variable. |
prog.write('\"%s\"'%configname) | prog.write('\"%s\"\n'%configname) | def get_gmtdate(): """Get current date.""" d = time.gmtime() return '%d-%d-%d_%d:%d'%(d[0],d[1],d[2],d[3],d[4]) |
print r | def __call(self, name, args, kw, ns = None, sa = None, hd = None, ma = None): | |
except xml.sax.SAXParseException: | except xml.sax.SAXParseException, e: | def _parseSOAP(xml_str, rules = None): try: from cStringIO import StringIO except ImportError: from StringIO import StringIO parser = xml.sax.make_parser() t = SOAPParser(rules = rules) parser.setContentHandler(t) e = xml.sax.handler.ErrorHandler() parser.setErrorHandler(e) inpsrc = xml.sax.xmlreader.InputSource() in... |
raise e | def _parseSOAP(xml_str, rules = None): try: from cStringIO import StringIO except ImportError: from StringIO import StringIO parser = xml.sax.make_parser() t = SOAPParser(rules = rules) parser.setContentHandler(t) e = xml.sax.handler.ErrorHandler() parser.setErrorHandler(e) inpsrc = xml.sax.xmlreader.InputSource() in... | |
def serialize(self, sw, pyobj, name=None, attrtext='', **kw): | def serialize(self, sw, pyobj, name=None, attrtext='', unsuppressedPrefixes=[], **kw): | def serialize(self, sw, pyobj, name=None, attrtext='', **kw): if not self.wrapped: Canonicalize(pyobj, sw, comments=self.comments) return objid = '%x' % id(pyobj) n = name or self.oname or ('E' + objid) if type(pyobj) in _stringtypes: print >>sw, '<%s%s href="%s"/>' % (n, attrtext, pyobj) elif kw.get('inline', self.inl... |
Canonicalize(pyobj, sw, comments=self.comments) | Canonicalize(pyobj, sw, unsuppressedPrefixes=unsuppressedPrefixes, comments=self.comments) | def serialize(self, sw, pyobj, name=None, attrtext='', **kw): if not self.wrapped: Canonicalize(pyobj, sw, comments=self.comments) return objid = '%x' % id(pyobj) n = name or self.oname or ('E' + objid) if type(pyobj) in _stringtypes: print >>sw, '<%s%s href="%s"/>' % (n, attrtext, pyobj) elif kw.get('inline', self.inl... |
mystr = getattr(ex, 'str') or str(ex) mytrace = getattr(ex, 'trace', '') or '' | mystr = getattr(ex, 'str', None) or str(ex) mytrace = getattr(ex, 'trace', '') | def FaultFromZSIException(ex, actor=None): '''Return a Fault object created from a ZSI exception object. ''' mystr = getattr(ex, 'str') or str(ex) mytrace = getattr(ex, 'trace', '') or '' elt = '''<ZSI:ParseFaultDetail> |
def getTargetNamespace(self): return self._ref.getTargetNamespace() | def getTargetNamespace(self): return self._ref.getTargetNamespace() | |
%self.__class__.__name__ | % cls.__name__ | def processRequest(cls, ps, **kw): """invokes callback that should return a (request,response) tuple. representing the SOAP request and response respectively. ps -- ParsedSoap instance representing HTTP Body. request -- twisted.web.server.Request """ resource = kw['resource'] request = kw['request'] method = getattr(r... |
return check | return check_args | def check_args(self, *args, **kw): for i in range(len(args)): if (l > i and interfaces[i].providedBy(args[i])) or type(args[i]) is interfaces[-1]: continue raise TypeError, 'got %s, expecting %s' %(args[i], types[i]) func(self, *args, **kw) |
sample = typedArrayType(typed=obj._type) | if getattr(obj, "_complexType", None): sample = typedArrayType(typed=obj._type, complexType = obj._complexType) sample._typename = obj._type obj._ns = NS.URN else: sample = typedArrayType(typed=obj._type) | def dump_list(self, obj, tag, typed = 1, ns_map = {}): if Config.debug: print "In dump_list.", "obj=", obj tag = tag or self.gentag() tag = toXMLname(tag) # convert from SOAP 1.2 XML name encoding |
type(sample) == DictType: | type(sample) == DictType or \ (isinstance(sample, anyType) and \ (getattr(sample, "_complexType", None) and \ sample._complexType)): | def dump_list(self, obj, tag, typed = 1, ns_map = {}): if Config.debug: print "In dump_list.", "obj=", obj tag = tag or self.gentag() tag = toXMLname(tag) # convert from SOAP 1.2 XML name encoding |
sys.path.append('generatedCode') | sys.path.append(subdirPath) | def getModule(self, section, serviceName, subdirPath, schemaOnly=False, explicitPath=None): sys.path.append('generatedCode') try: # fix service = __import__(serviceName + '_services') except ImportError: service = self.generateCode(section, serviceName, subdirPath, schemaOnly, explicitPath) return service |
if content: return content | if content: return content.getvalue() | def Opaque(self, uri, tc, ps, **keywords): |
self.ofwhat, self.lenofwhat = tuple(ofwhat), len(ofwhat) | self.ofwhat = tuple(ofwhat) | def __init__(self, pyclass, ofwhat, pname=None, inorder=0, inline=0, |
if count > self.lenofwhat and not self.hasextras: | if count > len(self.ofwhat) and not self.hasextras: | def parse(self, elt, ps): #if elt.localName != self.pname: # elt = elt.getElementsByTagName(self.pname)[0] self.checkname(elt, ps) if self.type and \ self.checktype(elt, ps) not in [ self.type, (None,None) ]: raise EvaluateException('Struct has wrong type', ps.Backtrace(elt)) href = _find_href(elt) if href: if _chil... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.