Best Python code snippet using Kiwi_python
modify.py
Source:modify.py
...88BLOCK_HIDE_RARES_65 = 1300 # Endgame and leveling89BLOCK_ACT_1 = 3006 # My own bases and weapon_template90BLOCK_HIDE_REMAINING = 3200 # SetFontSize=FONT_SIZE_MIN91def modify_endgame_mix(filter_manager):92 filter_manager.add_comment(100, 'OVERRIDE AREA 1 - Override ALL rules here', ignored=True)93 # never override 6L94 # 895 blocks = filter_manager.add_comment(200, '6 LINKS')96 for block in blocks:97 block.PlayAlertSound = SOUND_TOP_VALUE98 filter_manager.extend_blocks(blocks)99 # BLOCK_5L 8100 blocks_5l = filter_manager.get_blocks(BLOCK_5L)101 for block in blocks_5l:102 block.PlayAlertSound = SOUND_TOP_VALUE103 filter_manager.extend_blocks(blocks_5l)104 # special rules here105 # if settings.DARKNESS:106 # _global = {'ElderItem': False, 'ShaperItem': False}107 # filter_manager.append_block(FilterBlock(status=DEBUG, Rarity=RARITY_MAGIC, **_global))108 # filter_manager.append_block(FilterBlock(status=DEBUG, Rarity=RARITY_RARE, **_global))109 filter_manager.add_comment(300, 'SHAPER ITEMS', ignored=True)110 filter_manager.add_comment(301, 'Exception Handling - Rings, Amulets, Belts', ignored=True)111 # 8 shaper_alerts112 blocks = filter_manager.add_comment(302, 'Shaper Item Layers - T1')113 for block in blocks:114 block.PlayAlertSound = SOUND_TOP_VALUE115 shaper_alerts = blocks[0].copy_modify(Class='"Amulets" "Rings" "Belts" "Gloves"', BaseType=None) # gloves for trap116 filter_manager.append_block(shaper_alerts)117 filter_manager.extend_blocks(blocks)118 # 10119 blocks = filter_manager.add_comment(303, 'Shaper Item Layers - T2')120 for block in blocks:121 block.PlayAlertSound = SOUND_SHAPER_ELDER122 filter_manager.extend_blocks(blocks)123 blocks = filter_manager.add_comment(304, 'Shaper Item Layers - T3')124 filter_manager.extend_blocks(blocks)125 filter_manager.add_comment(400, 'ELDER ITEMS', ignored=True)126 filter_manager.add_comment(401, 'Exception Handling - Rings, Amulets, Belts', ignored=True)127 # 8 elder_alerts128 blocks = filter_manager.add_comment(402, 'Elder Item Layers - T1')129 for block in blocks:130 block.PlayAlertSound = SOUND_TOP_VALUE131 elder_alerts = blocks[0].copy_modify(Class='"Amulets" "Rings" "Belts"', BaseType=None)132 filter_manager.append_block(elder_alerts)133 filter_manager.extend_blocks(blocks)134 # 10135 blocks = filter_manager.add_comment(403, 'Elder Item Layers - T2')136 for block in blocks:137 block.PlayAlertSound = SOUND_SHAPER_ELDER138 filter_manager.extend_blocks(blocks)139 blocks = filter_manager.add_comment(404, 'Elder Item Layers - T3')140 filter_manager.extend_blocks(blocks)141 filter_manager.add_comment(500, 'Explicit Mod filtering', ignored=True)142 blocks = filter_manager.add_comment(501, 'League-Specific Magic Items')143 filter_manager.extend_blocks(blocks)144 # 3145 blocks = filter_manager.add_comment(502, 'Magic Mod Permutations')146 blocks[-2].PlayAlertSound = SOUND_MAGIC_MOD147 filter_manager.extend_blocks(blocks)148 # 8149 blocks = filter_manager.add_comment(503, 'Rare Item Permutations')150 blocks[0].PlayAlertSound = SOUND_TOP_VALUE151 filter_manager.extend_blocks(blocks)152 filter_manager.add_comment(600, 'Explicit Mod filtering - EXPERIMENTAL', ignored=True)153 blocks = filter_manager.add_comment(601, 'Rare Item Permutations')154 filter_manager.extend_blocks(blocks)155 blocks = filter_manager.add_comment(602, 'Weapons-Physical (Key: IPD)')156 filter_manager.extend_blocks(blocks)157 blocks = filter_manager.add_comment(603, 'The Suffix Abomination')158 filter_manager.extend_blocks(blocks)159 blocks = filter_manager.add_comment(604, 'Casters')160 filter_manager.extend_blocks(blocks)161 filter_manager.add_comment(700, 'Recipes, Magic and Normal items (endgame!)', ignored=True)162 blocks = filter_manager.add_comment(701, 'Overqualitied Items')163 filter_manager.extend_blocks(blocks)164 # ç§»å° 6L ä¹å165 filter_manager.add_comment(BLOCK_5L, '5-Linked items', ignored=True)166 # 8 æ ·å¼æ¹æ167 blocks = filter_manager.add_comment(703, '6-Socket Items')168 blocks[0].modify(PlayAlertSound=SOUND_TOP_VALUE, **STYLE_TOP)169 blocks[1].modify(PlayAlertSound=SOUND_TOP_VALUE, **STYLE_TOP)170 blocks[-1].modify(SetBorderColor=COLOR_BLACK, SetBackgroundColor=COLOR_TANGERINE)171 filter_manager.extend_blocks(blocks)172 # 8 1 1173 blocks = filter_manager.add_comment(704, 'Exclusive bases: Stygian Vise')174 blocks[0].PlayAlertSound = SOUND_TOP_VALUE175 blocks[1].PlayAlertSound = SOUND_MID_VALUE176 blocks[2].PlayAlertSound = SOUND_MID_VALUE177 filter_manager.extend_blocks(blocks)178 # 8 8 1 2 2179 blocks = filter_manager.add_comment(705, 'Abyss Jewels (Rare and Magic)')180 blocks[0].PlayAlertSound = SOUND_TOP_VALUE181 blocks[1].PlayAlertSound = SOUND_TOP_VALUE182 blocks[2].PlayAlertSound = SOUND_MID_VALUE183 blocks[3].PlayAlertSound = SOUND_LOW_VALUE184 blocks[-1].PlayAlertSound = SOUND_LOW_VALUE185 filter_manager.extend_blocks(blocks)186 # 8187 blocks = filter_manager.add_comment(706, 'Exclusive bases: Top Value')188 for block in blocks:189 block.BaseType += ' "Marble Amulet" '190 block.modify(PlayAlertSound=SOUND_TOP_VALUE, **STYLE_TOP)191 filter_manager.extend_blocks(blocks)192 # 8 1 hide193 blocks = filter_manager.add_comment(707, 'Exclusive bases: Trinkets')194 blocks[0].PlayAlertSound = SOUND_TOP_VALUE195 blocks[1].PlayAlertSound = SOUND_TOP_VALUE196 blocks[2].modify(PlayAlertSound=SOUND_MID_VALUE, **STYLE_TOP_RARE)197 blocks[3].modify(PlayAlertSound=SOUND_MID_VALUE, **STYLE_TOP_RARE)198 blocks[-2].status = DEBUG199 filter_manager.extend_blocks(blocks)200 # 8 1 ALERT_ATLAS_NORMAL_BASE_TYPE 2201 blocks = filter_manager.add_comment(708, 'Exclusive bases: Others')202 blocks[0].PlayAlertSound = SOUND_TOP_VALUE203 blocks[1].PlayAlertSound = SOUND_TOP_VALUE204 blocks[2].modify(PlayAlertSound=SOUND_MID_VALUE, **STYLE_TOP_RARE)205 blocks[3].modify(PlayAlertSound=SOUND_MID_VALUE, **STYLE_TOP_RARE)206 if settings.ALERT_ATLAS_NORMAL_BASE_TYPE == '':207 blocks[-1].status = DEBUG208 else:209 blocks[-1].modify(BaseType=settings.ALERT_ATLAS_NORMAL_BASE_TYPE, Rarity=RARITY_NORMAL,210 PlayAlertSound=SOUND_LOW_VALUE)211 filter_manager.extend_blocks(blocks)212 # RARITY_MAGIC213 # 项é¾ï¼+1è¯
åï¼+1çï¼ææ§ä¸éï¼ è
°å¸¦ï¼+1ç214 # æï¼å»ä¸éå è¯
åï¼ èï¼+1çï¼ ç®è¢ï¼+1ç®215 filter_manager.add_comment(709, 'Corrupted Amulets', ignored=True)216 accessories = FilterBlock(Corrupted=True, Class='"Amulets" "Belts"', Rarity=RARITY_MAGIC,217 SetFontSize=36, SetBorderColor=COLOR_ORANGE)218 others = accessories.copy_modify(Class='"Gloves" "Boots" "Quivers"')219 filter_manager.extend_blocks([accessories, others])220 # CHANCING_BASE_TYPE221 filter_manager.add_comment(710, 'Chancing items', ignored=True)222 if settings.CHANCING_BASE_TYPE != '':223 block = FilterBlock(Corrupted=False, BaseType=settings.CHANCING_BASE_TYPE, Rarity=RARITY_NORMAL,224 SetFontSize=42, SetTextColor=COLOR_WHITE, SetBorderColor=COLOR_LIME_LIGHT)225 filter_manager.append_block(block)226 # ALERT_UTILITY_FLASK_BASE_TYPE 12 SHOW_FLASK_MANA227 blocks = filter_manager.add_comment(711, 'FLASKS (Endgame rules)')228 if settings.ALERT_UTILITY_FLASK_BASE_TYPE != '':229 utility_flasks = blocks[-1].copy_modify(BaseType=settings.ALERT_UTILITY_FLASK_BASE_TYPE,230 SetFontSize=FONT_SIZE_MAX, PlayAlertSound=SOUND_LEVELING)231 filter_manager.append_block(utility_flasks)232 filter_manager.extend_blocks(blocks[:2])233 if settings.SHOW_FLASK_MANA:234 blocks[-2].BaseType = '"Eternal"'235 filter_manager.append_block(blocks[-2])236 filter_manager.add_comment(712, 'Add your own crafting rules here', ignored=True)237 # 8238 blocks = filter_manager.add_comment(713, '86+ Endgame crafting rules')239 for block in blocks:240 block.PlayAlertSound = SOUND_TOP_VALUE241 filter_manager.extend_blocks(blocks)242 # Hide243 filter_manager.add_comment(714, '83/84+ Endgame crafting rules', ignored=True)244 # MAGIC_JEWEL_BASE_TYPE245 blocks = filter_manager.add_comment(715, '60+ Crafting rules for 60++ trinkets')246 if settings.MAGIC_JEWEL_BASE_TYPE != '':247 blocks[0].BaseType = settings.MAGIC_JEWEL_BASE_TYPE248 filter_manager.append_block(blocks[0])249 # ALERT_NORMAL_BASE_TYPE, SSF_CRAFT_AMULETS_BASE_TYPE, SSF_CRAFT_RINGS_BASE_TYPE, SSF_CRAFT_BELTS_BASE_TYPE250 # ALERT_MAGIC_BASE_TYPE251 filter_manager.add_comment(716, 'Remaining crafting rules - add your own bases here!', ignored=True)252 if settings.ALERT_NORMAL_BASE_TYPE != '':253 normals = filter_manager.get_blocks(BLOCK_ACT_1)[0]254 normals.modify(BaseType=settings.ALERT_NORMAL_BASE_TYPE, ItemLevel=None,255 SetFontSize=40, PlayAlertSound=SOUND_LEVELING)256 # str_n = normals.copy_modify(BaseType='"Amber Amulet" "Heavy Belt"', ItemLevel='<= 12')257 filter_manager.extend_blocks([normals])258 if settings.SSF_CRAFT_BELTS_BASE_TYPE != '':259 if not settings.SPELL:260 hide_normals = filter_manager.get_blocks(BLOCK_HIDE_REMAINING)[0]261 hide_normals.modify(Class=None, Rarity=RARITY_NORMAL, SetFontSize=FONT_SIZE_MIN)262 hide_n_leather_belt = hide_normals.copy_modify(BaseType='"Leather Belt"', ItemLevel='<= 29')263 hide_n_rustic_sash = hide_normals.copy_modify(BaseType='"Rustic Sash"', ItemLevel='>= 30')264 filter_manager.extend_blocks([hide_n_leather_belt, hide_n_rustic_sash]) # A4å·¦å³å¼å§å è¡(T5è¡ä»30å¼å§)265 filter_manager.append_block(FilterBlock(266 Class='Belts', BaseType=settings.SSF_CRAFT_BELTS_BASE_TYPE, Rarity=RARITY_NORMAL, ItemLevel='>= 13',267 SetTextColor=COLOR_WHITE))268 if settings.SSF_CRAFT_AMULETS_BASE_TYPE != '':269 filter_manager.append_block(FilterBlock(270 Class='Amulets', BaseType=settings.SSF_CRAFT_AMULETS_BASE_TYPE, Rarity=RARITY_NORMAL, ItemLevel='>= 13',271 SetTextColor=COLOR_WHITE))272 if settings.SSF_CRAFT_RINGS_BASE_TYPE != '':273 filter_manager.append_block(FilterBlock(274 Class='Rings', BaseType=settings.SSF_CRAFT_RINGS_BASE_TYPE, Rarity=RARITY_NORMAL, ItemLevel='>= 13',275 SetTextColor=COLOR_WHITE))276 if settings.ALERT_MAGIC_BASE_TYPE != '':277 alert_magics = filter_manager.get_blocks(BLOCK_ACT_1)[1]278 alert_magics.modify(ItemLevel=None, BaseType=None, PlayAlertSound=SOUND_LEVELING)279 if not settings.SPELL:280 alert_m_iron_ring = alert_magics.copy_modify(BaseType='"Iron Ring"', ItemLevel='<= 20')281 alert_magic_gloves = alert_magics.copy_modify(Class='"Gloves"', ItemLevel='<= 24')282 filter_manager.extend_blocks([alert_m_iron_ring, alert_magic_gloves])283 alert_magics.BaseType = settings.ALERT_MAGIC_BASE_TYPE284 filter_manager.append_block(alert_magics)285 # NEED_CHISEL286 blocks = filter_manager.add_comment(717, 'Chisel recipe items')287 if settings.NEED_CHISEL:288 for block in blocks:289 block.modify(SetFontSize=FONT_SIZE_MAX, PlayAlertSound=SOUND_MID_VALUE)290 blocks[1].Quality = '>= 12'291 blocks[2].Quality = None292 filter_manager.extend_blocks(blocks)293 # 8294 blocks = filter_manager.add_comment(718, 'Fishing Rod')295 blocks[0].PlayAlertSound = SOUND_TOP_VALUE296 filter_manager.extend_blocks(blocks)297 filter_manager.add_comment(719, 'SRS Crude Bow', ignored=True)298 # NEED_RGB299 blocks = filter_manager.add_comment(720, 'Chromatic recipe items ("RGB Recipe")')300 if settings.NEED_RGB:301 filter_manager.extend_blocks(blocks)302 blocks = filter_manager.add_comment(721, 'Endgame-start 4-links')303 if settings.DARKNESS:304 blocks[0].modify(ItemLevel=None, DropLevel='>= 50')305 filter_manager.extend_blocks(blocks)306 filter_manager.add_comment(722, 'Animate Weapon script - deactivated by default', ignored=True)307 if settings.AW:308 aw = FilterBlock(Class='"One Hand" "Two Hand" "Staves" "Daggers" "Thrusting" "Sceptres" "Claws"',309 Rarity=RARITY_NORMAL,310 SetBackgroundColor='0 0 0 255', SetTextColor='150 0 0 255', SetBorderColor='150 0 0 255',311 SetFontSize=FONT_SIZE_MAX)312 if settings.AW_RANGE:313 aw.Class += ' "Bows" "Wands"'314 filter_manager.append_block(aw)315 # 8316 blocks = filter_manager.add_comment(723, 'W-soc offhand weapons')317 for block in blocks:318 block.Class = '"Wands" "Daggers" "Sceptres" "Claws" "One Hand" "Shields"'319 blocks[0].modify(SetFontSize=FONT_SIZE_MAX, PlayAlertSound=SOUND_TOP_VALUE)320 filter_manager.append_block(blocks[0])321 blocks = filter_manager.add_comment(724, 'Sacrificial Garb')322 filter_manager.extend_blocks(blocks)323 # other rules here324def modify_endgame_rare(filter_manager, show_rare_class=''):325 filter_manager.add_comment(1100, 'RARE ITEMS - TRINKETS (ENDGAME)', ignored=True)326 # 8327 blocks = filter_manager.add_comment(1101, 'Rare trinkets 86+')328 for block in blocks:329 block.PlayAlertSound = SOUND_TOP_VALUE330 filter_manager.extend_blocks(blocks)331 # 8332 blocks = filter_manager.add_comment(1102, 'Rare trinkets 84+')333 for block in blocks:334 block.PlayAlertSound = SOUND_TOP_VALUE335 filter_manager.extend_blocks(blocks)336 blocks = filter_manager.add_comment(1103, 'Breach Rings')337 filter_manager.extend_blocks(blocks)338 # 移é¤å两个 1 ITEM_LEVEL_CHAOS339 blocks = filter_manager.add_comment(1104, 'Rare trinkets "remaining"')340 for block in blocks[2:]:341 block.SetBorderColor = COLOR_YELLOW342 if settings.SSF:343 filter_manager.extend_blocks(blocks[:2])344 else:345 for block in blocks[2:]:346 block.PlayAlertSound = SOUND_MID_VALUE347 blocks[3].ItemLevel = ITEM_LEVEL_CHAOS348 filter_manager.extend_blocks(blocks[2:])349 filter_manager.add_comment(1200, 'RARE ITEMS - WEAPONS AND ARMORS (ENDGAME)', ignored=True)350 # 8351 blocks = filter_manager.add_comment(1201, 'Rare crafting bases 86+')352 for block in blocks:353 block.PlayAlertSound = SOUND_TOP_VALUE354 filter_manager.extend_blocks(blocks)355 # Hide356 filter_manager.add_comment(1202, 'Rare crafting bases 83+', ignored=True)357 # T1_RARE_BASE_TYPE358 # æ¾ç¤º 1x3359 # HIDE_BELOW_T1_RARE_CLASS with Identified=False and show_rare_class360 blocks = filter_manager.add_comment(1203, 'T1 rare items')361 if settings.T1_RARE_BASE_TYPE != '':362 filter_manager.append_block(blocks[0].copy_modify(BaseType=settings.T1_RARE_BASE_TYPE,363 PlayAlertSound=SOUND_MID_VALUE, **STYLE_T1_RARE))364 filter_manager.append_block(blocks[1].copy_modify(BaseType=settings.T1_RARE_BASE_TYPE, ItemLevel=None,365 PlayAlertSound=SOUND_MID_VALUE, **STYLE_T1_RARE))366 filter_manager.append_block(blocks[0].copy_modify(BaseType=None, Width='= 1', Height='= 3'))367 filter_manager.append_block(blocks[1].copy_modify(BaseType=None, ItemLevel=None, Width='= 1', Height='= 3'))368 if '"Shields"' not in settings.HIDE_BELOW_T1_RARE_CLASS:369 filter_manager.append_block(blocks[0].copy_modify(Class='"Shields"', BaseType='"Spirit Shield"'))370 filter_manager.append_block(371 blocks[1].copy_modify(Class='"Shields"', BaseType='"Spirit Shield"', ItemLevel=None))372 if not settings.DARKNESS:373 hide_blocks = filter_manager.get_blocks(BLOCK_HIDE_RARES_65)374 hide_rare_classes = ' '.join(['"Quivers" "Shields"', CLASS_TWO_HAND, settings.HIDE_BELOW_T1_RARE_CLASS])375 if show_rare_class:376 hide_rare_classes = hide_rare_classes.replace(show_rare_class, '')377 for block in hide_blocks:378 block.modify(status=DEBUG, Identified=False, Class=hide_rare_classes)379 filter_manager.extend_blocks(hide_blocks)380 filter_manager.extend_blocks(blocks)381 blocks = filter_manager.add_comment(1204, 'T2 rare items')382 filter_manager.extend_blocks(blocks)383 # NEED_RGB384 blocks = filter_manager.add_comment(1205, 'Other Conditions', ignored=settings.IGNORE_RARE_UNDER_T2)385 if settings.NEED_RGB:386 filter_manager.extend_blocks(blocks)387 blocks = filter_manager.add_comment(1206, '1H Daggers', ignored=settings.IGNORE_RARE_UNDER_T2)388 filter_manager.extend_blocks(blocks)389 blocks = filter_manager.add_comment(1207, '1H Claws', ignored=settings.IGNORE_RARE_UNDER_T2)390 filter_manager.extend_blocks(blocks)391 blocks = filter_manager.add_comment(1208, '1H Wands', ignored=settings.IGNORE_RARE_UNDER_T2)392 filter_manager.extend_blocks(blocks)393 blocks = filter_manager.add_comment(1209, '1H Foils', ignored=settings.IGNORE_RARE_UNDER_T2)394 filter_manager.extend_blocks(blocks)395 blocks = filter_manager.add_comment(1210, '1H Swords', ignored=settings.IGNORE_RARE_UNDER_T2)396 filter_manager.extend_blocks(blocks)397 blocks = filter_manager.add_comment(1211, '1H Maces', ignored=settings.IGNORE_RARE_UNDER_T2)398 filter_manager.extend_blocks(blocks)399 blocks = filter_manager.add_comment(1212, '1H Axes', ignored=settings.IGNORE_RARE_UNDER_T2)400 filter_manager.extend_blocks(blocks)401 blocks = filter_manager.add_comment(1213, '1H Sceptres', ignored=settings.IGNORE_RARE_UNDER_T2)402 filter_manager.extend_blocks(blocks)403 blocks = filter_manager.add_comment(1214, '2H Staves', ignored=settings.IGNORE_RARE_UNDER_T2)404 filter_manager.extend_blocks(blocks)405 blocks = filter_manager.add_comment(1215, '2H Swords, Axes, Maces', ignored=settings.IGNORE_RARE_UNDER_T2)406 filter_manager.extend_blocks(blocks)407 blocks = filter_manager.add_comment(1216, '2H Bows', ignored=settings.IGNORE_RARE_UNDER_T2)408 filter_manager.extend_blocks(blocks)409 blocks = filter_manager.add_comment(1217, 'AR: Gloves, Boots, Helmets', ignored=settings.IGNORE_RARE_UNDER_T2)410 filter_manager.extend_blocks(blocks)411 # Chaos Recipe412 blocks = filter_manager.add_comment(1218, 'AR: Body Armors', ignored=settings.IGNORE_RARE_UNDER_T2)413 for block in blocks[1::2]:414 block.SetFontSize = 40415 filter_manager.extend_blocks(blocks)416 blocks = filter_manager.add_comment(1219, 'OH: Shields', ignored=settings.IGNORE_RARE_UNDER_T2)417 filter_manager.extend_blocks(blocks)418 blocks = filter_manager.add_comment(1220, 'OH: Quivers', ignored=settings.IGNORE_RARE_UNDER_T2)419 filter_manager.extend_blocks(blocks)420def modify_gem_flask_map(filter_manager):421 filter_manager.add_comment(1400, 'OVERRIDE AREA 3 - Override Map, Gem and Flask drops here', ignored=True)422 filter_manager.add_comment(1500, 'Gems', ignored=True)423 # 8424 blocks = filter_manager.add_comment(1501, 'Special Gems')425 for block in blocks:426 block.PlayAlertSound = SOUND_TOP_VALUE427 blocks[2].SetBackgroundColor = COLOR_WHITE428 blocks[2].BaseType += ' ' + settings.NEED_GEM429 if settings.SSF:430 blocks[2].BaseType += ' "Vaal Summon Skeletons" "Vaal Lightning Trap" '431 filter_manager.extend_blocks(blocks)432 # 8433 blocks = filter_manager.add_comment(1502, 'Top Gems')434 for block in blocks:435 block.PlayAlertSound = SOUND_TOP_VALUE436 filter_manager.extend_blocks(blocks)437 # 1 hide later438 blocks = filter_manager.add_comment(1503, 'Quality Gems')439 blocks[0].PlayAlertSound = SOUND_MID_VALUE440 if settings.MAP_RED and not settings.SSF:441 blocks[1].status = DEBUG442 filter_manager.extend_blocks(blocks)443 # Remove blocks[1] 2444 blocks = filter_manager.add_comment(1504, 'Leveled Gems')445 del blocks[1]446 blocks[-1].PlayAlertSound = SOUND_LOW_VALUE447 filter_manager.extend_blocks(blocks)448 # Hide449 blocks = filter_manager.add_comment(1505, 'Other gems')450 if not settings.DARKNESS:451 blocks[0].modify(status=DEBUG, SetFontSize=26)452 filter_manager.extend_blocks(blocks)453 # ALERT_UTILITY_FLASK_BASE_TYPE454 blocks = filter_manager.add_comment(1600, 'UTILITY FLASKS (Levelling Rules)')455 if settings.ALERT_UTILITY_FLASK_BASE_TYPE != '':456 blocks[1].modify(Class='"Utility Flasks"', BaseType=settings.ALERT_UTILITY_FLASK_BASE_TYPE)457 filter_manager.append_block(blocks[1])458 blocks = filter_manager.add_comment(1700, 'HIDE LAYER 3: Random Endgame Flasks')459 filter_manager.extend_blocks(blocks)460 filter_manager.add_comment(1800, 'Maps, fragments and labyrinth items', ignored=True)461 # 8462 blocks = filter_manager.add_comment(1801, 'Unique Maps')463 blocks[0].modify(BaseType=None, PlayAlertSound=SOUND_TOP_VALUE)464 filter_manager.append_block(blocks[0])465 blocks = filter_manager.add_comment(1802, 'Labyrinth items, Offerings')466 filter_manager.extend_blocks(blocks)467 # 8 STYLE_MAP_XXX468 blocks = filter_manager.add_comment(1803, 'Shaped Maps')469 blocks[0].PlayAlertSound = SOUND_TOP_VALUE470 blocks[1].modify(SetBorderColor=COLOR_RED, PlayAlertSound=SOUND_TOP_VALUE)471 blocks[2].modify(PlayAlertSound=SOUND_TOP_VALUE, **STYLE_MAP_HIGH_11_14)472 blocks[3].modify(DropLevel='>= 71', **STYLE_MAP_MID_9_10)473 blocks.append(blocks[3].copy_modify(DropLevel=None, **STYLE_MAP_MID_6_8))474 filter_manager.extend_blocks(blocks)475 # T15å 红边476 blocks = filter_manager.add_comment(1804, 'Top tier maps (T15-16)')477 blocks[0].PlayAlertSound = SOUND_TOP_VALUE478 blocks[1].modify(SetBorderColor=COLOR_RED, PlayAlertSound=SOUND_TOP_VALUE)479 filter_manager.extend_blocks(blocks)480 # å 红边481 blocks = filter_manager.add_comment(1805, 'High tier maps(T11-14)')482 for block in blocks:483 block.modify(PlayAlertSound=SOUND_TOP_VALUE, **STYLE_MAP_HIGH_11_14)484 filter_manager.extend_blocks(blocks)485 # å é»è¾¹/æ©è¾¹ï¼ä¸æ¾ç¤ºç¨æ度486 blocks = filter_manager.add_comment(1806, 'Mid tier maps (T6-10)')487 for block in blocks[:4]:488 block.modify(PlayAlertSound=SOUND_MAP, **STYLE_MAP_MID_9_10)489 for block in blocks[4:]:490 block.modify(PlayAlertSound=SOUND_MAP, **STYLE_MAP_MID_6_8)491 filter_manager.extend_blocks(blocks)492 # å èè¾¹/é»è¾¹ï¼ä¸æ¾ç¤ºç¨æ度493 blocks = filter_manager.add_comment(1807, 'Low tier maps (T1-T5)')494 for block in blocks[:6]:495 block.modify(PlayAlertSound=SOUND_MAP, **STYLE_MAP_LOW_3_5)496 for block in blocks[6:-1]:497 block.modify(PlayAlertSound=SOUND_MAP, **STYLE_MAP_LOW_1_2)498 filter_manager.extend_blocks(blocks)499 # 8 4500 blocks = filter_manager.add_comment(1808, 'Map fragments')501 for block in blocks[:-2]:502 block.PlayAlertSound = SOUND_TOP_VALUE503 blocks[-2].PlayAlertSound = SOUND_MAP504 blocks[-1].PlayAlertSound = SOUND_TOP_VALUE505 filter_manager.extend_blocks(blocks)506def modify_leveling(filter_manager):507 # åæåªè¦42å60级çè¡ç¶508 filter_manager.add_comment(2500, 'OVERRIDE AREA 4 - Insert your custom Leveling adjustments here', ignored=True)509 hide_some_life_flasks = FilterBlock(status=DEBUG, Quality='= 0', Class='"Life Flask"',510 BaseType='"Sanctified" "Eternal"', SetFontSize=FONT_SIZE_MIN)511 hide_some_mana_flasks = FilterBlock(status=DEBUG, Quality='= 0', Class='"Mana Flask"',512 BaseType='"Grand" "Colossal" "Hallowed"', SetFontSize=FONT_SIZE_MIN)513 filter_manager.extend_blocks([hide_some_life_flasks, hide_some_mana_flasks])514 filter_manager.add_comment(2600, 'Leveling - Flasks', ignored=True)515 blocks = filter_manager.add_comment(2601, 'Hide outdated flasks')516 filter_manager.extend_blocks(blocks)517 filter_manager.add_comment(2602, 'Hybrid flasks (normal)', ignored=True)518 # SHOW_FLASK_HALLOWED 42, 60 SHOW_FLASK_LIFE519 blocks = filter_manager.add_comment(2603, 'Life Flasks - Normal (Kudos to Antnee)')520 if settings.SHOW_FLASK_LIFE:521 blocks[-4].ItemLevel = None if settings.SHOW_FLASK_HALLOWED else '<= 1'522 blocks[-2].ItemLevel = None523 filter_manager.extend_blocks(blocks)524 # SHOW_FLASK_MANA525 blocks = filter_manager.add_comment(2604, 'Mana Flasks - Magic (Kudos to Antnee)')526 if settings.SHOW_FLASK_MANA:527 filter_manager.extend_blocks(blocks)528 blocks = filter_manager.add_comment(2605, 'Show remaining flasks')529 filter_manager.extend_blocks(blocks[:2])530 # LINKED_CLASS531 blocks = filter_manager.add_comment(2700, 'Leveling - Merged Rules')532 if settings.LINKED_CLASS != '':533 for block in blocks: # 4L RGB534 block.Class = settings.LINKED_CLASS535 filter_manager.extend_blocks(blocks)536 # NEED_RGB537 blocks = filter_manager.add_comment(2800, 'Leveling - RGB Recipes')538 if settings.NEED_RGB:539 filter_manager.extend_blocks(blocks)540 # hide_leveling_rares hide_some_body_rares HIDE_BELOW_T1_RARE_CLASS541 filter_manager.add_comment(2900, 'Leveling - RARES', ignored=True)542 if not settings.DARKNESS:543 hide_leveling_rares = filter_manager.get_blocks(BLOCK_HIDE_RARES_65)[-1]544 hide_leveling_rares.modify(status=DEBUG, Identified=False, ItemLevel='>= 13',545 Class='"Bows" "Quivers" "Two Hand" "Staves" "Shields"', SetFontSize=26)546 filter_manager.extend_blocks([hide_leveling_rares])547 if not settings.SPELL:548 hide_some_body_rares = hide_leveling_rares.copy_modify(549 ItemLevel='>= 23', Class='"Body Armour"',550 BaseType=' '.join([BASE_TYPE_BODY_EVA, BASE_TYPE_BODY_ES, BASE_TYPE_BODY_EE]))551 filter_manager.append_block(hide_some_body_rares)552 else:553 hide_some_body_rares = hide_leveling_rares.copy_modify(554 ItemLevel='>= 23', Class='"Body Armour"',555 BaseType=' '.join([BASE_TYPE_BODY_STR]))556 filter_manager.append_block(hide_some_body_rares)557 if settings.HIDE_BELOW_T1_RARE_CLASS != '':558 hide_rares = hide_leveling_rares.copy_modify(Class=settings.HIDE_BELOW_T1_RARE_CLASS)559 filter_manager.append_block(hide_rares)560 # Rare: 4L RRG RRR (GGB) L3_MAX_IL ALERT_RARE_ACCESSORY æéä¸(è·)é561 blocks = filter_manager.add_comment(2901, 'Leveling rares - specific items')562 if settings.LINKED_CLASS != '':563 blocks[0].modify(Class=settings.LINKED_CLASS, **STYLE_LINKS)564 filter_manager.append_block(blocks[0])565 rare_rrg = blocks[0].copy_modify(LinkedSockets='>= 3', SocketGroup='RRG',566 ItemLevel='<= ' + str(settings.L3_MAX_IL))567 rare_rrr = rare_rrg.copy_modify(SocketGroup='RRR')568 rare_ggb = rare_rrg.copy_modify(SocketGroup='GGB')569 filter_manager.extend_blocks([rare_rrg, rare_rrr] if not settings.SPELL else [rare_ggb])570 blocks[1].SetBorderColor = COLOR_YELLOW571 blocks[2].PlayAlertSound = SOUND_LEVELING572 if not settings.SPELL:573 blocks[3].modify(Height=None, Class='"Boots" "Helmets" "Gloves"')574 filter_manager.extend_blocks(blocks[1:-1])575 if settings.SPELL:576 filter_manager.append_block(blocks[-1])577 blocks = filter_manager.add_comment(2902, 'Leveling rares - Progression')578 filter_manager.extend_blocks(blocks)579 blocks = filter_manager.add_comment(2903, 'Leveling rares - remaining rules')580 filter_manager.extend_blocks(blocks)581 filter_manager.add_comment(3000, 'Leveling - Useful items', ignored=True)582 # RR** or GGB583 blocks = filter_manager.add_comment(3001, 'Linked gear - 4links')584 if settings.LINKED_CLASS != '':585 for block in blocks:586 socketGroup = 'RR' if not settings.SPELL else 'GGB'587 block.modify(Class=settings.LINKED_CLASS, SocketGroup=socketGroup, **STYLE_LINKS)588 filter_manager.append_block(block)589 # GGB590 blocks = filter_manager.add_comment(3002, 'Linked gear - Caster Weapon Configuration')591 if settings.SPELL and settings.NEED_GGB_WEAPON:592 for block in blocks[:2]:593 block.modify(SocketGroup=None, Class='"Sceptres" "Wands"', ItemLevel=None)594 filter_manager.append_block(595 block.copy_modify(SocketGroup='GGB', PlayAlertSound=SOUND_LEVELING, **STYLE_LINKS))596 for block in blocks[:2]:597 filter_manager.append_block(598 block.copy_modify(BaseType='"Driftwood Wand" "Driftwood Sceptre"', ItemLevel=None,599 PlayAlertSound=SOUND_LEVELING, **STYLE_LINKS))600 for sg in ['R', 'BB']:601 filter_manager.append_block(602 blocks[0].copy_modify(status=DEBUG, LinkedSockets=None, Sockets='= 3', SocketGroup=sg,603 ItemLevel=None, PlayAlertSound=None, SetFontSize=FONT_SIZE_MIN))604 for block in blocks[:2]:605 filter_manager.append_block(606 block.copy_modify(LinkedSockets=None, Sockets='= 3', SocketGroup=['G', 'B'], ItemLevel=None,607 PlayAlertSound=SOUND_LEVELING, **STYLE_LINKS))608 # RR RG RRG RRR L2_MAX_IL L3_MAX_IL or GGB609 blocks = filter_manager.add_comment(3003, 'Linked gear - 3links')610 if settings.LINKED_CLASS != '':611 if not settings.SPELL:612 for block in blocks[2:4]:613 block.modify(LinkedSockets=None, ItemLevel=None, Class=settings.LINKED_CLASS, **STYLE_LINKS)614 links_rr = block.copy_modify(SocketGroup='RR', ItemLevel='<= ' + str(settings.L2_MAX_IL),615 PlayAlertSound=SOUND_LEVELING)616 links_rg = block.copy_modify(SocketGroup='RG', ItemLevel='<= ' + str(settings.L2_MAX_IL),617 PlayAlertSound=SOUND_LEVELING)618 links_rrg = links_rg.copy_modify(SocketGroup='RRG', ItemLevel='<= ' + str(settings.L3_MAX_IL))619 links_rrr = links_rg.copy_modify(SocketGroup='RRR', ItemLevel='<= ' + str(settings.L3_MAX_IL))620 filter_manager.extend_blocks([links_rr, links_rg, links_rrg, links_rrr])621 elif settings.NEED_GGB_WEAPON:622 for block in blocks[2:4]:623 block.modify(LinkedSockets=None, ItemLevel=None, Class=settings.LINKED_CLASS, **STYLE_LINKS)624 links_rrg = block.copy_modify(SocketGroup='GGB', ItemLevel='<= ' + str(settings.L3_MAX_IL),625 PlayAlertSound=SOUND_LEVELING)626 filter_manager.extend_blocks([links_rrg])627 blocks = filter_manager.add_comment(3004, 'Extra Highlight: Boots')628 if settings.SPELL and not settings.TENCENT:629 filter_manager.extend_blocks(blocks)630 filter_manager.add_comment(3005, 'Optional Recipes', ignored=True)631 # 注æï¼åç»(13+)éè¦é«äº®çèç½è£
å·²ç»å¨ "Remaining crafting rules" éé¢äº632 blocks = filter_manager.add_comment(BLOCK_ACT_1, 'Act 1')633 if not settings.RICH_LEVELING:634 if settings.SPELL:635 for block in blocks[:2]:636 block.BaseType = '"Paua Ring" "Iron Ring" "Coral Ring" "Chain Belt" "Leather Belt" "Heavy Belt"' + ' "Scale Vest" '637 filter_manager.append_block(blocks[-1])638 else:639 blocks[0].BaseType = '"Rustic Sash" "Amulet"' if settings.TENCENT else '"Iron Ring" "Rustic Sash" "Amulet"'640 blocks[1].BaseType = '"Iron Ring" "Rustic Sash" "Amulet"'641 filter_manager.extend_blocks(blocks[:2])642 filter_manager.add_comment(3007, 'Act 2+3', ignored=True)643 filter_manager.add_comment(3008, 'Act 4+5+6', ignored=True)644 filter_manager.add_comment(3009, 'Jewellery - Regular Highlight', ignored=True)645 filter_manager.add_comment(3010, 'Quivers - Progression', ignored=True)646 filter_manager.add_comment(3011, 'Magic Gear', ignored=True)647 filter_manager.add_comment(3012, '20% quality items for those strange people who want them', ignored=True)648 filter_manager.add_comment(3100, 'Leveling - normal and magic item progression', ignored=True)649 # èç½æ¦å¨ HIDE_NORMAL_MAGIC_CLASS650 filter_manager.add_comment(3101, 'Progression - Part 1 1-30', ignored=True)651 if settings.SHOW_N2M_ONE_HAND_MELEE:652 _LEVELING_BASE = [('"Rusted Sword"', 1 - 1), ('"Rusted Spike"', 3), ('"Copper Sword"', 5),653 ('"Whalebone Rapier"', 7), ('"Sabre"', 10), ('"Jade Hatchet"', 6), ('"Boarding Axe"', 11),654 ('"Broad Axe"', 21), ('"Wraith Axe"', 54), ] # ('"Arming Axe"', 25 + 1),655 if not settings.TENCENT:656 _LEVELING_BASE.extend([('"Spectral Axe"', 33), ('"War Axe"', 45)])657 _LEVELING_BASE_IL_GAP = 3658 for weapon_template in filter_manager.get_blocks(BLOCK_ACT_1)[:2]:659 weapon_template.FontSize = 42660 weapons = [weapon_template.copy_modify(BaseType=leveling_base[0],661 ItemLevel='<= ' + str(leveling_base[1] + _LEVELING_BASE_IL_GAP))662 for leveling_base in _LEVELING_BASE]663 filter_manager.extend_blocks(weapons)664 # other rules here665 if settings.DARKNESS and settings.SHOW_NON_4L_NORMAL:666 filter_manager.append_block(FilterBlock(Class='"Boots"', ItemLevel='<= 5', Rarity=RARITY_NORMAL))667 filter_manager.append_block(668 FilterBlock(status=DEBUG, Class=settings.DARKNESS_HIDE_CLASS, Rarity=RARITY_NORMAL,669 SetFontSize=FONT_SIZE_MIN))670 filter_manager.append_block(671 FilterBlock(status=DEBUG, Class='"Shields"', BaseType=BASE_TYPE_SHIELD_NON_SPELL, Rarity=RARITY_NORMAL,672 SetFontSize=FONT_SIZE_MIN))673 filter_manager.append_block(674 FilterBlock(status=DEBUG, Class='"Boots"', ItemLevel='<= 54', Rarity=RARITY_NORMAL,675 SetFontSize=FONT_SIZE_MIN))676 endgameDropLevel = 57677 for dropLevel in range(1, endgameDropLevel):678 itemLevel = dropLevel + 4679 filter_manager.append_block(FilterBlock(ItemLevel='<= ' + str(itemLevel), DropLevel='>= ' + str(dropLevel)))680 filter_manager.append_block(FilterBlock(DropLevel='>= ' + str(endgameDropLevel)))681 hide_m_2 = filter_manager.get_blocks(BLOCK_HIDE_REMAINING)[0]682 hide_m_2.modify(Class=' '.join([CLASS_HAND, '"Flasks"', CLASS_ACCESSORY]), Rarity=RARITY_MAGIC,683 ItemLevel='>= {}'.format(2 if settings.TENCENT else 6))684 hide_m_5 = hide_m_2.copy_modify(Class='"Helmets" "Gloves" "Boots" "Body Armour"',685 ItemLevel='>= {}'.format(5 if settings.TENCENT else 6))686 hide_n_2 = hide_m_2.copy_modify(Rarity=None, ItemLevel='>= 2', SetFontSize=FONT_SIZE_MIN)687 filter_manager.extend_blocks([hide_m_2, hide_m_5, hide_n_2])688 filter_manager.add_comment(3102, 'Progression - Part 2 30-40', ignored=True)689 filter_manager.add_comment(3103, 'Progression - Part 4 40-65', ignored=True)690 blocks = filter_manager.add_comment(3104, 'Normal items - First 12 levels - exceptions')691 filter_manager.extend_blocks(blocks)692 blocks = filter_manager.add_comment(3105, 'Magic items - general highlight')693 filter_manager.extend_blocks(blocks)694def modify_filter(filter_manager, show_rare_class=''):695 modify_endgame_mix(filter_manager)696 blocks = filter_manager.add_comment(800, 'HIDE LAYER 1 - MAGIC AND NORMAL ITEMS')697 if not settings.DARKNESS:698 blocks[0].status = DEBUG699 filter_manager.extend_blocks(blocks)700 # 1 CURRENCY_ALERT_XXX CURRENCY_XXX_FONT_SIZE701 blocks = filter_manager.add_comment(900, 'Currency - PART 1 - Common currency')702 blocks[0].PlayAlertSound = SOUND_MID_VALUE703 if settings.MAP_RED and not settings.SSF:704 for block in blocks[1:-1]:705 block.modify(status=DEBUG, SetFontSize=FONT_SIZE_MIN)706 else:707 if settings.SSF and not settings.MAP_YELLOW:708 blocks[1].BaseType = blocks[1].BaseType.replace('"Orb of Chance"', '')709 if settings.CURRENCY_ALERT_TRANSMUTATION:710 blocks[1].BaseType += ' "Orb of Transmutation" '711 if settings.CURRENCY_ALERT_BLACKSMITH:712 blocks[1].BaseType += ' "Blacksmith\'s Whetstone" '713 if settings.CURRENCY_ALERT_AUGMENTATION:714 blocks[1].BaseType += ' "Orb of Augmentation" '715 if settings.ALERT_LOW_CURRENCY:716 blocks[1].PlayAlertSound = SOUND_LOW_VALUE717 blocks[2].BaseType = blocks[2].BaseType.replace('"Alchemy Shard"', '')718 blocks[-4].SetFontSize = settings.CURRENCY_PORTAL_FONT_SIZE719 blocks[-3].BaseType = blocks[-3].BaseType.replace('"Transmutation Shard"', '').replace('"Alteration Shard"', '')720 blocks[-3].SetFontSize = settings.CURRENCY_ARMOURER_SCRAP_FONT_SIZE721 blocks[-2].SetFontSize = settings.CURRENCY_WISDOM_FONT_SIZE722 blocks[-2].BaseType += ' "Alteration Shard" "Engineer\'s Shard" '723 blocks[-1].BaseType += ' "Alteration Shard" "Engineer\'s Shard" '724 filter_manager.extend_blocks(blocks)725 filter_manager.add_comment(1000, 'OVERRIDE AREA 2 - Override the default rare rulesets here', ignored=True)726 modify_endgame_rare(filter_manager, show_rare_class)727 blocks = filter_manager.add_comment(BLOCK_HIDE_RARES_65, 'HIDE LAYER 2 - RARE ITEMS (65+)')728 for block in blocks:729 block.status = DEBUG730 filter_manager.extend_blocks(blocks)731 modify_gem_flask_map(filter_manager)732 filter_manager.add_comment(1900, 'Currency - PART 2 - Rare currency', ignored=True)733 # 1734 blocks = filter_manager.add_comment(1901, 'Regular Rare Currency')735 for block in blocks:736 block.PlayAlertSound = SOUND_MID_VALUE737 blocks[-1].BaseType += ' "Orb of Chance" '738 filter_manager.extend_blocks(blocks)739 # 1740 blocks = filter_manager.add_comment(1902, 'Harbinger Currency')741 blocks[0].SetBorderColor = COLOR_BLACK742 if settings.SSF:743 blocks[0].BaseType += ' "Horizon Shard" '744 blocks[0].PlayAlertSound = SOUND_MID_VALUE745 blocks[1].BaseType += ' "Alchemy Shard" '746 filter_manager.extend_blocks(blocks)747 # 8 1748 blocks = filter_manager.add_comment(1903, 'Incursion Currency')749 blocks[0].PlayAlertSound = SOUND_TOP_VALUE750 blocks[1].PlayAlertSound = SOUND_MID_VALUE751 filter_manager.extend_blocks(blocks)752 blocks = filter_manager.add_comment(1904, 'Delve Currency')753 filter_manager.extend_blocks(blocks)754 # 1 2 hide755 # You shall be missed Einhar... Stupid Beast756 blocks = filter_manager.add_comment(1905, 'Bestiary Currency')757 # blocks[0].PlayAlertSound = SOUND_MID_VALUE758 # blocks[1].modify(PlayAlertSound=SOUND_LOW_VALUE, DisableDropSound=None)759 # for block in blocks[3:]:760 # block.modify(status=DEBUG, SetFontSize=26)761 # filter_manager.extend_blocks(blocks)762 # 8 8763 blocks = filter_manager.add_comment(1906, 'Top Currency')764 for block in blocks:765 block.PlayAlertSound = SOUND_TOP_VALUE766 filter_manager.extend_blocks(blocks)767 # 8 1768 blocks = filter_manager.add_comment(1907, 'Essence Tier List')769 blocks[0].PlayAlertSound = SOUND_TOP_VALUE770 blocks[0].BaseType += settings.ALERT_ESSENCE_BASE_TYPE771 blocks[1].PlayAlertSound = SOUND_MID_VALUE772 if settings.MAP_RED and not settings.SSF:773 for block in blocks[3:]:774 block.modify(status=DEBUG, PlayAlertSound=None)775 filter_manager.extend_blocks(blocks)776 blocks = filter_manager.add_comment(1908, 'Perandus')777 filter_manager.extend_blocks(blocks)778 # 8 1 8 X779 blocks = filter_manager.add_comment(1909, 'Breach')780 blocks[0].PlayAlertSound = SOUND_TOP_VALUE781 blocks[1].PlayAlertSound = SOUND_MID_VALUE782 blocks[2].modify(PlayAlertSound=SOUND_TOP_VALUE, **STYLE_TOP)783 blocks[3].PlayAlertSound = None784 filter_manager.extend_blocks(blocks)785 # 8786 blocks = filter_manager.add_comment(1910, 'Others')787 blocks[0].PlayAlertSound = SOUND_TOP_VALUE788 filter_manager.extend_blocks(blocks)789 filter_manager.add_comment(2000, 'Currency - PART 3 - Divination cards (yes the strange sorting is intended)',790 ignored=True)791 blocks = filter_manager.add_comment(2001, 'Exceptions to prevent ident. mistakes')792 filter_manager.extend_blocks(blocks) # T4 card793 # 8794 blocks = filter_manager.add_comment(2002, 'T1 - Top tier cards')795 blocks[0].PlayAlertSound = SOUND_TOP_VALUE796 filter_manager.extend_blocks(blocks)797 # 8798 blocks = filter_manager.add_comment(2003, 'T2 - Great cards')799 blocks[0].PlayAlertSound = SOUND_TOP_VALUE800 if settings.SSF:801 blocks[0].BaseType += ' "The Encroaching Darkness" "The Throne" '802 filter_manager.extend_blocks(blocks)803 # 1804 blocks = filter_manager.add_comment(2004, 'T3 - Decent cards')805 blocks[0].PlayAlertSound = SOUND_MID_VALUE806 filter_manager.extend_blocks(blocks)807 # 1 2808 blocks = filter_manager.add_comment(2005, 'Special - Special Currency Cards')809 blocks[0].PlayAlertSound = SOUND_MID_VALUE810 blocks[1].PlayAlertSound = SOUND_LOW_VALUE811 filter_manager.extend_blocks(blocks)812 # FONT_SIZE_MIN or 2813 blocks = filter_manager.add_comment(2006, 'T5 - Format trash tier cards... before')814 if settings.DARKNESS:815 blocks[0].modify(PlayAlertSound=SOUND_LOW_VALUE)816 filter_manager.extend_blocks(blocks)817 else:818 hide_cards = blocks[0].copy_modify(status=DEBUG, BaseType='"Carrion Crow" ' # Shit819 '"King\'s Blade" ' # (110-134)% ç©ç æ°¸æä¹å820 '"Prosperity" ' # T1 ç¨æ度 éå
ææ821 '"The Inoculated" ' # T1 æ··å ES% æ¤ç²822 '"The Rabid Rhoa" ' # æ··æ²ä¼¤ ååæçª823 '"The Sigil" ' # T1 ES% 项é¾824 # '"The Surgeon" ' # æ´å»å
è½ è¯å825 '"The Twins" ', # T1 æ»é ååæçª826 SetFontSize=FONT_SIZE_MIN)827 if not settings.SSF:828 trash_base_type = blocks[0].BaseType829 still_good_base_type = ['"Lantador\'s Lost Love"',830 '"Rain of Chaos"',831 '"Struck by Lightning"', # ç¹çµä¼¤ å®ç³832 '"The Eye of the Dragon"', # è
åç å®833 '"The Lover"',834 '"The Scholar"',835 '"The Warden"', # è
å项é¾836 '"Volatile Power"', # Q20 ç¦å°æè½837 ]838 for bt in still_good_base_type:839 trash_base_type = trash_base_type.replace(bt, '')840 hide_cards.BaseType += trash_base_type841 filter_manager.append_block(hide_cards)842 blocks[0].modify(SetFontSize=FONT_SIZE_MAX, PlayAlertSound=SOUND_LOW_VALUE)843 filter_manager.extend_blocks(blocks)844 # 2845 blocks = filter_manager.add_comment(2007, 'T4 - ...showing the remaining cards')846 filter_manager.extend_blocks(blocks)847 # CATCHALL848 blocks = filter_manager.add_comment(2100, 'Currency - PART 4 - remaining items')849 blocks[0].BaseType += ' "Transmutation Shard" '850 blocks[0].SetFontSize = FONT_SIZE_MIN851 blocks[1].modify(PlayAlertSound=SOUND_TOP_VALUE, **STYLE_TOP)852 filter_manager.extend_blocks(blocks)853 filter_manager.add_comment(2200, 'Leaguestones - Tierlists', ignored=True)854 filter_manager.add_comment(2300, 'Uniques!', ignored=True)855 # åT1856 blocks = filter_manager.add_comment(2301, 'Exceptions')857 for block in blocks:858 block.PlayAlertSound = SOUND_TOP_VALUE859 blocks[0].modify(**STYLE_TOP_UNIQUE)860 filter_manager.extend_blocks(blocks)861 # 6862 blocks = filter_manager.add_comment(2302, 'Harbinger - Pieces')863 blocks[0].PlayAlertSound = SOUND_UNIQUE864 filter_manager.extend_blocks(blocks)865 # 8866 blocks = filter_manager.add_comment(2303, 'Tier 1 uniques')867 for block in blocks:868 block.PlayAlertSound = SOUND_TOP_VALUE869 if settings.SSF:870 blocks[0].BaseType += ' ' + settings.SSF_UNIQUE871 filter_manager.extend_blocks(blocks)872 # åT1873 blocks = filter_manager.add_comment(2304, 'Tier 2 uniques')874 for block in blocks:875 block.modify(PlayAlertSound=SOUND_TOP_VALUE, **STYLE_TOP_UNIQUE)876 filter_manager.extend_blocks(blocks)877 # 6878 blocks = filter_manager.add_comment(2305, 'Multi-Unique bases.')879 blocks[0].PlayAlertSound = SOUND_UNIQUE880 filter_manager.extend_blocks(blocks)881 filter_manager.add_comment(2306, 'Special Unique Searches', ignored=True)882 filter_manager.add_comment(2307, 'Prophecy-Material Uniques', ignored=True)883 # 6884 blocks = filter_manager.add_comment(2308, 'Random Uniques')885 blocks[0].modify(SetFontSize=FONT_SIZE_MAX, PlayAlertSound=SOUND_UNIQUE)886 filter_manager.extend_blocks(blocks)887 blocks = filter_manager.add_comment(2400, 'Quest Items and Shaper Orbs')888 blocks[0].PlayAlertSound = SOUND_MID_VALUE889 filter_manager.extend_blocks(blocks)890 modify_leveling(filter_manager)891 blocks = filter_manager.add_comment(BLOCK_HIDE_REMAINING, 'HIDE LAYER 5 - Remaining Items')892 blocks[0].status = DEBUG893 filter_manager.extend_blocks(blocks)894 # 8895 blocks = filter_manager.add_comment(3300,896 'CATCHALL - if you see pink items - send me a mail please - should never happen')897 blocks[0].PlayAlertSound = SOUND_TOP_VALUE898 filter_manager.extend_blocks(blocks)899 filter_manager.add_comment(3400, 'Special thanks to!', ignored=True)900def main():901 filter_name = 'res' + os.sep + 'NeverSink\'s filter - 0-SOFT.filter'902 with open(filter_name) as f:903 fm = FilterManager(f.readlines())904 show_rare_classes = [905 ('', 'MODIFY'),906 ('"Helmets"', '1.头'),907 ('"Gloves"', '2.æ'),908 ('"Boots"', '3.è'),909 ('"Body Armour"', '4.è¸'),910 (CLASS_SMALL_ONE_HAND, '5.åæ'),911 ]912 for clazz, gen_filter_name in show_rare_classes:913 fm.clear()...
drag.py
Source:drag.py
...183184data_file_name = raw_input('Enter name of data file: ')185186data=qt.Data(name=data_file_name)187data.add_comment('Number of points in one step is %d' % record_length)188189data.add_comment('Step 1: IDENTITY')190data.add_comment('Step 2: Rx(pi)')191data.add_comment('Step 3: Rx(pi/2)')192data.add_comment('Step 4: Rx(pi)Ry(pi/2)')193data.add_comment('Step 5: Rx(pi)Ry(-pi/2)')194195# data.add_comment('Step 1: IDENTITY')196# data.add_comment('Step 2: Rx(pi)')197# data.add_comment('Step 3: Ry(pi)')198# data.add_comment('Step 4: Rx(-pi)')199# data.add_comment('Step 5: Ry(-pi)')200201# data.add_comment('Step 6: Rx(pi/2)')202# data.add_comment('Step 7: Ry(pi/2)')203# data.add_comment('Step 8: Rx(-pi/2)')204# data.add_comment('Step 9: Ry(-pi/2)')205206# data.add_comment('Step 10: Rx(pi)Rx(pi)')207# data.add_comment('Step 11: Rx(-pi)Rx(-pi)')208# data.add_comment('Step 12: Rx(pi)Ry(pi)')209# data.add_comment('Step 13: Rx(pi)Ry(-pi)')210# data.add_comment('Step 14: Ry(pi)Rx(pi)')211# data.add_comment('Step 15: Ry(pi)Rx(-pi)')212# data.add_comment('Step 16: Ry(pi)Ry(pi)')213# data.add_comment('Step 17: Ry(pi)Ry(-pi)')214215# data.add_comment('Step 18: Rx(pi)Rx(pi/2)')216# data.add_comment('Step 19: Rx(pi)Rx(-pi/2)')217# data.add_comment('Step 20: Rx(pi)Ry(pi/2)')218# data.add_comment('Step 21: Rx(pi)Ry(-pi/2)')219# data.add_comment('Step 22: Ry(pi)Rx(pi/2)')220# data.add_comment('Step 23: Ry(pi)Rx(-pi/2)')221# data.add_comment('Step 24: Ry(pi)Ry(pi/2)')222# data.add_comment('Step 25: Ry(pi)Rx(-pi/2)')223# data.add_comment('Step 26: Rx(pi/2)Rx(pi)')224# data.add_comment('Step 27: Rx(pi/2)Ry(pi)')225# data.add_comment('Step 28: Ry(pi/2)Rx(pi)')226# data.add_comment('Step 29: Ry(pi/2)Ry(pi)')227228# data.add_comment('Step 30: Rx(pi/2)Rx(pi/2)')229# data.add_comment('Step 31: Rx(pi/2)Rx(-pi/2)')230# data.add_comment('Step 32: Rx(pi/2)Ry(pi/2)')231# data.add_comment('Step 33: Rx(pi/2)Ry(-pi/2)')232233# data.add_comment('Step 34: Ry(pi/2)Rx(pi/2)')234# data.add_comment('Step 35: Ry(pi/2)Rx(-pi/2)')235# data.add_comment('Step 36: Ry(pi/2)Ry(pi/2)')236# data.add_comment('Step 37: Ry(pi/2)Ry(-pi/2)')237238# data.add_coordinate('Frequency', units = 'Hz')239data.add_coordinate('Time', units = 's')240241data.add_value('X-Quadrature')242data.add_value('Y-Quadrature')243data.add_value('R-Quadrature')244245#######################################################################246once = True247for D in np.linspace(0, 1, 11):248 uhf.setup_awg(awg_program(D))249 uhf.awg_on(single=False)250
...
views.py
Source:views.py
1from datetime import datetime2from socket import IPV6_DONTFRAG3from django.http import response4from django.shortcuts import render,redirect5from django.views.decorators.csrf import csrf_exempt6from django.contrib.auth.models import User7from .models import Comment,Artikel8from .forms import CommentForm9from django.http.response import HttpResponseNotFound, HttpResponseRedirect10from django.http.response import HttpResponse11from django.core import serializers12# There is no local timezone support, you need to know your timezone13import pytz14utc = pytz.timezone('UTC')15localtz = pytz.timezone('Asia/Jakarta')16# Create your views here.17def index(request, id):18 artikels = Artikel.objects.all().values()19 form = CommentForm(request.POST or None )20 21 response={}22 if request.method == "POST":23 if (form.is_valid):24 print(form.is_valid)25 print(form.is_valid())26 add_comment = form.save(commit=False)27 add_comment.forum = Artikel.objects.get(pk=id)28 add_comment.comment_creator = request.user29 add_comment.forum_creator = Artikel.objects.get(pk=id)30 add_comment.forum_creator_username = add_comment.forum_creator.username31 add_comment.id_forum = add_comment.forum_creator.pk32 add_comment.id_user = request.user.username33 add_comment.comment_creator_username = add_comment.comment_creator.username34 35 36 time_stamp = datetime.utcnow()37 utctime = utc.localize(time_stamp)38 time_stamp_jakarta = localtz.normalize(utctime.astimezone(localtz))39 time_stamp_jakarta =time_stamp_jakarta.strftime("%A, %d %B %Y, %I:%M %p")40 add_comment.created_at = time_stamp_jakarta41 add_comment.save()42 response['form'] = form43 44 return HttpResponseRedirect(request.path_info )45 response['form'] = form46 Comment.forum_creator = Artikel.objects.get(pk = id)47 48 49 50 51 response['forum'] = Comment.forum_creator52 53 comments = Comment.objects.filter(id_forum=id)54 response['comments'] = {'comments': comments}55 print(response)56 return render(request, "comment_list.html", response)57def delete(request,id):58 59 record = Comment.objects.get(id=id)60 record.delete()61 return render(request, "articles.html")62def edit(request,id):63 response={}64 65 if request.method =='POST': 66 record = Comment.objects.get(pk=id)67 record.delete()68 index(request,id)69 70 form = CommentForm( )71 comment = Comment.objects.get(pk=id)72 response["form"] = form73 response["comment"] = comment...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!