Skip to content

Commit

Permalink
UI调整 地下城商店
Browse files Browse the repository at this point in the history
  • Loading branch information
mackerel-12138 committed Apr 17, 2023
1 parent 5b312ad commit 0a3321f
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 29 deletions.
74 changes: 64 additions & 10 deletions AutoPcr_py/AutoPcr4.0.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def GetFullPath(pngName):
dxcDropKey = 'dxcDrop'
mnqIndexKey = 'mnqDrop'
buyExpNumKey = 'buyExpNumDrop'
buyDxcNumKey = 'buyDxcNumDrop'
buyDxcRowKey = 'buyDxcRowDrop'
dxcDropValue = ["炸脖龙", "绿龙", "黑白王"]
mnqIndexDropValue = ["1", "0"]

Expand Down Expand Up @@ -1096,8 +1098,8 @@ def StartNormalFight():

# endregion
def BuyExp():
# TODO 石头 界面选择 次数限制
logger.info('买经验和石头, 购买数量' + str(buyExpNum))
# TODO 次数限制
logger.info('商店-通常, 购买数量' + str(buyExpNum))
ToHomePage()
ToShopPage()
WaitToClickImg('img/shop/shopTop.png', False)
Expand Down Expand Up @@ -1132,6 +1134,38 @@ def BuyExp():
ToHomePage()


def BuyDxc():
logger.info('商店-地下城, 购买行数' + str(buyDxcRow) + ', 购买次数' + str(buyDxcNum))
ToHomePage()
ToShopPage()
WaitToClickImg('img/shop/shopTop.png', False)
if IsHasImg('img/shop/shopTop.png', False):
WaitToClickImg('img/shop/dxc.png')
else:
BuyDxc()

for i in range(buyDxcNum):
logger.info('购买中, 当前次数: ' + str(i + 1))

for j in range(buyDxcRow):
expCounter = 1
while expCounter <= 4 and IsHasImg('img/shop/exp.png'):
expCounter = expCounter + 1
print('IsHasImg', expCounter)
scroll_down(SCROLL_KEYS_1, SCROLL_200MS)
WaitToClickImg('img/shop/buyBtn.png')
WaitToClickImg('img/shop/buyTitle.png', False)
WaitToClickImg('img/main/sure.png')
time.sleep(0.5)
WaitToClickImg('img/main/sure.png')

if i + 1 != buyDxcNum:
WaitToClickImg('img/shop/update.png')
WaitToClickImg('img/main/sure.png')

ToHomePage()


def NiuDan():
# TODO 按键位置
WaitToClickImg('img/main/niuDan.png')
Expand Down Expand Up @@ -1400,12 +1434,18 @@ def OnAutoTask():
# def SkipDuiHua():


def OnHouDongHard():
logger.info('开始剧情活动')
def OnHuoDongHard(hd='jqhd'):
huoDongkey = 'img/huodong/jqhd.png'
if hd == 'fkhd':
logger.info('开始复刻活动')
huoDongkey = 'img/huodong/fkhd.png'
else:
logger.info('开始剧情活动')

ToFightPage()
WaitToClickImg('img/main/dxc.png', False)
# DoKeyDown(huodongKey)
WaitToClickImg('img/huodong/jqhd.png')
WaitToClickImg(huoDongkey)
DoKeyDown(exitKey)
DoKeyDown(exitKey)

Expand All @@ -1423,7 +1463,9 @@ def OnHouDongHard():
logger.info('刷剧情活动关卡' + huoDongHard)
if huoDongHard:
beats = list(huoDongHard)
WaitToClickImg('img/huodong/jqhd1-5.png')
x, y = GetImgXY('img/huodong/jqhd1-5.png')
Click(x, y - 50)
# WaitToClickImg('img/huodong/jqhd1-5.png')
for i in range(5):
time.sleep(1)
if str(5 - i) not in beats:
Expand Down Expand Up @@ -1493,6 +1535,8 @@ def DianZan():
def DailyTasks():
if isExp or isStone:
BuyExp()
if isDxcShop:
BuyDxc()
if (isNiuDan):
NiuDan()
if (isTansuo):
Expand All @@ -1518,8 +1562,10 @@ def DailyTasks():
needSeedZbStart()
if (isDianZan):
DianZan()
if (isHouDongHard):
OnHouDongHard()
if isJuQingHuoDong:
OnHuoDongHard('jqhd')
if isFuKeHuoDong:
OnHuoDongHard('fkhd')
if (isTuitu):
OnTuitu()
if (isHomeTake):
Expand Down Expand Up @@ -1658,6 +1704,7 @@ def GetIntConfig(key):
dxcGroupDaoZhongKey = 'DxcGroupDaoZhong'
isExpKey = 'isExp'
isStoneKey = 'isStone'
isDxcShopKey = 'isDxcShop'
isNiuDanKey = 'isNiuDan'
LeiDianDirKey = 'LeiDianDir'
isRunAndStartKey = 'isRunAndStart'
Expand All @@ -1674,7 +1721,9 @@ def GetIntConfig(key):
isNeedSeedKey = 'isNeedSeed'

