-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
2151 lines (1972 loc) · 78.8 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
from enum import Flag
from os import PathLike, link
import time
from tkinter.constants import NO
from typing_extensions import IntVar
# from tkinter.constants import FALSE
import pyperclip
import requests
import json
import re
import tkinter as tk
from tkinter import ttk
import webbrowser
from datetime import datetime, timezone
from itemModifier import ItemModifier, ItemModifierType
from gui.windows import (priceInformation, notEnoughInformation)
from gui.advSearch import advancedSearch
from gui.tips import ToolTip
league = 'S15赛季'
leagueTupe = ['选择服务器更新赛季']
try:
with open('mods.json', 'r', encoding='utf8') as fp:
d_mods = json.load(fp)
print('读取mods文件完成:', type(d_mods))
except:
print("缺少mods文件,请重新下载")
try:
update_exe = requests.get("https://api.github.com/repos/Migflyway/PoeTips_Cn/releases/latest")
print("当前版本号为:"+update_exe.json()["tag_name"])
except:
print("获取版本号异常,请手动确定")
print("下载地址1: https://github.com/Migflyway/PoeTips_Cn/releases/")
print('下载地址2: https://wwr.lanzoui.com/b02i8ypra 密码:grp6')
jewl_enchant = [
"斧类攻击造成的击中和异常状态伤害提高12%",
"长杖攻击造成的击中和异常状态伤害提高12%",
"爪类攻击造成的击中和异常状态伤害提高12%",
"弓类的伤害提高12%",
"法杖攻击造成的击中和异常状态伤害提高12%",
"双手武器的攻击伤害提高12%",
"双持武器时,攻击伤害提高12%",
"持盾牌时造成的攻击伤害提高12%",
"攻击伤害提高10%",
"法术伤害提高10%",
"元素伤害提高10%",
"物理伤害提高12%",
"火焰伤害提高12%",
"闪电伤害提高12%",
"冰霜伤害提高12%",
"混沌伤害提高12%",
"召唤生物的伤害提高10%",
"+4%火焰持续伤害加成",
"+4%混沌持续伤害加成",
"+4%物理持续伤害加成",
"+4%冰霜持续伤害加成",
"+4%持续伤害加成",
"非伤害型异常状态效果提高10%",
"你技能的非诅咒类光环效果提高3%",
"你所施放诅咒的效果提高3%",
"受捷影响时,伤害提高10%",
"你受捷影响时,召唤生物的伤害提高10%",
"增助攻击的伤害提高20%",
"攻击与法术暴击率提高15%",
"召唤生物的最大生命提高12%",
"范围伤害提高10%",
"投射物伤害提高10%",
"陷阱伤害提高12%",
"地雷伤害提高12%",
"图腾伤害提高12%",
"烙印伤害提高12%",
"持续吟唱技能伤害提高12%",
"药剂效果的持续时间延长6%",
"药剂回复的生命提高10%",
"药剂回复的魔力提高10%",
"最大生命提高4%",
"最大能量护盾提高6%",
"最大魔力提高6%",
"护甲提高15%",
"闪避值提高15%",
"1%攻击伤害格挡率",
"1%法术伤害格挡几率",
"+15%火焰抗性",
"+15%冰霜抗性",
"+15%闪电抗性",
"+12%混沌抗性",
"1%的几率躲避攻击击中",
]
map_liejie = [
"该地图被【裂界守卫:奴役】占据 (implicit)",
"该地图被【裂界守卫:寂灭】占据 (implicit)",
"该地图被【裂界守卫:约束】占据 (implicit)",
"该地图被【裂界守卫:净世】占据 (implicit)",
]
all_item_list = [
"爪",
"匕首",
"法杖",
"单手剑",
"细剑",
"单手斧",
"单手锤",
"短杖",
"符文匕首",
"弓",
"长杖",
"双手剑",
"双手斧",
"双手锤",
"战杖",
"盾",
"箭袋",
"项链",
"戒指",
"腰带",
"饰品",
"手套",
"鞋子",
"胸甲",
"头部",
]
weapon_list = [
"爪",
"匕首",
"法杖",
"单手剑",
"细剑",
"单手斧",
"单手锤",
"短杖",
"符文匕首",
"弓",
"长杖",
"双手剑",
"双手斧",
"双手锤",
"战杖",
"盾",
"箭袋",
]
ring_list = [
"项链",
"戒指",
"腰带",
"饰品",
]
armor_list = [
"手套",
"鞋子",
"胸甲",
"头部",
]
def getNum(str):
return str.split(': ')[1]
def mountNum(str):
return str.split(': ')[1].split('/')[0]
def cleanWord(str):
return str.replace('精良的', '').replace('菌潮', '').replace('忆境', '').strip()
def removeEnchant(str):
return re.sub('\[(.*?)\]|\(.*?\)|增加的小天赋获得:|[/▲\s]','',str)
def getAmount(str):
str = str.split('/')[0]
return int(str[5:])
def is_contains_chinese(strs):
for _char in strs:
if '\u4e00' <= _char <= '\u9fa5':
return True
return False
def remove_chinese(str):
if is_contains_chinese(str):
str = str.replace('(辅)','')
return re.findall('[\(](.*?)[\)]',str)[0].replace('(','').replace(')','')
else:
return str
def remove_english(str):
return re.sub('[\(](.*?)[\)]','',str)
def pretty_currency(curr):
currency = curr
# TODO: Add more currency types
if "mir" in currency:
currency = "镜子"
elif "exa" in currency:
currency = "崇高石"
elif "chaos" in currency:
currency = "混沌石"
elif "alch" in currency:
currency = "点金石"
elif "alt" in currency:
currency = "改造石"
elif "fuse" in currency:
currency = "链接石"
elif "divine" in currency:
currency = '神圣石'
elif "fusing" in currency:
currency = '链接石'
elif "scour" in currency:
currency = '重铸石'
return currency
def getNameAndType(clipboard):
if clipboard.startswith('物品类别:') == False:
return None, None
try:
if clipboard.splitlines()[3].startswith('--------'):
return None, clipboard.splitlines()[2]
else:
return clipboard.splitlines()[2], clipboard.splitlines()[3]
except:
return None
def find_special_content(str, keyword):
for content in str:
if content.find(keyword) != -1:
return content
def get_socks_link(str):
str = str.replace('插槽: ', '')
sockets = str.lower()
r_sockets = sockets.count("r")
b_sockets = sockets.count("b")
g_sockets = sockets.count("g")
w_sockets = sockets.count("w")
a_sockets = sockets.count("a")
links = 0
counter = 0
for c in sockets:
if c == " ":
if counter > links:
links = counter
counter = 0
elif c == "-":
counter += 1
if counter > links:
links = counter
links = links + 1
sockets = r_sockets + b_sockets + g_sockets + w_sockets + a_sockets
print(sockets, links)
return sockets, links
mod_list = []
mod_list_org = []
mod_list_dict_id = {}
mod_list_dict_text = {}
# contains all mods there exist more than 1 off
dup_mod_list_text = {}
def build_from_json(blob: dict) -> ItemModifier:
"""From the stats API construct ItemModifier objects for given entry
:param blob: A modifier found in the stats API
:return: ItemModifier object for the given modifier
"""
if "option" in blob:
# If the given modifier has an option section, add it.
# This is necessary for the "Allocates #" modifier that
# is present on Annointed items
if "options" in blob["option"]:
options = {}
for i in blob["option"]["options"]:
options[i["text"]] = i["id"]
t = blob["text"].rstrip()
t = re.sub(r'(\d+)','#',t)
t = t.rstrip()
return ItemModifier(
id=blob["id"],
text=t,
options=options,
classid = blob["type"].lower(),
type=ItemModifierType(blob["type"].lower()),
)
t = blob["text"].rstrip()
t = re.sub(r'(\d+)','#',t)
t = t.rstrip()
return ItemModifier(
id=blob["id"],
text=t,
classid = blob["type"].lower(),
type=ItemModifierType(blob["type"].lower()),
options={},
)
def build_from_json_org(blob: dict) -> ItemModifier:
"""From the stats API construct ItemModifier objects for given entry
:param blob: A modifier found in the stats API
:return: ItemModifier object for the given modifier
"""
if "option" in blob:
# If the given modifier has an option section, add it.
# This is necessary for the "Allocates #" modifier that
# is present on Annointed items
if "options" in blob["option"]:
options = {}
for i in blob["option"]["options"]:
options[i["text"]] = i["id"]
t = blob["text"].rstrip()
# t = re.sub(r'(\d+)','#',t)
t = t.rstrip()
return ItemModifier(
id=blob["id"],
text=t,
options=options,
classid = blob["type"].lower(),
type=ItemModifierType(blob["type"].lower()),
)
t = blob["text"].rstrip()
# t = re.sub(r'(\d+)','#',t)
t = t.rstrip()
return ItemModifier(
id=blob["id"],
text=t,
classid = blob["type"].lower(),
type=ItemModifierType(blob["type"].lower()),
options={},
)
def get_item_modifiers() -> tuple:
"""Query the stats API to retrieve all current stats
:return: tuple of all available modifiers
"""
global mod_list
global mod_list_org
if mod_list:
return mod_list
else:
json_blob = requests.get("http://poe.game.qq.com/api/trade/data/stats").json()
for modType in json_blob["result"]:
for mod in modType["entries"]:
mod_list.append(build_from_json(mod))
mod_list_org.append(build_from_json_org(mod))
print(f"[*] Loaded {len(mod_list)} item mods.")
return mod_list
# try:
# for modType in json_blob["result"]:
# for mod in modType["entries"]:
# mod_list.append(build_from_json(mod))
# print(f"[*] Loaded {len(mod_list)} item mods.")
# return mod_list
# except Exception:
# print(f"[!] Something went wrong getting item mods!")
# return None
def get_item_modifiers_org() -> tuple:
"""Query the stats API to retrieve all current stats
:return: tuple of all available modifiers
"""
global mod_list_org
if mod_list_org:
return mod_list_org
else:
json_blob = requests.get("http://poe.game.qq.com/api/trade/data/stats").json()
for modType in json_blob["result"]:
for mod in modType["entries"]:
mod_list_org.append(build_from_json_org(mod))
print(f"[*] Loaded {len(mod_list_org)} item mods.")
return mod_list_org
def get_item_modifiers_by_id(element: str) -> ItemModifier:
"""Search all available ItemModifier objects by their id attribute.
If this is the first time being used, construct a cache so that we
can search faster on subsequent versions
:param element: id of the requested ItemModifier
:return: ItemModifier that matches
"""
global mod_list_dict_id
if len(mod_list_dict_id) == 0:
item_modifiers = get_item_modifiers_org()
mod_list_dict_id = {e.id: e for e in item_modifiers}
if element in mod_list_dict_id:
return mod_list_dict_id[element]
def get_item_modifiers_by_text(element: tuple) -> ItemModifier:
"""Search all available ItemModifier objects by their text attribute.
If this is the first time being used, construct a cache so that we
can search faster on subsequent versions
:param element: (text, type) of the requested ItemModifier
:return: ItemModifier that matches
"""
global mod_list_dict_text
global dup_mod_list_text
if len(mod_list_dict_text) == 0:
item_modifiers = get_item_modifiers()
found = {}
for mod in item_modifiers:
if "Allocates # (Additional)" in mod.text: # Gives no results ATM
continue
if (mod.text, mod.type) in mod_list_dict_text:
if not (mod.text, mod.type) in found:
found[(mod.text, mod.type)] = {}
found[(mod.text, mod.type)][mod.id] = ""
found[(mod.text, mod.type)][mod_list_dict_text[(mod.text, mod.type)].id] = ""
mod_list_dict_text[(mod.text, mod.type)] = mod
for key, value in found.items():
dup_mod_list_text[key] = ""
if element in mod_list_dict_text:
return get_item_modifiers_by_id(mod_list_dict_text[element].id)
prev_mod = ""
class ModInfo:
def __init__(self, mod, m_min, m_max, option, can_reduce=True):
self.mod = mod
self.min = m_min
self.max = m_max
self.option = option
self.can_reduce = can_reduce
def parse_mod(mod_text: str, category: str):
"""Given the text of the mod, find the appropriate ItemModifier object
:param mod_text: Text of the mod
:param mod_values: Value of the referenced mod
:param category: Specific category of mods to check
"""
global prev_mod
mod = None
mod_type = ItemModifierType.EXPLICIT
mod_text = mod_text.rstrip()
if mod_text.endswith("(implicit)"):
mod_text = mod_text[:-11]
mod_type = ItemModifierType.IMPLICIT
elif mod_text.endswith("(crafted)"):
mod_text = mod_text[:-10]
mod_type = ItemModifierType.CRAFTED
elif mod_text.endswith("(enchant)"):
mod_text = mod_text.replace(" (enchant)", "")
mod_type = ItemModifierType.ENCHANT
elif mod_text.endswith('(fractured)'):
mod_text = mod_text.replace(" (fractured)", "")
mod_type = ItemModifierType.FRACTURED
if category in weapon_list:
if (
"附加 # - #" in mod_text
and "法术附加" not in mod_text
or "命中值" in mod_text
or "攻击速度提高" in mod_text
or '物理攻击伤害的' in mod_text
):
mod = get_item_modifiers_by_text((mod_text + " (区域)", mod_type))
elif (
"几率使目标中毒" in mod_text and '召唤' not in mod_text and '攻击' not in mod_text
):
mod = get_item_modifiers_by_text((mod_text + " (区域)", mod_type))
if category in armor_list:
if (
"护甲" in mod_text
or "闪避值" in mod_text
or "能量护盾" in mod_text
):
mod = get_item_modifiers_by_text((mod_text + " (区域)", mod_type))
if not mod and mod_type == ItemModifierType.CRAFTED:
mod = get_item_modifiers_by_text((mod_text, ItemModifierType.PSEUDO))
if not mod:
mod = get_item_modifiers_by_text((mod_text, mod_type))
if not mod:
mod = get_item_modifiers_by_text((mod_text + " (区域)", mod_type))
if not mod:
mod = get_item_modifiers_by_text((mod_text, ItemModifierType.ENCHANT))
try:
if not mod:
if "降低" in mod_text:
mod_text = mod_text.replace("降低", "提高")
elif "提高" in mod_text:
mod_text = mod_text.replace("提高", "降低")
mod = get_item_modifiers_by_text((mod_text, mod_type))
except ValueError:
pass
if not mod:
return None
prev_mod = mod_text
# m = ModInfo(mod, m_min, m_max, option, can_reduce)
return mod
def read_info(text, category):
mods = []
regions = text.split("--------\r\n")
for i in regions:
for line in i.splitlines():
print(line)
mod_text = re.sub(r"[+-]?\d+\.?\d?\d?", "#", line)
mod = None
if not mod_text:
mod_text = line
mod = parse_mod(mod_text, category)
if mod:
mods.append(mod)
else:
pass
# print(f"Unable to find mod: {line}")
return mods
def loadpayLoad(clipboard):
payload = None
if clipboard.startswith('物品类别:') == False:
return
if clipboard.find('未鉴定') != -1:
print("请先鉴定您的物品")
return None
splitedstr = clipboard.split('--------\r\n')
if len(splitedstr) < 2:
return None
if language_choice.get()=='国服':
itemClass = splitedstr[0].splitlines()[0].split(': ')[1]
itemRairty = splitedstr[0].splitlines()[1].split(': ')[1]
else:
itemClass = splitedstr[0].splitlines()[0].split(': ')[1]
itemClass = remove_english(itemClass)
itemRairty = splitedstr[0].splitlines()[1].split(': ')[1]
print(itemClass, itemRairty)
itemName = ''
itemBaseType = ''
#传奇优先一切
if itemRairty == '传奇':
if itemClass != '灾变样本':
if language_choice.get()=='国服':
itemName = splitedstr[0].splitlines()[2]
itemBaseType = cleanWord(splitedstr[0].splitlines()[3])
else:
itemName = remove_chinese(splitedstr[0].splitlines()[2])
itemBaseType = remove_chinese(cleanWord(splitedstr[0].splitlines()[3]))
print(itemBaseType,itemName)
if itemClass == '异界地图':
mapTier = int(getNum(splitedstr[1].splitlines()[0]))
if language_choice.get()=='国服':
itemName = splitedstr[0].splitlines()[2]
itemBaseType = cleanWord(splitedstr[0].splitlines()[3])
else:
itemName = remove_chinese(splitedstr[0].splitlines()[2])
itemBaseType = remove_chinese(cleanWord(splitedstr[0].splitlines()[3]))
payload = {
"query": {
"status": {
"option": "online"
},
"name": {
"option": itemName,
"discriminator": "warfortheatlas"
},
"type": {
"option": itemBaseType,
"discriminator": "warfortheatlas"
},
"stats": [{
"type": "and",
"filters": []
}],
"filters": {
"map_filters": {
"disabled": False,
"filters": {
"map_tier": {
"min": mapTier,
"max": mapTier
}
}
},
"type_filters": {
"disabled": False,
"filters": {
"rarity": {
"option": "unique"
}
}
}
}
},
"sort": {
"price": "asc"
}
}
else:
payload = {
"query": {
"status": {
"option": "any"
},
"name": itemName,
"type": itemBaseType,
"stats": [{
"type": "and",
"filters": []
}],
"filters": {
"socket_filters": {
"filters": {
}
},
"trade_filters": {
"filters": {
"indexed": {
"option": "1day"
}
}
}
}
},
"sort": {
"price": "asc"
}
}
if clipboard.find('插槽') != -1:
sockets, links = get_socks_link(find_special_content(splitedstr,'插槽'))
if sockets == 6 or links >= 5:
if sockets == 6:
payload["query"]["filters"]["socket_filters"]["filters"]["sockets"] = {"min": 6}
if links >= 5:
payload["query"]["filters"]["socket_filters"]["filters"]["links"] = {"min": links}
print(payload)
elif itemRairty=='稀有':
if itemClass in all_item_list:
if language_choice.get()=='国服':
itemBaseType = cleanWord(splitedstr[0].splitlines()[3])
else:
itemBaseType = remove_chinese(cleanWord(splitedstr[0].splitlines()[3]))
filt = []
m = read_info(clipboard,itemClass)
advancedSearch.add_item(m)
advancedSearch.create_at_cursor()
selected_m,selected_value = advancedSearch.get_select()
if selected_m==None: return None
value_t = {}
for t in selected_m:
if selected_value[t.id][0]!='':
value_t['min'] = selected_value[t.id][0]
if selected_value[t.id][1] !='':
value_t['max'] = selected_value[t.id][1]
filt.append({
"id": t.id,
'value':value_t,
"disabled": False
})
payload = {
"query": {
"status": {
"option": "online"
},
"type": itemBaseType,
"stats": [{
"type": "and",
"filters": []
}, {
"filters": filt,
"type": "and"
}],
"filters": {
"type_filters": {
"filters": {
"rarity": {
"option": "rare"
}
}
}
}
},
"sort": {
"price": "asc"
}
}
# print(payload)
if itemClass == '地图碎片':
if language_choice.get()==('国服'):
itemName = splitedstr[0].splitlines()[2]
else:
itemName = remove_chinese(splitedstr[0].splitlines()[2])
payload = {
"query": {
"status": {
"option": "online"
},
"type": itemName,
"stats": [{
"type": "and",
"filters": []
}]
},
"filters": {
"trade_filters": {
"filters": {
"indexed": {
"option": "1day"
}
},
"disabled": False
}
},
"sort": {
"price": "asc"
}
}
elif itemClass == '命运卡':
print("注意命运卡有重复名称,请手动确定")
if language_choice.get()==('国服'):
itemName = splitedstr[0].splitlines()[2]
else:
itemName = remove_chinese(splitedstr[0].splitlines()[2])
itemMount = getAmount(splitedstr[1].splitlines()[0])
payload = {
"query": {
"status": {
"option": "online"
},
"type": itemName,
"stats": [{
"type": "and",
"filters": [],
"disabled": True
}],
"filters": {
"misc_filters": {
"filters": {
"stack_size": {
"min": itemMount,
"max": itemMount
}
}
}
}
},
"sort": {
"price": "asc"
}
}
# payload = {"query":{"status":{"option":"online"},"type":itemName,"stats":[{"type":"and","filters":[]}],"filters":{"misc_filters":{"filters":{"stack_size":{"max":itemMount}}}}},"sort":{"price":"asc"}}
elif itemClass == '可堆叠通货':
if language_choice.get()==('国服'):
itemName = splitedstr[0].splitlines()[2]
else:
itemName = remove_chinese(splitedstr[0].splitlines()[2])
if '右键点击后赋予你的角色预言之力' in clipboard:
itemBaseType = '预言'
itemMount = 1
else:
itemMount = getAmount(splitedstr[1].splitlines()[0])
if itemBaseType=='预言':
payload = {"query":{"status":{"option":"online"},"name":itemName,"type":itemBaseType,"stats":[{"type":"and","filters":[]}],"filters":{"misc_filters":{"filters":{"stack_size":{"min":itemMount,"max":itemMount}}}}},"sort":{"price":"asc"}}
else:
if itemName == '崇高石':
payload = {
"query": {
"status": {
"option": "online"
},
"type": "崇高石",
"stats": [{
"type": "and",
"filters": []
}],
"filters": {
"misc_filters": {
"filters": {
"stack_size": {
"min": itemMount,
"max": itemMount
}
}
},
"trade_filters": {
"filters": {
"price": {
"option": "chaos"
}
}
}
}
},
"sort": {
"price": "asc"
}
}
else:
payload = {
"query": {
"status": {
"option": "online"
},
"type": itemName,
"stats": [{
"type": "and",
"filters": []
}],
"filters": {
"misc_filters": {
"filters": {
"stack_size": {
"min": itemMount,
"max": itemMount
}
}
}
}
},
"sort": {
"price": "asc"
}
}
elif itemClass == '异界地图':
mapTier = int(getNum(splitedstr[1].splitlines()[0]))
if itemRairty == '稀有':
if language_choice.get()==('国服'):
itemName = splitedstr[0].splitlines()[3]
else:
itemName = remove_chinese(splitedstr[0].splitlines()[3])
print(itemName)
if clipboard.find('区域被菌潮感染') != -1:
print('区域被菌潮感染')
itemName = splitedstr[0].splitlines()[2].replace("菌潮 ", '')
payload = {
"query": {
"status": {
"option": "online"
},
"type": {
"option": itemName,
"discriminator": "warfortheatlas"
},
"stats": [{
"type": "and",
"filters": []
}],
"filters": {
"map_filters": {
"filters": {
"map_blighted": {
"option": "true"
},
"map_tier": {
"min": mapTier,
"max": mapTier
}
}
}
}
},
"sort": {
"price": "asc"
}
}
elif clipboard.find('被裂界者影响') != -1:
print('被裂界者影响')
keyCont = find_special_content(splitedstr,
'该区域被裂界者影响').splitlines()[1]
print(keyCont)
liejie_id = map_liejie.index(keyCont) + 1
payload = {
"query": {
"status": {
"option": "online"
},
"type": {
"option": itemName,
"discriminator": "warfortheatlas"
},
"stats": [{
"type": "and",
"filters": []
}, {
"filters": [{
"id": "implicit.stat_1792283443",
"value": {
"option": "2"
},
"disabled": False
}, {
"id": "implicit.stat_3624393862",
"value": {
"option": liejie_id
},
"disabled": False
}],
"type":
"and"
}],
"filters": {
"map_filters": {
"filters": {
"map_tier": {
"min": mapTier,
"max": mapTier
}
}
}
}
},
"sort": {
"price": "asc"
}
}
elif clipboard.find('该区域被塑界者影响') != -1:
print('该区域被塑界者影响')
payload = {
"query": {
"status": {
"option": "online"
},
"type": {
"option": itemName,
"discriminator": "warfortheatlas"
},
"stats": [{
"type": "and",
"filters": [],
"disabled": False
}, {
"filters": [{
"id": "implicit.stat_1792283443",
"value": {
"option": "1"
},
"disabled": False
}],
"type":
"and"
}],