Merge pull request #850 from nEEtdo0d/shop_core_v2
Add: re-factor shop module and limited core shop support TODO: re-visit shop module implementation approach, less dependence on getattr and use configs directly
BIN
assets/cn/shop/AMOUNT_MAX.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
assets/cn/shop/AMOUNT_MINUS.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
assets/cn/shop/AMOUNT_PLUS.png
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
assets/cn/shop/SHOP_AMOUNT.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
assets/cn/shop/SHOP_BUY_CONFIRM_AMOUNT.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
assets/cn/shop/SHOP_CORE.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
assets/en/shop/AMOUNT_MAX.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
assets/en/shop/AMOUNT_MINUS.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
assets/en/shop/AMOUNT_PLUS.png
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
assets/en/shop/SHOP_AMOUNT.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
assets/en/shop/SHOP_BUY_CONFIRM_AMOUNT.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
assets/en/shop/SHOP_CORE.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
assets/jp/shop/AMOUNT_MAX.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
assets/jp/shop/AMOUNT_MINUS.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
assets/jp/shop/AMOUNT_PLUS.png
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
assets/jp/shop/SHOP_AMOUNT.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
assets/jp/shop/SHOP_BUY_CONFIRM_AMOUNT.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
assets/jp/shop/SHOP_CORE.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
assets/shop/core/Array.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
assets/shop/core/Array_2.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
assets/shop/core/Chip.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
assets/shop/cost/Core.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
assets/tw/shop/AMOUNT_MAX.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
assets/tw/shop/AMOUNT_MINUS.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
assets/tw/shop/AMOUNT_PLUS.png
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
assets/tw/shop/SHOP_AMOUNT.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
assets/tw/shop/SHOP_BUY_CONFIRM_AMOUNT.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
assets/tw/shop/SHOP_CORE.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
@@ -3396,6 +3396,12 @@
|
|||||||
"type": "textarea",
|
"type": "textarea",
|
||||||
"value": "Cube"
|
"value": "Cube"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"CoreShop": {
|
||||||
|
"Filter": {
|
||||||
|
"type": "textarea",
|
||||||
|
"value": "Array"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Meowfficer": {
|
"Meowfficer": {
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ HpControl:
|
|||||||
RepairUseMultiThreshold: 0.6
|
RepairUseMultiThreshold: 0.6
|
||||||
LowHpRetreatThreshold: 0.3
|
LowHpRetreatThreshold: 0.3
|
||||||
EnemyPriority:
|
EnemyPriority:
|
||||||
EnemyScaleBalanceWeight:
|
EnemyScaleBalanceWeight:
|
||||||
value: default_mode
|
value: default_mode
|
||||||
option: [default_mode, S3_enemy_first, S1_enemy_first]
|
option: [default_mode, S3_enemy_first, S1_enemy_first]
|
||||||
Raid:
|
Raid:
|
||||||
@@ -331,6 +331,9 @@ MeritShop:
|
|||||||
Refresh: false
|
Refresh: false
|
||||||
Filter: |-
|
Filter: |-
|
||||||
Cube
|
Cube
|
||||||
|
CoreShop:
|
||||||
|
Filter: |-
|
||||||
|
Array
|
||||||
Shipyard:
|
Shipyard:
|
||||||
ResearchSeries: 1
|
ResearchSeries: 1
|
||||||
ShipIndex: 0
|
ShipIndex: 0
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ ShopOnce:
|
|||||||
- GuildShop
|
- GuildShop
|
||||||
- MedalShop
|
- MedalShop
|
||||||
- MeritShop
|
- MeritShop
|
||||||
|
- CoreShop
|
||||||
Meowfficer:
|
Meowfficer:
|
||||||
- Scheduler
|
- Scheduler
|
||||||
- Meowfficer
|
- Meowfficer
|
||||||
|
|||||||
@@ -223,6 +223,9 @@ class GeneratedConfig:
|
|||||||
MeritShop_Refresh = False
|
MeritShop_Refresh = False
|
||||||
MeritShop_Filter = 'Cube'
|
MeritShop_Filter = 'Cube'
|
||||||
|
|
||||||
|
# Group `CoreShop`
|
||||||
|
CoreShop_Filter = 'Array'
|
||||||
|
|
||||||
# Group `Shipyard`
|
# Group `Shipyard`
|
||||||
Shipyard_ResearchSeries = 1
|
Shipyard_ResearchSeries = 1
|
||||||
Shipyard_ShipIndex = 0
|
Shipyard_ShipIndex = 0
|
||||||
|
|||||||
@@ -1239,6 +1239,16 @@
|
|||||||
"help": "All options have been defined at <https://github.com/LmeSzinc/AzurLaneAutoScript/wiki/reward_shop_filter_string>"
|
"help": "All options have been defined at <https://github.com/LmeSzinc/AzurLaneAutoScript/wiki/reward_shop_filter_string>"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"CoreShop": {
|
||||||
|
"_info": {
|
||||||
|
"name": "Core Shop Settings",
|
||||||
|
"help": ""
|
||||||
|
},
|
||||||
|
"Filter": {
|
||||||
|
"name": "Item Filter",
|
||||||
|
"help": "All options have been defined at <https://github.com/LmeSzinc/AzurLaneAutoScript/wiki/reward_shop_filter_string>\nHowever unlike other shops, only Chip and Array are supported\nALAS does not browse, scroll, or recognize any other items displayed besides those two"
|
||||||
|
}
|
||||||
|
},
|
||||||
"Shipyard": {
|
"Shipyard": {
|
||||||
"_info": {
|
"_info": {
|
||||||
"name": "Shipyard Settings",
|
"name": "Shipyard Settings",
|
||||||
|
|||||||
@@ -1239,6 +1239,16 @@
|
|||||||
"help": "MeritShop.Filter.help"
|
"help": "MeritShop.Filter.help"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"CoreShop": {
|
||||||
|
"_info": {
|
||||||
|
"name": "CoreShop._info.name",
|
||||||
|
"help": "CoreShop._info.help"
|
||||||
|
},
|
||||||
|
"Filter": {
|
||||||
|
"name": "CoreShop.Filter.name",
|
||||||
|
"help": "CoreShop.Filter.help"
|
||||||
|
}
|
||||||
|
},
|
||||||
"Shipyard": {
|
"Shipyard": {
|
||||||
"_info": {
|
"_info": {
|
||||||
"name": "Shipyard._info.name",
|
"name": "Shipyard._info.name",
|
||||||
|
|||||||
@@ -1239,6 +1239,16 @@
|
|||||||
"help": ""
|
"help": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"CoreShop": {
|
||||||
|
"_info": {
|
||||||
|
"name": "CoreShop._info.name",
|
||||||
|
"help": "CoreShop._info.help"
|
||||||
|
},
|
||||||
|
"Filter": {
|
||||||
|
"name": "CoreShop.Filter.name",
|
||||||
|
"help": "CoreShop.Filter.help"
|
||||||
|
}
|
||||||
|
},
|
||||||
"Shipyard": {
|
"Shipyard": {
|
||||||
"_info": {
|
"_info": {
|
||||||
"name": "开发船坞",
|
"name": "开发船坞",
|
||||||
|
|||||||
@@ -1239,6 +1239,16 @@
|
|||||||
"help": "MeritShop.Filter.help"
|
"help": "MeritShop.Filter.help"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"CoreShop": {
|
||||||
|
"_info": {
|
||||||
|
"name": "CoreShop._info.name",
|
||||||
|
"help": "CoreShop._info.help"
|
||||||
|
},
|
||||||
|
"Filter": {
|
||||||
|
"name": "CoreShop.Filter.name",
|
||||||
|
"help": "CoreShop.Filter.help"
|
||||||
|
}
|
||||||
|
},
|
||||||
"Shipyard": {
|
"Shipyard": {
|
||||||
"_info": {
|
"_info": {
|
||||||
"name": "開發船塢",
|
"name": "開發船塢",
|
||||||
|
|||||||
@@ -4,12 +4,18 @@ from module.base.template import Template
|
|||||||
# This file was automatically generated by dev_tools/button_extract.py.
|
# This file was automatically generated by dev_tools/button_extract.py.
|
||||||
# Don't modify it manually.
|
# Don't modify it manually.
|
||||||
|
|
||||||
|
AMOUNT_MAX = Button(area={'cn': (772, 316, 822, 332), 'en': (772, 316, 822, 332), 'jp': (772, 316, 822, 332), 'tw': (772, 316, 822, 332)}, color={'cn': (148, 178, 225), 'en': (148, 178, 225), 'jp': (148, 178, 225), 'tw': (148, 178, 225)}, button={'cn': (772, 316, 822, 332), 'en': (772, 316, 822, 332), 'jp': (772, 316, 822, 332), 'tw': (772, 316, 822, 332)}, file={'cn': './assets/cn/shop/AMOUNT_MAX.png', 'en': './assets/en/shop/AMOUNT_MAX.png', 'jp': './assets/jp/shop/AMOUNT_MAX.png', 'tw': './assets/tw/shop/AMOUNT_MAX.png'})
|
||||||
|
AMOUNT_MINUS = Button(area={'cn': (546, 304, 586, 344), 'en': (546, 304, 586, 344), 'jp': (546, 304, 586, 344), 'tw': (546, 304, 586, 344)}, color={'cn': (76, 127, 195), 'en': (76, 127, 195), 'jp': (76, 127, 195), 'tw': (76, 127, 195)}, button={'cn': (546, 304, 586, 344), 'en': (546, 304, 586, 344), 'jp': (546, 304, 586, 344), 'tw': (546, 304, 586, 344)}, file={'cn': './assets/cn/shop/AMOUNT_MINUS.png', 'en': './assets/en/shop/AMOUNT_MINUS.png', 'jp': './assets/jp/shop/AMOUNT_MINUS.png', 'tw': './assets/tw/shop/AMOUNT_MINUS.png'})
|
||||||
|
AMOUNT_PLUS = Button(area={'cn': (693, 304, 735, 344), 'en': (693, 304, 735, 344), 'jp': (693, 304, 735, 344), 'tw': (693, 304, 735, 344)}, color={'cn': (81, 130, 196), 'en': (81, 130, 196), 'jp': (81, 130, 196), 'tw': (81, 130, 196)}, button={'cn': (693, 304, 735, 344), 'en': (693, 304, 735, 344), 'jp': (693, 304, 735, 344), 'tw': (693, 304, 735, 344)}, file={'cn': './assets/cn/shop/AMOUNT_PLUS.png', 'en': './assets/en/shop/AMOUNT_PLUS.png', 'jp': './assets/jp/shop/AMOUNT_PLUS.png', 'tw': './assets/tw/shop/AMOUNT_PLUS.png'})
|
||||||
SELECT_MINUS = Button(area={'cn': (562, 201, 588, 227), 'en': (562, 201, 588, 227), 'jp': (562, 201, 588, 227), 'tw': (562, 201, 588, 227)}, color={'cn': (86, 70, 70), 'en': (86, 70, 70), 'jp': (86, 70, 70), 'tw': (86, 70, 70)}, button={'cn': (562, 201, 588, 227), 'en': (562, 201, 588, 227), 'jp': (562, 201, 588, 227), 'tw': (562, 201, 588, 227)}, file={'cn': './assets/cn/shop/SELECT_MINUS.png', 'en': './assets/en/shop/SELECT_MINUS.png', 'jp': './assets/jp/shop/SELECT_MINUS.png', 'tw': './assets/tw/shop/SELECT_MINUS.png'})
|
SELECT_MINUS = Button(area={'cn': (562, 201, 588, 227), 'en': (562, 201, 588, 227), 'jp': (562, 201, 588, 227), 'tw': (562, 201, 588, 227)}, color={'cn': (86, 70, 70), 'en': (86, 70, 70), 'jp': (86, 70, 70), 'tw': (86, 70, 70)}, button={'cn': (562, 201, 588, 227), 'en': (562, 201, 588, 227), 'jp': (562, 201, 588, 227), 'tw': (562, 201, 588, 227)}, file={'cn': './assets/cn/shop/SELECT_MINUS.png', 'en': './assets/en/shop/SELECT_MINUS.png', 'jp': './assets/jp/shop/SELECT_MINUS.png', 'tw': './assets/tw/shop/SELECT_MINUS.png'})
|
||||||
SELECT_PLUS = Button(area={'cn': (674, 201, 700, 227), 'en': (674, 201, 700, 227), 'jp': (674, 201, 700, 227), 'tw': (674, 201, 700, 227)}, color={'cn': (97, 70, 70), 'en': (97, 70, 70), 'jp': (97, 70, 70), 'tw': (97, 70, 70)}, button={'cn': (674, 201, 700, 227), 'en': (674, 201, 700, 227), 'jp': (674, 201, 700, 227), 'tw': (674, 201, 700, 227)}, file={'cn': './assets/cn/shop/SELECT_PLUS.png', 'en': './assets/en/shop/SELECT_PLUS.png', 'jp': './assets/jp/shop/SELECT_PLUS.png', 'tw': './assets/tw/shop/SELECT_PLUS.png'})
|
SELECT_PLUS = Button(area={'cn': (674, 201, 700, 227), 'en': (674, 201, 700, 227), 'jp': (674, 201, 700, 227), 'tw': (674, 201, 700, 227)}, color={'cn': (97, 70, 70), 'en': (97, 70, 70), 'jp': (97, 70, 70), 'tw': (97, 70, 70)}, button={'cn': (674, 201, 700, 227), 'en': (674, 201, 700, 227), 'jp': (674, 201, 700, 227), 'tw': (674, 201, 700, 227)}, file={'cn': './assets/cn/shop/SELECT_PLUS.png', 'en': './assets/en/shop/SELECT_PLUS.png', 'jp': './assets/jp/shop/SELECT_PLUS.png', 'tw': './assets/tw/shop/SELECT_PLUS.png'})
|
||||||
|
SHOP_AMOUNT = Button(area={'cn': (600, 310, 680, 340), 'en': (600, 310, 680, 340), 'jp': (600, 310, 680, 340), 'tw': (600, 310, 680, 340)}, color={'cn': (48, 52, 62), 'en': (48, 52, 62), 'jp': (48, 52, 62), 'tw': (48, 52, 62)}, button={'cn': (600, 310, 680, 340), 'en': (600, 310, 680, 340), 'jp': (600, 310, 680, 340), 'tw': (600, 310, 680, 340)}, file={'cn': './assets/cn/shop/SHOP_AMOUNT.png', 'en': './assets/en/shop/SHOP_AMOUNT.png', 'jp': './assets/jp/shop/SHOP_AMOUNT.png', 'tw': './assets/tw/shop/SHOP_AMOUNT.png'})
|
||||||
SHOP_BUY_CONFIRM = Button(area={'cn': (703, 483, 876, 540), 'en': (708, 487, 872, 534), 'jp': (720, 494, 862, 531), 'tw': (706, 485, 875, 537)}, color={'cn': (94, 142, 203), 'en': (115, 157, 210), 'jp': (100, 147, 205), 'tw': (95, 143, 203)}, button={'cn': (703, 483, 876, 540), 'en': (708, 487, 872, 534), 'jp': (720, 494, 862, 531), 'tw': (706, 485, 875, 537)}, file={'cn': './assets/cn/shop/SHOP_BUY_CONFIRM.png', 'en': './assets/en/shop/SHOP_BUY_CONFIRM.png', 'jp': './assets/jp/shop/SHOP_BUY_CONFIRM.png', 'tw': './assets/tw/shop/SHOP_BUY_CONFIRM.png'})
|
SHOP_BUY_CONFIRM = Button(area={'cn': (703, 483, 876, 540), 'en': (708, 487, 872, 534), 'jp': (720, 494, 862, 531), 'tw': (706, 485, 875, 537)}, color={'cn': (94, 142, 203), 'en': (115, 157, 210), 'jp': (100, 147, 205), 'tw': (95, 143, 203)}, button={'cn': (703, 483, 876, 540), 'en': (708, 487, 872, 534), 'jp': (720, 494, 862, 531), 'tw': (706, 485, 875, 537)}, file={'cn': './assets/cn/shop/SHOP_BUY_CONFIRM.png', 'en': './assets/en/shop/SHOP_BUY_CONFIRM.png', 'jp': './assets/jp/shop/SHOP_BUY_CONFIRM.png', 'tw': './assets/tw/shop/SHOP_BUY_CONFIRM.png'})
|
||||||
|
SHOP_BUY_CONFIRM_AMOUNT = Button(area={'cn': (689, 594, 839, 644), 'en': (689, 594, 839, 644), 'jp': (689, 594, 839, 644), 'tw': (689, 594, 839, 644)}, color={'cn': (103, 146, 197), 'en': (103, 146, 197), 'jp': (103, 146, 197), 'tw': (103, 146, 197)}, button={'cn': (689, 594, 839, 644), 'en': (689, 594, 839, 644), 'jp': (689, 594, 839, 644), 'tw': (689, 594, 839, 644)}, file={'cn': './assets/cn/shop/SHOP_BUY_CONFIRM_AMOUNT.png', 'en': './assets/en/shop/SHOP_BUY_CONFIRM_AMOUNT.png', 'jp': './assets/jp/shop/SHOP_BUY_CONFIRM_AMOUNT.png', 'tw': './assets/tw/shop/SHOP_BUY_CONFIRM_AMOUNT.png'})
|
||||||
SHOP_BUY_CONFIRM_MISTAKE = Button(area={'cn': (590, 300, 612, 318), 'en': (590, 300, 612, 318), 'jp': (590, 300, 612, 318), 'tw': (590, 300, 612, 318)}, color={'cn': (154, 79, 103), 'en': (154, 79, 103), 'jp': (154, 79, 103), 'tw': (154, 79, 103)}, button={'cn': (590, 300, 612, 318), 'en': (590, 300, 612, 318), 'jp': (590, 300, 612, 318), 'tw': (590, 300, 612, 318)}, file={'cn': './assets/cn/shop/SHOP_BUY_CONFIRM_MISTAKE.png', 'en': './assets/en/shop/SHOP_BUY_CONFIRM_MISTAKE.png', 'jp': './assets/jp/shop/SHOP_BUY_CONFIRM_MISTAKE.png', 'tw': './assets/tw/shop/SHOP_BUY_CONFIRM_MISTAKE.png'})
|
SHOP_BUY_CONFIRM_MISTAKE = Button(area={'cn': (590, 300, 612, 318), 'en': (590, 300, 612, 318), 'jp': (590, 300, 612, 318), 'tw': (590, 300, 612, 318)}, color={'cn': (154, 79, 103), 'en': (154, 79, 103), 'jp': (154, 79, 103), 'tw': (154, 79, 103)}, button={'cn': (590, 300, 612, 318), 'en': (590, 300, 612, 318), 'jp': (590, 300, 612, 318), 'tw': (590, 300, 612, 318)}, file={'cn': './assets/cn/shop/SHOP_BUY_CONFIRM_MISTAKE.png', 'en': './assets/en/shop/SHOP_BUY_CONFIRM_MISTAKE.png', 'jp': './assets/jp/shop/SHOP_BUY_CONFIRM_MISTAKE.png', 'tw': './assets/tw/shop/SHOP_BUY_CONFIRM_MISTAKE.png'})
|
||||||
SHOP_BUY_CONFIRM_SELECT = Button(area={'cn': (554, 626, 726, 683), 'en': (567, 630, 712, 675), 'jp': (588, 638, 689, 669), 'tw': (558, 627, 725, 680)}, color={'cn': (225, 155, 61), 'en': (229, 171, 90), 'jp': (230, 170, 89), 'tw': (225, 155, 60)}, button={'cn': (554, 626, 726, 683), 'en': (567, 630, 712, 675), 'jp': (588, 638, 689, 669), 'tw': (558, 627, 725, 680)}, file={'cn': './assets/cn/shop/SHOP_BUY_CONFIRM_SELECT.png', 'en': './assets/en/shop/SHOP_BUY_CONFIRM_SELECT.png', 'jp': './assets/jp/shop/SHOP_BUY_CONFIRM_SELECT.png', 'tw': './assets/tw/shop/SHOP_BUY_CONFIRM_SELECT.png'})
|
SHOP_BUY_CONFIRM_SELECT = Button(area={'cn': (554, 626, 726, 683), 'en': (567, 630, 712, 675), 'jp': (588, 638, 689, 669), 'tw': (558, 627, 725, 680)}, color={'cn': (225, 155, 61), 'en': (229, 171, 90), 'jp': (230, 170, 89), 'tw': (225, 155, 60)}, button={'cn': (554, 626, 726, 683), 'en': (567, 630, 712, 675), 'jp': (588, 638, 689, 669), 'tw': (558, 627, 725, 680)}, file={'cn': './assets/cn/shop/SHOP_BUY_CONFIRM_SELECT.png', 'en': './assets/en/shop/SHOP_BUY_CONFIRM_SELECT.png', 'jp': './assets/jp/shop/SHOP_BUY_CONFIRM_SELECT.png', 'tw': './assets/tw/shop/SHOP_BUY_CONFIRM_SELECT.png'})
|
||||||
SHOP_CLICK_SAFE_AREA = Button(area={'cn': (21, 127, 118, 240), 'en': (21, 127, 118, 240), 'jp': (21, 127, 118, 240), 'tw': (21, 127, 118, 240)}, color={'cn': (16, 18, 25), 'en': (16, 18, 25), 'jp': (16, 18, 25), 'tw': (16, 18, 25)}, button={'cn': (21, 127, 118, 240), 'en': (21, 127, 118, 240), 'jp': (21, 127, 118, 240), 'tw': (21, 127, 118, 240)}, file={'cn': './assets/cn/shop/SHOP_CLICK_SAFE_AREA.png', 'en': './assets/en/shop/SHOP_CLICK_SAFE_AREA.png', 'jp': './assets/jp/shop/SHOP_CLICK_SAFE_AREA.png', 'tw': './assets/tw/shop/SHOP_CLICK_SAFE_AREA.png'})
|
SHOP_CLICK_SAFE_AREA = Button(area={'cn': (21, 127, 118, 240), 'en': (21, 127, 118, 240), 'jp': (21, 127, 118, 240), 'tw': (21, 127, 118, 240)}, color={'cn': (16, 18, 25), 'en': (16, 18, 25), 'jp': (16, 18, 25), 'tw': (16, 18, 25)}, button={'cn': (21, 127, 118, 240), 'en': (21, 127, 118, 240), 'jp': (21, 127, 118, 240), 'tw': (21, 127, 118, 240)}, file={'cn': './assets/cn/shop/SHOP_CLICK_SAFE_AREA.png', 'en': './assets/en/shop/SHOP_CLICK_SAFE_AREA.png', 'jp': './assets/jp/shop/SHOP_CLICK_SAFE_AREA.png', 'tw': './assets/tw/shop/SHOP_CLICK_SAFE_AREA.png'})
|
||||||
|
SHOP_CORE = Button(area={'cn': (1161, 71, 1261, 101), 'en': (1161, 71, 1261, 101), 'jp': (1161, 71, 1261, 101), 'tw': (1161, 71, 1261, 101)}, color={'cn': (68, 71, 82), 'en': (68, 71, 82), 'jp': (68, 71, 82), 'tw': (68, 71, 82)}, button={'cn': (1161, 71, 1261, 101), 'en': (1161, 71, 1261, 101), 'jp': (1161, 71, 1261, 101), 'tw': (1161, 71, 1261, 101)}, file={'cn': './assets/cn/shop/SHOP_CORE.png', 'en': './assets/en/shop/SHOP_CORE.png', 'jp': './assets/jp/shop/SHOP_CORE.png', 'tw': './assets/tw/shop/SHOP_CORE.png'})
|
||||||
SHOP_GEMS = Button(area={'cn': (1035, 23, 1133, 51), 'en': (1035, 23, 1133, 51), 'jp': (1035, 23, 1133, 51), 'tw': (1035, 23, 1133, 51)}, color={'cn': (55, 56, 53), 'en': (55, 56, 53), 'jp': (55, 56, 53), 'tw': (55, 56, 53)}, button={'cn': (1035, 23, 1133, 51), 'en': (1035, 23, 1133, 51), 'jp': (1035, 23, 1133, 51), 'tw': (1035, 23, 1133, 51)}, file={'cn': './assets/cn/shop/SHOP_GEMS.png', 'en': './assets/en/shop/SHOP_GEMS.png', 'jp': './assets/jp/shop/SHOP_GEMS.png', 'tw': './assets/tw/shop/SHOP_GEMS.png'})
|
SHOP_GEMS = Button(area={'cn': (1035, 23, 1133, 51), 'en': (1035, 23, 1133, 51), 'jp': (1035, 23, 1133, 51), 'tw': (1035, 23, 1133, 51)}, color={'cn': (55, 56, 53), 'en': (55, 56, 53), 'jp': (55, 56, 53), 'tw': (55, 56, 53)}, button={'cn': (1035, 23, 1133, 51), 'en': (1035, 23, 1133, 51), 'jp': (1035, 23, 1133, 51), 'tw': (1035, 23, 1133, 51)}, file={'cn': './assets/cn/shop/SHOP_GEMS.png', 'en': './assets/en/shop/SHOP_GEMS.png', 'jp': './assets/jp/shop/SHOP_GEMS.png', 'tw': './assets/tw/shop/SHOP_GEMS.png'})
|
||||||
SHOP_GENERAL_SWIPE_END = Button(area={'cn': (1151, 673, 1221, 693), 'en': (1109, 677, 1201, 692), 'jp': (1158, 676, 1222, 693), 'tw': (1143, 671, 1221, 703)}, color={'cn': (114, 114, 119), 'en': (114, 115, 118), 'jp': (138, 138, 141), 'tw': (79, 80, 88)}, button={'cn': (1151, 673, 1221, 693), 'en': (1109, 677, 1201, 692), 'jp': (1158, 676, 1222, 693), 'tw': (1143, 671, 1221, 703)}, file={'cn': './assets/cn/shop/SHOP_GENERAL_SWIPE_END.png', 'en': './assets/en/shop/SHOP_GENERAL_SWIPE_END.png', 'jp': './assets/jp/shop/SHOP_GENERAL_SWIPE_END.png', 'tw': './assets/tw/shop/SHOP_GENERAL_SWIPE_END.png'})
|
SHOP_GENERAL_SWIPE_END = Button(area={'cn': (1151, 673, 1221, 693), 'en': (1109, 677, 1201, 692), 'jp': (1158, 676, 1222, 693), 'tw': (1143, 671, 1221, 703)}, color={'cn': (114, 114, 119), 'en': (114, 115, 118), 'jp': (138, 138, 141), 'tw': (79, 80, 88)}, button={'cn': (1151, 673, 1221, 693), 'en': (1109, 677, 1201, 692), 'jp': (1158, 676, 1222, 693), 'tw': (1143, 671, 1221, 703)}, file={'cn': './assets/cn/shop/SHOP_GENERAL_SWIPE_END.png', 'en': './assets/en/shop/SHOP_GENERAL_SWIPE_END.png', 'jp': './assets/jp/shop/SHOP_GENERAL_SWIPE_END.png', 'tw': './assets/tw/shop/SHOP_GENERAL_SWIPE_END.png'})
|
||||||
SHOP_GOLD_COINS = Button(area={'cn': (815, 23, 922, 51), 'en': (815, 23, 922, 51), 'jp': (815, 23, 922, 51), 'tw': (815, 23, 922, 51)}, color={'cn': (61, 61, 73), 'en': (61, 61, 73), 'jp': (61, 61, 73), 'tw': (61, 61, 73)}, button={'cn': (815, 23, 922, 51), 'en': (815, 23, 922, 51), 'jp': (815, 23, 922, 51), 'tw': (815, 23, 922, 51)}, file={'cn': './assets/cn/shop/SHOP_GOLD_COINS.png', 'en': './assets/en/shop/SHOP_GOLD_COINS.png', 'jp': './assets/jp/shop/SHOP_GOLD_COINS.png', 'tw': './assets/tw/shop/SHOP_GOLD_COINS.png'})
|
SHOP_GOLD_COINS = Button(area={'cn': (815, 23, 922, 51), 'en': (815, 23, 922, 51), 'jp': (815, 23, 922, 51), 'tw': (815, 23, 922, 51)}, color={'cn': (61, 61, 73), 'en': (61, 61, 73), 'jp': (61, 61, 73), 'tw': (61, 61, 73)}, button={'cn': (815, 23, 922, 51), 'en': (815, 23, 922, 51), 'jp': (815, 23, 922, 51), 'tw': (815, 23, 922, 51)}, file={'cn': './assets/cn/shop/SHOP_GOLD_COINS.png', 'en': './assets/en/shop/SHOP_GOLD_COINS.png', 'jp': './assets/jp/shop/SHOP_GOLD_COINS.png', 'tw': './assets/tw/shop/SHOP_GOLD_COINS.png'})
|
||||||
|
|||||||
@@ -184,34 +184,57 @@ class ShopBase(UI):
|
|||||||
logger.warning(f'shop_check_item --> Missing func shop_{key}_check_item')
|
logger.warning(f'shop_check_item --> Missing func shop_{key}_check_item')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _is_shop_custom_item(self, item, shop_type='general'):
|
def shop_check_custom_item(self, item, key='general'):
|
||||||
"""
|
"""
|
||||||
Buy custom items without the restriction of filter string.
|
Buy custom items without the restriction of filter string.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
item (Item):
|
item (Item):
|
||||||
shop_type (str): String assists with shop_get_items
|
key (str): String identifies shop_x_check_custom_item
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
bool:
|
bool:
|
||||||
"""
|
"""
|
||||||
if shop_type == 'general':
|
try:
|
||||||
if self.config.GeneralShop_BuySkinBox:
|
return self.__getattribute__(f'shop_{key}_check_custom_item')(item)
|
||||||
if (not item.is_known_item()) and item.amount == 1 and item.cost == 'Coins' and item.price == 7000:
|
except AttributeError:
|
||||||
logger.info(f'Item {item} is considered to be an equip skin box')
|
# Not considered an error; optional func for shop_x to define
|
||||||
try:
|
return False
|
||||||
if self._shop_gold_coins > item.price:
|
|
||||||
return True
|
|
||||||
except AttributeError:
|
|
||||||
logger.warning('Missing _shop_gold_coins')
|
|
||||||
|
|
||||||
return False
|
def shop_interval_clear(self, key='general'):
|
||||||
|
"""
|
||||||
|
Args:
|
||||||
|
key (str): String identifies shop_x_interval_clear
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
bool:
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
self.__getattribute__(f'shop_{key}_interval_clear')()
|
||||||
|
except AttributeError:
|
||||||
|
# Not considered an error; optional func for shop_x to define
|
||||||
|
pass
|
||||||
|
|
||||||
|
def shop_buy_handle(self, item, key='general'):
|
||||||
|
"""
|
||||||
|
Args:
|
||||||
|
item (Item):
|
||||||
|
key (str): String identifies shop_x_buy_handle
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
bool:
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
return self.__getattribute__(f'shop_{key}_buy_handle')(item)
|
||||||
|
except AttributeError:
|
||||||
|
# Not considered an error; optional func for shop_x to define
|
||||||
|
return False
|
||||||
|
|
||||||
def shop_get_item_to_buy(self, items, shop_type='general', selection=''):
|
def shop_get_item_to_buy(self, items, shop_type='general', selection=''):
|
||||||
"""
|
"""
|
||||||
Args:
|
Args:
|
||||||
items list(Item): acquired from shop_get_items
|
items list(Item): acquired from shop_get_items
|
||||||
shop_type (str): assists with _is_shop_custom_item
|
shop_type (str): assists with shop_check*_item
|
||||||
selection (str): user configured value, items desired
|
selection (str): user configured value, items desired
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@@ -231,7 +254,7 @@ class ShopBase(UI):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
for item in items:
|
for item in items:
|
||||||
if self._is_shop_custom_item(item, shop_type=shop_type):
|
if self.shop_check_custom_item(item, key=shop_type):
|
||||||
return item
|
return item
|
||||||
if select not in item.alt_name:
|
if select not in item.alt_name:
|
||||||
continue
|
continue
|
||||||
@@ -242,10 +265,11 @@ class ShopBase(UI):
|
|||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def shop_buy_execute(self, item, skip_first_screenshot=True):
|
def shop_buy_execute(self, item, key='general', skip_first_screenshot=True):
|
||||||
"""
|
"""
|
||||||
Args:
|
Args:
|
||||||
item: Item/Button to click and buy
|
item: Item to check
|
||||||
|
key: String identifies shop_x_* companion funcs
|
||||||
skip_first_screenshot: bool
|
skip_first_screenshot: bool
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@@ -254,6 +278,7 @@ class ShopBase(UI):
|
|||||||
success = False
|
success = False
|
||||||
self.interval_clear(BACK_ARROW)
|
self.interval_clear(BACK_ARROW)
|
||||||
self.interval_clear(SHOP_BUY_CONFIRM)
|
self.interval_clear(SHOP_BUY_CONFIRM)
|
||||||
|
self.shop_interval_clear(key)
|
||||||
|
|
||||||
while 1:
|
while 1:
|
||||||
if skip_first_screenshot:
|
if skip_first_screenshot:
|
||||||
@@ -267,6 +292,9 @@ class ShopBase(UI):
|
|||||||
if self.appear_then_click(SHOP_BUY_CONFIRM, offset=(20, 20), interval=3):
|
if self.appear_then_click(SHOP_BUY_CONFIRM, offset=(20, 20), interval=3):
|
||||||
self.interval_reset(BACK_ARROW)
|
self.interval_reset(BACK_ARROW)
|
||||||
continue
|
continue
|
||||||
|
if self.shop_buy_handle(item, key):
|
||||||
|
self.interval_reset(BACK_ARROW)
|
||||||
|
continue
|
||||||
if self.appear(GET_SHIP, interval=1):
|
if self.appear(GET_SHIP, interval=1):
|
||||||
self.device.click(SHOP_CLICK_SAFE_AREA)
|
self.device.click(SHOP_CLICK_SAFE_AREA)
|
||||||
self.interval_reset(BACK_ARROW)
|
self.interval_reset(BACK_ARROW)
|
||||||
@@ -309,7 +337,7 @@ class ShopBase(UI):
|
|||||||
logger.info('Shop buy finished')
|
logger.info('Shop buy finished')
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
self.shop_buy_execute(item)
|
self.shop_buy_execute(item, shop_type)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
logger.warning('Too many items to buy, stopped')
|
logger.warning('Too many items to buy, stopped')
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ BP_SERIES = {
|
|||||||
# Known items with no tiers
|
# Known items with no tiers
|
||||||
ITEM_NO_TIERS = [
|
ITEM_NO_TIERS = [
|
||||||
'Chip',
|
'Chip',
|
||||||
|
'Array',
|
||||||
'Drill',
|
'Drill',
|
||||||
'Cube',
|
'Cube',
|
||||||
]
|
]
|
||||||
|
|||||||
111
module/shop/shop_core.py
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
from module.base.button import ButtonGrid
|
||||||
|
from module.base.decorator import cached_property
|
||||||
|
from module.logger import logger
|
||||||
|
from module.ocr.ocr import Digit
|
||||||
|
from module.shop.assets import *
|
||||||
|
from module.shop.base import ShopBase, ShopItemGrid
|
||||||
|
|
||||||
|
OCR_SHOP_CORE = Digit(SHOP_CORE, letter=(239, 239, 239), name='OCR_SHOP_CORE')
|
||||||
|
OCR_SHOP_AMOUNT = Digit(SHOP_AMOUNT, letter=(239, 239, 239), name='OCR_SHOP_AMOUNT')
|
||||||
|
|
||||||
|
|
||||||
|
class CoreShop(ShopBase):
|
||||||
|
_shop_core = 0
|
||||||
|
|
||||||
|
def shop_core_get_currency(self):
|
||||||
|
"""
|
||||||
|
Ocr shop core currency
|
||||||
|
"""
|
||||||
|
self._shop_core = OCR_SHOP_CORE.ocr(self.device.image)
|
||||||
|
logger.info(f'Core: {self._shop_core}')
|
||||||
|
return self._shop_core
|
||||||
|
|
||||||
|
@cached_property
|
||||||
|
def shop_core_items(self):
|
||||||
|
"""
|
||||||
|
Returns:
|
||||||
|
ShopItemGrid:
|
||||||
|
"""
|
||||||
|
shop_grid = self.shop_grid
|
||||||
|
shop_core_items = ShopItemGrid(shop_grid, templates={}, amount_area=(60, 74, 96, 95))
|
||||||
|
shop_core_items.load_template_folder('./assets/shop/core')
|
||||||
|
shop_core_items.load_cost_template_folder('./assets/shop/cost')
|
||||||
|
return shop_core_items
|
||||||
|
|
||||||
|
def shop_core_check_item(self, item):
|
||||||
|
"""
|
||||||
|
Args:
|
||||||
|
item: Item to check
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
bool:
|
||||||
|
"""
|
||||||
|
if item.price > self._shop_core:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
def shop_buy_amount_execute(self, item):
|
||||||
|
"""
|
||||||
|
Args:
|
||||||
|
item: Item to check
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
bool: implicating failed to execute
|
||||||
|
"""
|
||||||
|
index_offset = (40, 20)
|
||||||
|
limit = 0
|
||||||
|
|
||||||
|
# In case either -/+ shift position, use
|
||||||
|
# shipyard ocr trick to accurately parse
|
||||||
|
self.appear(AMOUNT_MINUS, offset=index_offset)
|
||||||
|
self.appear(AMOUNT_PLUS, offset=index_offset)
|
||||||
|
area = OCR_SHOP_AMOUNT.buttons[0]
|
||||||
|
OCR_SHOP_AMOUNT.buttons = [(AMOUNT_MINUS.button[2] + 3, area[1], AMOUNT_PLUS.button[0] - 3, area[3])]
|
||||||
|
|
||||||
|
# Total number that can be purchased
|
||||||
|
# altogether based on clicking max
|
||||||
|
# Needs small delay for stable image
|
||||||
|
self.appear_then_click(AMOUNT_MAX)
|
||||||
|
self.device.sleep((0.3, 0.5))
|
||||||
|
self.device.screenshot()
|
||||||
|
limit = OCR_SHOP_AMOUNT.ocr(self.device.image)
|
||||||
|
if not limit:
|
||||||
|
self.device.click(SHOP_CLICK_SAFE_AREA) # Close amount prompt
|
||||||
|
return False
|
||||||
|
|
||||||
|
# Adjust purchase amount if needed
|
||||||
|
while 1:
|
||||||
|
if (limit * item.price) <= self._shop_core:
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
limit -= 1
|
||||||
|
|
||||||
|
self.ui_ensure_index(limit, letter=OCR_SHOP_AMOUNT, prev_button=AMOUNT_MINUS, next_button=AMOUNT_PLUS,
|
||||||
|
skip_first_screenshot=True)
|
||||||
|
self.device.click(SHOP_BUY_CONFIRM_AMOUNT)
|
||||||
|
return True
|
||||||
|
|
||||||
|
def shop_core_interval_clear(self):
|
||||||
|
"""
|
||||||
|
Clear interval on select assets for
|
||||||
|
shop_core_buy_handle
|
||||||
|
"""
|
||||||
|
self.interval_clear(SHOP_BUY_CONFIRM_AMOUNT)
|
||||||
|
|
||||||
|
def shop_core_buy_handle(self, item):
|
||||||
|
"""
|
||||||
|
Handle shop_core buy interface if detected
|
||||||
|
|
||||||
|
Args:
|
||||||
|
item: Item to handle
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
bool: whether interface was detected and handled
|
||||||
|
"""
|
||||||
|
if self.appear(SHOP_BUY_CONFIRM_AMOUNT, offset=(20, 20), interval=3):
|
||||||
|
if not self.shop_buy_amount_execute(item):
|
||||||
|
logger.warning('Failed to purchase amount item')
|
||||||
|
self.interval_reset(SHOP_BUY_CONFIRM_AMOUNT)
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
@@ -52,3 +52,23 @@ class GeneralShop(ShopBase):
|
|||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def shop_general_check_custom_item(self, item):
|
||||||
|
"""
|
||||||
|
Optional def to check a custom item that
|
||||||
|
cannot be template matched as color and
|
||||||
|
design constantly changes i.e. equip skin box
|
||||||
|
|
||||||
|
Args:
|
||||||
|
item: Item to check
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
bool: whether item is custom
|
||||||
|
"""
|
||||||
|
if self.config.GeneralShop_BuySkinBox:
|
||||||
|
if (not item.is_known_item()) and item.amount == 1 and item.cost == 'Coins' and item.price == 7000:
|
||||||
|
logger.info(f'Item {item} is considered to be an equip skin box')
|
||||||
|
if self._shop_gold_coins >= item.price:
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class GuildShop(ShopBase):
|
|||||||
shop_guild_items.load_template_folder('./assets/shop/guild_cn')
|
shop_guild_items.load_template_folder('./assets/shop/guild_cn')
|
||||||
shop_guild_items.load_cost_template_folder('./assets/shop/cost')
|
shop_guild_items.load_cost_template_folder('./assets/shop/cost')
|
||||||
return shop_guild_items
|
return shop_guild_items
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
@Config.when(SERVER='tw')
|
@Config.when(SERVER='tw')
|
||||||
def shop_guild_items(self):
|
def shop_guild_items(self):
|
||||||
@@ -159,7 +159,7 @@ class GuildShop(ShopBase):
|
|||||||
item: Item to check
|
item: Item to check
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
None: implicating failed to execute
|
bool: implicating failed to execute
|
||||||
"""
|
"""
|
||||||
# Base Case - Must have 'secondary_grid' attr and must not be None
|
# Base Case - Must have 'secondary_grid' attr and must not be None
|
||||||
if not hasattr(item, 'secondary_grid') or item.secondary_grid is None:
|
if not hasattr(item, 'secondary_grid') or item.secondary_grid is None:
|
||||||
@@ -223,56 +223,28 @@ class GuildShop(ShopBase):
|
|||||||
self.device.click(SHOP_BUY_CONFIRM_SELECT)
|
self.device.click(SHOP_BUY_CONFIRM_SELECT)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def shop_buy_execute(self, item, skip_first_screenshot=True):
|
def shop_guild_interval_clear(self):
|
||||||
"""
|
"""
|
||||||
Extended from 'ShopBase' to include handling of
|
Clear interval on select assets for
|
||||||
purchases in items that have a secondary_grid
|
shop_guild_buy_handle
|
||||||
|
|
||||||
Args:
|
|
||||||
item: Item to click and buy
|
|
||||||
skip_first_screenshot: bool
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
None: exits appropriately therefore successful
|
|
||||||
"""
|
"""
|
||||||
success = False
|
|
||||||
self.interval_clear(BACK_ARROW)
|
|
||||||
self.interval_clear(SHOP_BUY_CONFIRM)
|
|
||||||
self.interval_clear(SHOP_BUY_CONFIRM_SELECT)
|
self.interval_clear(SHOP_BUY_CONFIRM_SELECT)
|
||||||
|
|
||||||
while 1:
|
def shop_guild_buy_handle(self, item):
|
||||||
if skip_first_screenshot:
|
"""
|
||||||
skip_first_screenshot = False
|
Handle shop_guild buy interface if detected
|
||||||
else:
|
|
||||||
self.device.screenshot()
|
|
||||||
|
|
||||||
if self.appear(BACK_ARROW, offset=(20, 20), interval=3):
|
Args:
|
||||||
self.device.click(item)
|
item: Item to handle
|
||||||
continue
|
|
||||||
if self.appear_then_click(SHOP_BUY_CONFIRM, offset=(20, 20), interval=3):
|
|
||||||
self.interval_reset(BACK_ARROW)
|
|
||||||
continue
|
|
||||||
if self.appear(GET_SHIP, interval=1):
|
|
||||||
self.device.click(SHOP_CLICK_SAFE_AREA)
|
|
||||||
self.interval_reset(BACK_ARROW)
|
|
||||||
continue
|
|
||||||
if self.appear(SHOP_BUY_CONFIRM_SELECT, offset=(20, 20), interval=3):
|
|
||||||
if not self.shop_buy_select_execute(item):
|
|
||||||
logger.warning('Failed to purchase secondary '
|
|
||||||
'grid item')
|
|
||||||
self.interval_reset(BACK_ARROW)
|
|
||||||
self.interval_reset(SHOP_BUY_CONFIRM_SELECT)
|
|
||||||
continue
|
|
||||||
if self.appear(GET_ITEMS_1, interval=1):
|
|
||||||
self.device.click(SHOP_CLICK_SAFE_AREA)
|
|
||||||
self.interval_reset(BACK_ARROW)
|
|
||||||
success = True
|
|
||||||
continue
|
|
||||||
if self.handle_info_bar():
|
|
||||||
self.interval_reset(BACK_ARROW)
|
|
||||||
success = True
|
|
||||||
continue
|
|
||||||
|
|
||||||
# End
|
Returns:
|
||||||
if success and self.appear(BACK_ARROW, offset=(20, 20)):
|
bool: whether interface was detected and handled
|
||||||
break
|
"""
|
||||||
|
if self.appear(SHOP_BUY_CONFIRM_SELECT, offset=(20, 20), interval=3):
|
||||||
|
if not self.shop_buy_select_execute(item):
|
||||||
|
logger.warning('Failed to purchase secondary '
|
||||||
|
'grid item')
|
||||||
|
self.interval_reset(SHOP_BUY_CONFIRM_SELECT)
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
from module.config.utils import get_server_last_update
|
from module.config.utils import get_server_last_update
|
||||||
from module.gacha.ui import GachaUI
|
from module.gacha.ui import GachaUI
|
||||||
from module.logger import logger
|
from module.logger import logger
|
||||||
|
from module.shop.shop_core import CoreShop
|
||||||
from module.shop.shop_general import GeneralShop
|
from module.shop.shop_general import GeneralShop
|
||||||
from module.shop.shop_guild import GuildShop
|
from module.shop.shop_guild import GuildShop
|
||||||
from module.shop.shop_medal import MedalShop
|
from module.shop.shop_medal import MedalShop
|
||||||
@@ -8,7 +9,7 @@ from module.shop.shop_merit import MeritShop
|
|||||||
from module.shop.ui import ShopUI
|
from module.shop.ui import ShopUI
|
||||||
|
|
||||||
|
|
||||||
class RewardShop(GachaUI, ShopUI, GeneralShop, GuildShop, MedalShop, MeritShop):
|
class RewardShop(GachaUI, ShopUI, CoreShop, GeneralShop, GuildShop, MedalShop, MeritShop):
|
||||||
def _shop_visit(self, shop_type='general'):
|
def _shop_visit(self, shop_type='general'):
|
||||||
"""
|
"""
|
||||||
Helper func to determine whether worth visiting and browsing the shop
|
Helper func to determine whether worth visiting and browsing the shop
|
||||||
@@ -66,6 +67,12 @@ class RewardShop(GachaUI, ShopUI, GeneralShop, GuildShop, MedalShop, MeritShop):
|
|||||||
if self.shop_bottom_navbar_ensure(left=4):
|
if self.shop_bottom_navbar_ensure(left=4):
|
||||||
self._shop_repeat(shop_type='merit')
|
self._shop_repeat(shop_type='merit')
|
||||||
|
|
||||||
|
if self._shop_visit('core'):
|
||||||
|
logger.hr('Core shop', level=1)
|
||||||
|
if self.shop_bottom_navbar_ensure(left=3):
|
||||||
|
self.shop_buy(shop_type='core',
|
||||||
|
selection=self.config.CoreShop_Filter)
|
||||||
|
|
||||||
if self._shop_visit('guild'):
|
if self._shop_visit('guild'):
|
||||||
logger.hr('Guild shop', level=1)
|
logger.hr('Guild shop', level=1)
|
||||||
if self.shop_bottom_navbar_ensure(left=1):
|
if self.shop_bottom_navbar_ensure(left=1):
|
||||||
|
|||||||