Record completed run and streamline reward claim and speedrun notes
This commit is contained in:
@@ -124,6 +124,16 @@ def candidates(state, previous_battle=False, refresh_used=0):
|
|||||||
# Never buy, refresh again, or leave based on that stale inventory.
|
# Never buy, refresh again, or leave based on that stale inventory.
|
||||||
if any('CONNECTING' in t.upper() for t in texts):
|
if any('CONNECTING' in t.upper() for t in texts):
|
||||||
return options
|
return options
|
||||||
|
if '探索完成' in texts:
|
||||||
|
claim = next((i for i in items if i['text'].replace(' ', '') == '领取'
|
||||||
|
and button_enabled(state,i)), None)
|
||||||
|
if claim:
|
||||||
|
options['claim_final'] = {
|
||||||
|
'description':'最终探索完成:点击领取并按回车确认奖励。',
|
||||||
|
'action':{'tool':'claim_final','args':{'x':claim['x']+claim['w']//2,
|
||||||
|
'y':claim['y']+claim['h']//2}},
|
||||||
|
}
|
||||||
|
return options
|
||||||
if '判定成功' in combined or '判定失败' in combined or '结果' in texts:
|
if '判定成功' in combined or '判定失败' in combined or '结果' in texts:
|
||||||
continuation = next((i for i in items if i['text'].replace(' ', '') == '继续'
|
continuation = next((i for i in items if i['text'].replace(' ', '') == '继续'
|
||||||
and button_enabled(state,i)), None)
|
and button_enabled(state,i)), None)
|
||||||
@@ -422,6 +432,12 @@ def decide(cfg, state, options, recent):
|
|||||||
|
|
||||||
|
|
||||||
def execute(bridge, action):
|
def execute(bridge, action):
|
||||||
|
if action['tool'] == 'claim_final':
|
||||||
|
result = bridge.call('click', action['args'])
|
||||||
|
if not result.get('ok'):
|
||||||
|
return result
|
||||||
|
time.sleep(.4)
|
||||||
|
return bridge.call('keypress', {'key':'enter'})
|
||||||
if action['tool'] == 'advance_dialog':
|
if action['tool'] == 'advance_dialog':
|
||||||
for _ in range(min(5, action.get('args', {}).get('presses', 2))):
|
for _ in range(min(5, action.get('args', {}).get('presses', 2))):
|
||||||
result = bridge.call('keypress', {'key': 'enter'})
|
result = bridge.call('keypress', {'key': 'enter'})
|
||||||
|
|||||||
Reference in New Issue
Block a user