isHomeTakeKey = 'isHomeTake'
isHouDongHardKey = 'isHouDongHard'
isJuQingHuoDongKey = 'isJuQingHuoDong'
isFuKeHuoDongKey = 'isFuKeHuoDong'
isHuoDongHardKey = 'isHuoDongHard'
huoDongHardKeys = 'huoDongHard'
needZbNameKey = 'needZbName'

Expand All @@ -1691,6 +1740,9 @@ def GetIntConfig(key):
isExp = GetBoolConfig(isExpKey)
isStone = GetBoolConfig(isStoneKey)
buyExpNum = GetIntConfig(buyExpNumKey)
isDxcShop = GetBoolConfig(isDxcShopKey)
buyDxcNum = GetIntConfig(buyDxcNumKey)
buyDxcRow = GetIntConfig(buyDxcRowKey)
isNiuDan = GetBoolConfig(isNiuDanKey)
LeiDianDir = cfg.get('MainSetting', LeiDianDirKey)

Expand All @@ -1705,7 +1757,9 @@ def GetIntConfig(key):
isFor64 = GetBoolConfig(isFor64Key)
isAutoTask = GetBoolConfig(isAutoTaskKey)
isHomeTake = GetBoolConfig(isHomeTakeKey)
isHouDongHard = GetBoolConfig(isHouDongHardKey)
isJuQingHuoDong = GetBoolConfig(isJuQingHuoDongKey)
isFuKeHuoDong = GetBoolConfig(isFuKeHuoDongKey)
isHuoDongHard = GetBoolConfig(isHuoDongHardKey)
huoDongHard = GetStrConfig(huoDongHardKeys)
isVHBoss = GetBoolConfig(isVHBossKey)
isDianZan = GetBoolConfig(isDianZanKey)
Expand Down
21 changes: 13 additions & 8 deletions AutoPcr_py/AutoPcr4.0_GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def SetMnqDir():
isHomeTakeKey = 'isHomeTake'
isJuQingHuoDongKey = 'isJuQingHuoDong'
isFuKeHuoDongKey = 'isFuKeHuoDong'
isHouDongHardKey = 'isHouDongHard'
isHuoDongHardKey = 'isHuoDongHard'
huoDongHardKeys = 'huoDongHard'
isVHBossKey = 'isVHBoss'
needZbNameKey = 'needZbName'
Expand Down Expand Up @@ -171,7 +171,7 @@ def SetMnqDir():
isHomeTake = GetBoolConfig(isHomeTakeKey)
isJuQingHuoDong = GetBoolConfig(isJuQingHuoDongKey)
isFuKeHuoDong = GetBoolConfig(isFuKeHuoDongKey)
isHouDongHard = GetBoolConfig(isHouDongHardKey)
isHuoDongHard = GetBoolConfig(isHuoDongHardKey)
huoDongHard = GetStrConfig(huoDongHardKeys)
isVHBoss = GetBoolConfig(isVHBossKey)
isDianZan = GetBoolConfig(isDianZanKey)
Expand Down Expand Up @@ -218,7 +218,7 @@ def SavaConfig(AllValues):
SetConfigAuto(isHomeTakeKey, AllValues)
SetConfigAuto(isJuQingHuoDongKey, AllValues)
SetConfigAuto(isFuKeHuoDongKey, AllValues)
SetConfigAuto(isHouDongHardKey, AllValues)
SetConfigAuto(isHuoDongHardKey, AllValues)
SetConfigAuto(huoDongHardKeys, AllValues)
SetConfigAuto(isVHBossKey, AllValues)
SetConfigAuto(isDianZanKey, AllValues)
Expand Down Expand Up @@ -255,7 +255,7 @@ def ReadConfig():
ReadBoolConfig(isHomeTakeKey)
ReadBoolConfig(isJuQingHuoDongKey)
ReadBoolConfig(isFuKeHuoDongKey)
ReadBoolConfig(isHouDongHardKey)
ReadBoolConfig(isHuoDongHardKey)
ReadStrConfig(huoDongHardKeys)
ReadBoolConfig(isVHBossKey)
ReadBoolConfig(isTuituKey)
Expand Down Expand Up @@ -340,11 +340,11 @@ def StartPcr():
[
sg.Checkbox('购买经验', isExp, key=isExpKey),
sg.Checkbox('购买石头', isStone, key=isStoneKey),
sg.Text('购买次数'),
sg.Text('次数'),
sg.DropDown(buyExpNumValue, buyExpNum, key=buyExpNumKey, size=(2, None)),
],
[
sg.Checkbox('消耗地下城币', isDxcShop, key=isDxcShopKey),
sg.Checkbox('地下城商店', isDxcShop, key=isDxcShopKey),
sg.Text('行数'),
sg.DropDown(buyDxcRowValue, buyDxcRow, key=buyDxcRowKey, size=(2, None)),
sg.Text('次数'),
Expand Down Expand Up @@ -373,7 +373,7 @@ def StartPcr():
sg.Checkbox('复刻活动', isFuKeHuoDong, key=isFuKeHuoDongKey),
],
[
sg.Checkbox('困难本', isHouDongHard, key=isHouDongHardKey),
sg.Checkbox('困难本', isHuoDongHard, key=isHuoDongHardKey),
sg.Text('关卡'),
sg.InputText(huoDongHard, size=(8, None), key=huoDongHardKeys),
sg.Checkbox('VHBoss', isVHBoss, key=isVHBossKey)
Expand Down Expand Up @@ -408,7 +408,12 @@ def StartPcr():
[sg.Text('模拟器启动等待时间'), sg.InputText(moniqTime, size=(6, None), key=moniqTimeKey)],
[sg.Text('雷电模拟器文件夹:')],
[sg.InputText(LeiDianDir, size=(30, None), key=LeiDianDirKey), sg.FolderBrowse()],
[sg.Button('保存配置'), sg.Button(StartRunName), sg.Button(RunName), sg.Button('检查模拟器')],
[
sg.Button('保存配置'),
sg.Button(StartRunName, image_filename='img/other/btn.png', font=('幼圆', 12), button_color=('white', '')),
sg.Button(RunName),
sg.Button('检查模拟器')
],
]
menu_col = [
[sg.Text('项目地址', font='underline', enable_events=True, key="URL")],
Expand Down
28 changes: 17 additions & 11 deletions AutoPcr_py/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ isautotask = False
isbuymoreexp = False

[MainSetting_1]
isjjc = False
isjjc = True
get_time = 50
istansuo = False
istansuo = True
isdxc = True
isexp = False
isniudan = False
isrunandstart = False
isexp = True
isniudan = True
isrunandstart = True
isxqb = False
iskillboss = True
isxinsui = False
issend = False
isneedseed = False
isneedseed = True
isjiaju = False
dxcdrop = 黑白王
ishometake = False
ishoudonghard = False
ishometake = True
ishoudonghard = True
isuseallpower = False
needzbname = 焰帝戒指
isautoclose = False
Expand All @@ -63,10 +63,16 @@ playername = player1
isautotask = False
isbuymoreexp = True
isdianzankey = False
isvhboss = False
isdianzan = False
isvhboss = True
isdianzan = True
huodonghard = 135
isstone = False
isstone = True
buyexpnumdrop = 4
isskipdxc = True
isjuqinghuodong = False
isfukehuodong = True
isdxcshop = True
buydxcnumdrop = 4
buydxcrowdrop = 1
ishuodonghard = True

Binary file added AutoPcr_py/img/huodong/fkhd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified AutoPcr_py/img/huodong/jqhd1-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added AutoPcr_py/img/other/btn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added AutoPcr_py/img/other/lunata.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added AutoPcr_py/img/shop/dxc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0a3321f

Please sign in to comment.