Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SetWorkingDir, %A_ScriptDir%
  2.  
  3. #Include %A_ScriptDir%\lib\
  4. #Include PoeSearch.ahk
  5. ; #Include PoEGUI_Trade.ahk
  6.  
  7. #Include %A_ScriptDir%\lib\third\
  8. #Include JSON.ahk
  9. #Include StdOutStream.ahk
  10. #Include Class_CustomFont.ahk
  11.  
  12. ; trade madcro source :
  13. ; https://github.com/PoE-TradeMacro/POE-TradeMacro
  14. ; #Include %A_ScriptDir%\lib\third\PoE_TradeMacro\
  15. ; #Include Class_GdipTooltip.ahk
  16. ; #Include Script_Gui.ahk
  17. ; #Include Class_ColorPicker.ahk
  18. ; #Include Class_SplashUI.ahk
  19.  
  20. ; 폰트로딩
  21. ; global FixedFont := New CustomFont(A_ScriptDir "\resource\fonts\D2Coding.ttf")
  22. ; global fonts := CreateFont("s10", "D2Coding")
  23.  
  24.  
  25. ; 관리자권한 체크
  26. if not A_IsAdmin{
  27.     Run *RunAs "%A_ScriptFullPath%"
  28.     ExitApp
  29. }
  30.  
  31. Menu, Tray, add, Open window, GuiShow
  32. Menu, Tray, Default, Open window
  33. Menu, Tray, Click, 2
  34.  
  35. ; Exe 그룹
  36. GroupAdd, PoEWindowGrp, Path of Exile ahk_class POEWindowClass ahk_exe PathOfExile.exe
  37. GroupAdd, PoEWindowGrp, Path of Exile ahk_class POEWindowClass ahk_exe PathOfExile_KG.exe
  38. GroupAdd, PoEWindowGrp, Path of Exile ahk_class POEWindowClass ahk_exe PathOfExileSteam.exe
  39. GroupAdd, PoEWindowGrp, Path of Exile ahk_class POEWindowClass ahk_exe PathOfExile_x64.exe
  40. GroupAdd, PoEWindowGrp, Path of Exile ahk_class POEWindowClass ahk_exe PathOfExile_x64_KG.exe
  41. GroupAdd, PoEWindowGrp, Path of Exile ahk_class POEWindowClass ahk_exe PathOfExile_x64Steam.exe
  42.  
  43. ;UI추가 소스
  44. IniRead, LL, setting.ini, KeySetting, L
  45. IniRead, KH1, setting.ini, KeySetting, Key1
  46. IniRead, KH2, setting.ini, KeySetting, Key2
  47. IniRead, KH3, setting.ini, KeySetting, Key3
  48. IniRead, KH4, setting.ini, KeySetting, Key4
  49. IniRead, KH5, setting.ini, KeySetting, Key5
  50. IniRead, KH6, setting.ini, KeySetting, Key6
  51. IniRead, KH7, setting.ini, KeySetting, Key7
  52. IniRead, KH8, setting.ini, KeySetting, Key8
  53. IniRead, KH9, setting.ini, KeySetting, Key9
  54. IniRead, KH10, setting.ini, KeySetting, Key10
  55. IniRead, KH11, setting.ini, KeySetting, Key11
  56. IniRead, KH12, setting.ini, KeySetting, Key12
  57. IniRead, KH13, setting.ini, KeySetting, Key13
  58. IniRead, KH14, setting.ini, KeySetting, Key14
  59. IniRead, runAsMinimized, setting.ini, General, runAsMinimized
  60.  
  61. Lea =
  62.  
  63. Hotkey, ifwinactive, ahk_group PoEWindowGrp
  64. Gui, 2:Submit, Nohide
  65. Hotkey, %KH1%, Hot1, On
  66. Hotkey, %KH2%, Hot2, On
  67. Hotkey, %KH3%, Hot3, On
  68. Hotkey, %KH4%, Hot4, On
  69. Hotkey, %KH5%, Hot5, On
  70. Hotkey, %KH6%, Hot6, On
  71. Hotkey, %KH7%, Hot7, On
  72. Hotkey, %KH8%, Hot8, On
  73. Hotkey, %KH9%, Hot9, On
  74. Hotkey, %KH10%, Hot10, On
  75. Hotkey, %KH11%, Hot11, On
  76. Hotkey, %KH12%, Hot12, On
  77. Hotkey, %KH13%, Hot13, On
  78.  
  79. Gui, 2:Add, Text, x10 y10 w100 h15 Center, 리    그     선    택
  80. Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 로    그     아    웃
  81. Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 은  신  처    이  동
  82. Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 위    키     검    색
  83. Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 영문   이름   복사
  84. Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 다음   공홈   검색
  85. Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 다음   옵션   검색
  86. Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 툴    팁     검    색
  87. Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 툴팁   옵션   검색
  88. Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 예    언     검    색
  89. Gui, 2:Add, Text, x10 y+10 w100 h15 Center, POE  NINJA 검색
  90. Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 싱    크     맞    춤
  91. Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 재        실        행
  92. Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 몬  스  터   확  인
  93. Gui, 2:Add, Checkbox, vchkRunAsMinimized Checked%runAsMinimized% x10 y+10 w150 h15 Center, 최소화 상태로 실행하기
  94. ;Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 재실행
  95. Gui, 2:Add, DropDownList, vLea gStart x115 y6 w100 h80 Choose%LL%, Legion|Hardcore Legion|Standard|Hardcore
  96. Gui, 2:Add, Hotkey, vHot1 x115 y+5 w100 h20, %KH1% ;F4
  97. Gui, 2:Add, Hotkey, vHot2 x115 y+5 w100 h20, %KH2% ;F5
  98. Gui, 2:Add, Hotkey, vHot3 x115 y+5 w100 h20, %KH3% ;^W
  99. Gui, 2:Add, Hotkey, vHot4 x115 y+5 w100 h20, %KH4% ;^E
  100. Gui, 2:Add, Hotkey, vHot5 x115 y+5 w100 h20, %KH5% ;^Q
  101. Gui, 2:Add, Hotkey, vHot6 x115 y+5 w100 h20, %KH6% ;^D
  102. Gui, 2:Add, Hotkey, vHot7 x115 y+5 w100 h20, %KH7% ;^N
  103. Gui, 2:Add, Hotkey, vHot8 x115 y+5 w100 h20, %KH8% ;^~
  104. Gui, 2:Add, Hotkey, vHot9 x115 y+5 w100 h20, %KH9% ;^!R
  105. Gui, 2:Add, Hotkey, vHot10 x115 y+5 w100 h20, %KH10% ;F3
  106. Gui, 2:Add, Hotkey, vHot11 x115 y+5 w100 h20, %KH11%
  107. Gui, 2:Add, Hotkey, vHot12 x115 y+5 w100 h20, %KH12%
  108. Gui, 2:Add, Hotkey, vHot13 x115 y+5 w100 h20, %KH13%
  109. ;Gui, 2:Add, Hotkey, vHot14 x115 y+5 w100 h20, %KH14%
  110. Gui, 2:Add, Button, gSave x10 y+35 w205 h30, 저장
  111. Gui, 2:Add, Button, gApply x10 y+5 w205 h30, 적용
  112. Gui, 2:-MinimizeBox
  113.  
  114. if(runAsMinimized != 1)
  115.     Gui, 2:Show, ,단축키 설정
  116.  
  117. ; 리그설정
  118. global g_league := "Legion" ; 챌린지
  119. ; global g_league := "Hardcore Legion" ; 챌린지 하드코어
  120. ; global g_league := "Standard" ;스탠다드
  121. ; global g_league := "Hardcore" ;하드코어
  122.  
  123. ; Json 저장
  124. global WordList :=
  125. global BaseItemTypes :=
  126. global ItemClasses :=
  127. global Prophecies :=
  128. global StatFiltersKr :=
  129. global TradeFiltersKr :=
  130. global TypeFiltersKr :=
  131. global Mods :=
  132.  
  133. class ItemInfo {
  134.  
  135.     isWeb := "true"
  136.  
  137.     Set(name, lang, value) {
  138.         If (!This[name]){
  139.             This[name] := {}
  140.         }
  141.         This[name][lang] := value
  142.         return value
  143.     }
  144.  
  145.     Get(name, lang, value_default="") {
  146.         result := This[name][lang]
  147.         If (result == "") {
  148.             result := value_default
  149.         }
  150.         return result
  151.     }
  152. }
  153.  
  154. class Fonts {
  155.     __New(FontSizeFixed, FontSizeUI = 9)
  156.     {
  157.         this.FontSizeFixed  := FontSizeFixed
  158.         this.FontSizeUI := FontSizeUI
  159.         this.FixedFont      := this.CreateFixedFont(this.FontSizeFixed)
  160.         this.UIFont     := this.CreateUIFont(this.FontSizeUI)
  161.         ;debugprintarray(this)
  162.     }
  163.  
  164.     CreateFixedFont(FontSize_, Options = "")
  165.     {
  166.         ; Q5 = Windows XP and later: If set, text is rendered (when possible) using ClearType antialiasing method.
  167.         Options .= " q5 "
  168.         If (!(FontSize_ == ""))
  169.         {
  170.             Options .= "s" FontSize_
  171.         }
  172.         ; Gui Font, %Options%, Courier New
  173.         Gui Font, %Options%, D2Coding
  174.         Gui Add, Text, HwndHidden h0 w0 x0 y0,
  175.         SendMessage, 0x31,,,, ahk_id %Hidden%
  176.         return ErrorLevel
  177.     }
  178.  
  179.     CreateUIFont(FontSize_, Options = "")
  180.     {
  181.         ; Q5 = Windows XP and later: If set, text is rendered (when possible) using ClearType antialiasing method.
  182.         Options .= " q5 "
  183.         If (!(FontSize_ == ""))
  184.         {
  185.             Options .= "s" FontSize_
  186.         }
  187.         Gui, SettingsUI:Font, %Options%, Arial
  188.         Gui, SettingsUI:Font, %Options%, Tahoma
  189.         Gui, SettingsUI: Font, %Options%, Segoe UI
  190.         Gui, SettingsUI: Font, %Options%, Verdana
  191.         Gui, SettingsUI: Add, Text, HwndHidden h0 w0 x0 y0,
  192.         SendMessage, 0x31,,,, ahk_id %Hidden%
  193.         return ErrorLevel
  194.     }
  195.  
  196.     Set(NewFont)
  197.     {
  198.         AhkExe := GetAhkExeFilename()
  199.         SendMessage, 0x30, NewFont, 1,, ahk_class tooltips_class32 ahk_exe %AhkExe%
  200.         ; Development versions of AHK
  201.         SendMessage, 0x30, NewFont, 1,, ahk_class tooltips_class32 ahk_exe AutoHotkeyA32.exe
  202.         SendMessage, 0x30, NewFont, 1,, ahk_class tooltips_class32 ahk_exe AutoHotkeyU32.exe
  203.         SendMessage, 0x30, NewFont, 1,, ahk_class tooltips_class32 ahk_exe AutoHotkeyU64.exe
  204.     }
  205.  
  206.     SetFixedFont(FontSize_=-1, Options = "")
  207.     {
  208.         If (FontSize_ != -1) {
  209.             FontSize_ := this.FontSizeFixed
  210.         } Else {
  211.             this.FontSizeFixed := FontSize_
  212.         }
  213.         FixedFont := this.CreateFixedFont(FontSize_, Options)
  214.  
  215.         If (FixedFont) {
  216.             this.Set(this.FixedFont)
  217.             this.FontSizeFixed := FixedFont
  218.         }
  219.     }
  220.  
  221.     SetUIFont(FontSize_=-1, Options = "")
  222.     {
  223.         If (FontSize_ == -1) {
  224.             FontSize_ := this.FontSizeUI
  225.         } Else {
  226.             this.FontSizeUI := FontSize_
  227.         }
  228.         UIFont := this.CreateUIFont(FontSize_, Options)
  229.  
  230.         If (UIFont and (this.UIFont != UIFont)) {
  231.             this.Set(this.UIFont)
  232.             this.UIFont := UIFont
  233.         }
  234.     }
  235.  
  236.     GetFixedFont()
  237.     {
  238.         return this.FixedFont
  239.     }
  240.  
  241.     GetUIFont()
  242.     {
  243.         return this.UIFont
  244.     }
  245. }
  246.  
  247. Fonts := new Fonts(9, 9)
  248. global ItemData := new ItemInfo()
  249. fileLoad()
  250.  
  251. fileLoadsChck(){
  252.     If (!WordList){
  253.         MsgBox, WordList.json 파일 로딩을 실패하였습니다.
  254.  
  255.         FileRead, JSONFile, %A_ScriptDir%\data\Words.json
  256.         parsedJSON := JSON.Load(JSONFile)
  257.         WordList := parsedJSON
  258.  
  259.         return False
  260.     }else If (!BaseItemTypes){
  261.         MsgBox, BaseItemTypes.json 파일 로딩을 실패하였습니다.
  262.  
  263.         FileRead, JSONFile, %A_ScriptDir%\data\BaseItemTypes.json
  264.         parsedJSON := JSON.Load(JSONFile)
  265.         BaseItemTypes := parsedJSON
  266.  
  267.         return False
  268.     }else If (!ItemClasses){
  269.         MsgBox, ItemClasses.json 파일 로딩을 실패하였습니다.
  270.  
  271.         FileRead, JSONFile, %A_ScriptDir%\data\ItemClasses.json
  272.         parsedJSON := JSON.Load(JSONFile)
  273.         ItemClasses := parsedJSON
  274.  
  275.         return False
  276.     }else If (!Prophecies){
  277.         MsgBox, Prophecies.json 파일 로딩을 실패하였습니다.
  278.  
  279.         FileRead, JSONFile, %A_ScriptDir%\data\Prophecies.json
  280.         parsedJSON := JSON.Load(JSONFile)
  281.         Prophecies := parsedJSON
  282.  
  283.         return False
  284.     }else If (!StatFiltersKr){
  285.         MsgBox, StatFiltersKr.json 파일 로딩을 실패하였습니다.
  286.  
  287.         FileRead, JSONFile, %A_ScriptDir%\data\StatFiltersKr.json
  288.         parsedJSON := JSON.Load(JSONFile)
  289.         StatFiltersKr := parsedJSON
  290.  
  291.         return False
  292.     }else If (!TypeFiltersKr){
  293.         MsgBox, TypeFiltersKr.json 파일 로딩을 실패하였습니다.
  294.  
  295.         FileRead, JSONFile, %A_ScriptDir%\data\TypeFiltersKr.json
  296.         parsedJSON := JSON.Load(JSONFile)
  297.         TypeFiltersKr := parsedJSON
  298.  
  299.         return False
  300.     }else If (!TradeFiltersKr){
  301.         MsgBox, TradeFiltersKr.json 파일 로딩을 실패하였습니다.
  302.  
  303.         FileRead, JSONFile, %A_ScriptDir%\data\TradeFiltersKr.json
  304.         parsedJSON := JSON.Load(JSONFile)
  305.         TradeFiltersKr := parsedJSON
  306.  
  307.         return False
  308.     }else If (!Mods){
  309.         MsgBox, Mods.json 파일 로딩을 실패하였습니다.
  310.  
  311.         FileRead, JSONFile, %A_ScriptDir%\data\Mods.json
  312.         parsedJSON := JSON.Load(JSONFile)
  313.         Mods := parsedJSON
  314.  
  315.         return False
  316.     }
  317.  
  318.     return True
  319. }
  320.  
  321. fileLoad(){
  322.     ; Json File 읽기
  323.     FileRead, JSONFile, %A_ScriptDir%\data\Words.json
  324.     parsedJSON := JSON.Load(JSONFile)
  325.     WordList := parsedJSON
  326.  
  327.     FileRead, JSONFile, %A_ScriptDir%\data\BaseItemTypes.json
  328.     parsedJSON := JSON.Load(JSONFile)
  329.     BaseItemTypes := parsedJSON
  330.  
  331.     FileRead, JSONFile, %A_ScriptDir%\data\ItemClasses.json
  332.     parsedJSON := JSON.Load(JSONFile)
  333.     ItemClasses := parsedJSON
  334.  
  335.     FileRead, JSONFile, %A_ScriptDir%\data\Prophecies.json
  336.     parsedJSON := JSON.Load(JSONFile)
  337.     Prophecies := parsedJSON
  338.  
  339.     FileRead, JSONFile, %A_ScriptDir%\data\StatFiltersKr.json
  340.     parsedJSON := JSON.Load(JSONFile)
  341.     StatFiltersKr := parsedJSON
  342.  
  343.     FileRead, JSONFile, %A_ScriptDir%\data\TypeFiltersKr.json
  344.     parsedJSON := JSON.Load(JSONFile)
  345.     TypeFiltersKr := parsedJSON
  346.  
  347.     FileRead, JSONFile, %A_ScriptDir%\data\TradeFiltersKr.json
  348.     parsedJSON := JSON.Load(JSONFile)
  349.     TradeFiltersKr := parsedJSON
  350.  
  351.     FileRead, JSONFile, %A_ScriptDir%\data\Mods.json
  352.     parsedJSON := JSON.Load(JSONFile)
  353.     Mods := parsedJSON
  354.  
  355.     ; MsgBox, 로딩완료
  356.  
  357.     fileLoadsChck()
  358.  
  359.     return
  360.  
  361. }
  362.  
  363. IsSeperate(ClipLine){
  364.     If (RegExMatch(ClipLine, "--------")) {
  365.         return True
  366.     } else  {
  367.         return False
  368.     }
  369. }
  370.  
  371. GetNameOrBase(lang){
  372.     result := ItemData.get("Name", lang)
  373.     If (result = ""){
  374.         result := ItemData.get("ItemBase", lang)
  375.     }
  376.     return result
  377. }
  378.  
  379. SetRarity(ClipLine){
  380.     ClipLine := Trim(ClipLine)
  381.     If (RegExMatch(ClipLine, "^희귀도: 고유")) {
  382.         ItemData.Set("Rarity", "kr", "고유")
  383.         ItemData.Set("Rarity", "lvl", 4)
  384.         return ItemData.Set("Rarity", "en", "Unique")
  385.     }Else If (RegExMatch(ClipLine, "^희귀도: 희귀")) {
  386.         ItemData.Set("Rarity", "kr", "희귀")
  387.         ItemData.Set("Rarity", "lvl", 3)
  388.         return ItemData.Set("Rarity", "en", "Rare")
  389.     }Else If (RegExMatch(ClipLine, "^희귀도: 마법")) {
  390.         ItemData.Set("Rarity", "kr", "마법")
  391.         ItemData.Set("Rarity", "lvl", 2)
  392.         return ItemData.Set("Rarity", "en", "Magic")
  393.     }Else If (RegExMatch(ClipLine, "^희귀도: 보통")) {
  394.         ItemData.Set("Rarity", "kr", "보통")
  395.         ItemData.Set("Rarity", "lvl", 1)
  396.         return ItemData.Set("Rarity", "en", "Normal")
  397.     }Else If (RegExMatch(ClipLine, "^희귀도: 점술 카드")) {
  398.         SetClasses(ClipLine)
  399.         ItemData.Set("Rarity", "kr", "점술 카드")
  400.         ItemData.Set("Rarity", "lvl", 0)
  401.         return ItemData.Set("Rarity", "en", "Divination Card")
  402.     }Else If (RegExMatch(ClipLine, "^희귀도: 화폐")) {
  403.         ItemData.Set("Rarity", "kr", "화폐")
  404.         ItemData.Set("Rarity", "lvl", 0)
  405.         return ItemData.Set("Rarity", "en", "Currency")
  406.     }Else If (RegExMatch(ClipLine, "^희귀도: 젬")) {
  407.         SetClasses(ClipLine)
  408.         ItemData.Set("Rarity", "kr", "젬")
  409.         ItemData.Set("Rarity", "lvl", 0)
  410.         return ItemData.Set("Rarity", "en", "Gem")
  411.     }
  412.     return
  413. }
  414.  
  415. SetClasses(StringLine){
  416.     If( ItemData.Get("Classes", "kr") != "" ){
  417.         return
  418.     }
  419.  
  420.     If (RegExMatch(StringLine, ".*화석$")) {
  421.         ItemData.Set("Classes", "kr", "화석")
  422.         ItemData.Set("Classes", "en", "fossils")
  423.     }Else If (RegExMatch(StringLine, ".*에센스$")) {
  424.         ItemData.Set("Classes", "kr", "에센스")
  425.         ItemData.Set("Classes", "en", "essences")
  426.     }Else If (RegExMatch(StringLine, ".*카드$")) {
  427.         ItemData.Set("Classes", "kr", "점술 카드")
  428.         ItemData.Set("Classes", "en", "divinationcards")
  429.     }Else If (RegExMatch(StringLine, ".*공명기$")) {
  430.         ItemData.Set("Classes", "kr", "공명기")
  431.         ItemData.Set("Classes", "en", "resonators")
  432.     }Else If (RegExMatch(StringLine, ".*젬$")) {
  433.         ItemData.Set("Classes", "kr", "젬")
  434.         ItemData.Set("Classes", "en", "skill-gems")
  435.     }Else If (RegExMatch(StringLine, ".*인큐베이터$")) {
  436.         ItemData.Set("Classes", "kr", "인큐베이터")
  437.         ItemData.Set("Classes", "en", "incubators")
  438.     }Else If (RegExMatch(StringLine, "우클릭으로 이 예언을 캐릭터에 추가하십시오.")) {
  439.         ItemData.Set("Classes", "kr", "예언")
  440.         ItemData.Set("Classes", "en", "prophecies")
  441.         ItemData.Set("ItemBase", "kr", "예언")
  442.         ItemData.Set("ItemBase", "en", "prophecies")
  443.     }Else If (RegExMatch(StringLine, ".*지도$")) {
  444.         If (ItemData.Get("Rarity", "en") = "Unique"){
  445.             ItemData.Set("Classes", "kr", "지도")
  446.             ItemData.Set("Classes", "en", "unique-maps")
  447.         }else{
  448.             ItemData.Set("Classes", "kr", "지도")
  449.             ItemData.Set("Classes", "en", "maps")
  450.         }
  451.     }Else {
  452.         For idx in ItemClasses {
  453.             If (RegExMatch(StringLine, ".*"ItemClasses[idx]["kr"]"$")) {
  454.                 ItemData.Set("Classes", "kr", ItemClasses[idx]["kr"])
  455.                 ItemData.Set("Classes", "en", ItemClasses[idx]["en"])
  456.                 If (ItemClasses[idx]["category"] != ""){
  457.                     ItemData.Set("Category", "en", ItemClasses[idx]["category"])
  458.                 }
  459.             }
  460.         }
  461.     }
  462.     return
  463. }
  464.  
  465. GetClipboardName(DropNewlines=False){
  466.     ClipText := Clipboard
  467.     ; ClipLine := StrSplit(ClipText, "`n", "`r")
  468.     ; idx := 1
  469.     ; cIdx := 1
  470.  
  471.     ; ItemString := StrSplit(ClipText, "`n", "`r")
  472.  
  473.     ItemStringParts := StrSplit(ClipText, "`--------", "`r")
  474.     PartsLen := ItemStringParts.MaxIndex()
  475.     PartsIdx := 1
  476.  
  477.     ; isProphecies
  478.     If (PartsLen = 4 || PartsLen = 5 && RegExMatch(ItemStringParts[4], ".*예언.*")){
  479.         SetClasses(ItemStringParts[4])
  480.     }
  481.  
  482.     ; Name&Base&Category
  483.     ParseItemNamePart(ItemStringParts[PartsIdx])
  484.  
  485.     ; 희귀도
  486.     rarity := ItemData.Get("Rarity", "en")
  487.  
  488.     ; 메타 - 타입
  489.     metaType := ItemData.Get("Metadat", "Type")
  490.  
  491.     ; 무기스탯 파싱
  492.     If(metaType = "Weapons"){
  493.         ParseWeaponStats(ItemStringParts[2])
  494.     }Else If (metaType = "Armours"){
  495.         ParseArmourStats(ItemStringParts[2])
  496.     }
  497.  
  498.     ; 아이템 스탯 파싱
  499.     AffixIdx := PartsLen
  500.     If (metaType = "Flasks"){
  501.         AffixIdx := AffixIdx - 1
  502.     }
  503.     If (rarity = "Rare" || rarity = "Magic"){
  504.         While (HasMiscellaneousMod(ItemStringParts, AffixIdx) && AffixIdx > 1) {
  505.             continue
  506.         }
  507.         ParseStatFilter(ItemStringParts[AffixIdx])
  508.     } Else If(rarity = "Unique"){
  509.         While (HasMiscellaneousMod(ItemStringParts, AffixIdx) && AffixIdx > 1) {
  510.             continue
  511.         }
  512.         AffixIdx := AffixIdx - 1
  513.         ParseStatFilter(ItemStringParts[AffixIdx])
  514.     }
  515.  
  516.     RareIdx := PartsLen
  517.  
  518.  
  519.     ; Qulity&Armor
  520.  
  521.     ; Requirement
  522.  
  523.     ; Socket
  524.  
  525.     ; ilvl
  526.  
  527.     ; affix
  528.  
  529.  
  530.     return
  531. }
  532.  
  533. ParseItemNamePart(ItemStringPart){
  534.     ClipLine := StrSplit(ItemStringPart, "`n", "`r")
  535.  
  536.     ; 희귀도
  537.     Rarity := SetRarity(ClipLine[1])
  538.     Classes := ItemData.Get("Classes", "en")
  539.  
  540.     If (Rarity = "Unique"){
  541.         SetUniqueName(ClipLine[2])
  542.         idx ++
  543.         SetBase(ClipLine[3])
  544.         SetClasses(ClipLine[3])
  545.     }Else If (Rarity = "Divination Card" || Rarity = "Gem"){
  546.         SetBase(ClipLine[2])
  547.     }Else If ( Rarity = "Currency" ){
  548.         SetBase(ClipLine[2])
  549.         SetClasses(ClipLine[2])
  550.     }Else If ( Classes = "prophecies" ){
  551.         SetProphecyName(ClipLine[2])
  552.     }Else If (Rarity = "Rare"){
  553.         SetBase(ClipLine[3])
  554.     }Else If (Rarity = "Magic"){
  555.         SetBase(ClipLine[2])
  556.     }Else {
  557.         SetBase(ClipLine[2])
  558.         SetClasses(ClipLine[2])
  559.     }
  560.     return
  561. }
  562.  
  563. ; 쉐이퍼, 엘더, 커럽등 체크
  564. HasMiscellaneousMod(ItemStringParts, ByRef Idx){
  565.     LineList := StrSplit(ItemStringParts[Idx], "`n", "`r")
  566.     For i in LineList {
  567.         If (RegExMatch(LineList[i], "^.*(미확인|타락|엘더 아이템|분열된 아이템|쉐이퍼 아이템|메모|패시브)")) {
  568.             Idx := Idx - 1
  569.             return True
  570.         }
  571.     }
  572.     return False
  573. }
  574.  
  575. ; 아이템 옵션 Parse
  576. ParseStatFilter(ItemStringPart){
  577.  
  578.     StatList := []
  579.  
  580.     Loop, Parse, ItemStringPart, `n, `r
  581.     {
  582.         If (StrLen(A_LoopField) = 0){
  583.             continue
  584.         }
  585.         SetStatFilter(A_LoopField, StatList)
  586.     }
  587.     ItemData.Set("Stat", "StatList", StatList)
  588.     return
  589. }
  590.  
  591. ParseWeaponStats(ItemStringPart){
  592.  
  593.     isFirst := true
  594.     Loop, Parse, ItemStringPart, `n, `r
  595.     {
  596.         If (StrLen(A_LoopField) = 0){
  597.             continue
  598.         }
  599.         ; if( isFirst ){
  600.         ;   SetTypeFilter(A_LoopField, true)
  601.         ;   isFirst := false
  602.         ; }
  603.         ; TODO : 공격력 등 파싱
  604.     }
  605.     return
  606. }
  607.  
  608. ParseArmourStats(ItemStringPart){
  609.     return
  610. }
  611.  
  612. SetTypeFilter(Str, isWeapon:=false){
  613.     If (!TypeFiltersKr){
  614.         MsgBox, TypeFiltersKr.json 파일 로딩을 실패하였습니다.
  615.         return
  616.     }
  617.     For idx in TypeFiltersKr {
  618.         Str := RegExReplace(Str, "<<.*>>", "")
  619.         If (TypeFiltersKr[idx]["text"] = Str) {
  620.             ItemData.Set("Filters", "type", TypeFiltersKr[idx])
  621.             return
  622.         }
  623.     }
  624.     return
  625.  
  626. }
  627.  
  628. SetUniqueName(ItemName){
  629.     If (!WordList){
  630.         MsgBox, WordList.json 파일 로딩을 실패하였습니다.
  631.         return
  632.     }
  633.     For idx in WordList {
  634.         ItemName := RegExReplace(ItemName, "<<.*>>", "")
  635.         If (WordList[idx]["kr"] = ItemName) {
  636.             ItemData.Set("Name", "kr", WordList[idx]["kr"])
  637.             ItemData.Set("Name", "en", WordList[idx]["en"])
  638.             return
  639.         }
  640.     }
  641.     return
  642. }
  643.  
  644. SetProphecyName(ItemName){
  645.     If (!Prophecies){
  646.         MsgBox, Prophecies.json 파일 로딩을 실패하였습니다.
  647.         return
  648.     }
  649.     For idx in Prophecies {
  650.         If (Prophecies[idx]["kr"] = ItemName) {
  651.             ItemData.Set("Name", "kr", ItemName)
  652.             ItemData.Set("Name", "en", Prophecies[idx]["en"])
  653.             return
  654.         }
  655.     }
  656.     return
  657. }
  658.  
  659. SetBase(BaseName){
  660.     If (!BaseItemTypes){
  661.         MsgBox, BaseItemTypes.json 파일 로딩을 실패하였습니다.
  662.         return
  663.     }
  664.     If ( ItemData.Get("Rarity", "en") = "Magic"){
  665.         RemoveAffix(BaseName)
  666.     }
  667.     For idx in BaseItemTypes {
  668.         BaseList := StrSplit(BaseItemTypes[idx]["Id"], "/", "`r")
  669.         ; Metadata/Items/Armours/Shields/ShieldStrDex13
  670.         ; BaseTypeRx := BaseItemTypes[idx]["kr"]
  671.         ; BaseTypeRx := RegExReplace(BaseTypeRx, "\.", "\.")
  672.         ; BaseTypeRx := "(?<=[^가-힣])" . BaseTypeRx . "(?=[^가-힣])"
  673.         If (BaseList[3] != "MicrotransactionItemEffects" && BaseItemTypes[idx]["kr"] = BaseName) {
  674.             ItemData.Set("ItemBase", "kr", BaseItemTypes[idx]["kr"])
  675.             ItemData.Set("ItemBase", "en", BaseItemTypes[idx]["en"])
  676.             ItemData.Set("ItemBase", "id", BaseItemTypes[idx]["Id"])
  677.  
  678.             ItemData.Set("Metadat", "List", BaseList)
  679.             ItemData.Set("Metadat", "Type", BaseList[3])
  680.             If (BaseList[3] = "Weapons") {
  681.                 ItemData.Set("Metadat", "TypeDetail", BaseList[5])
  682.             }Else{
  683.                 ItemData.Set("Metadat", "TypeDetail", BaseList[4])
  684.             }
  685.             ParseFilterCategory()
  686.         return
  687.         }
  688.     }
  689.     return
  690. }
  691.  
  692. RemoveAffix(ByRef Name){
  693.     If (!Mods){
  694.         MsgBox, Mods.json 파일 로딩을 실패하였습니다.
  695.         return
  696.     }
  697.  
  698.     Name := RegExReplace(Name, " - [가-힣 ]+$", "")
  699.  
  700.     For idx in Mods {
  701.         regex := "^" . Mods[idx]["kr"] . "(\s+|)"
  702.         Name := RegExReplace(Name, regex, "")
  703.     }
  704.     ; MsgBox, %Name%
  705.  
  706.     return
  707. }
  708.  
  709. ParseFilterCategory(){
  710.     Type := ItemData.Get("Metadat", "Type")
  711.     TypeDetail := ItemData.Get("Metadat", "TypeDetail")
  712.  
  713.     If(RegExMatch("Bows", "^(" . Type . "|" . TypeDetail . ")" )){
  714.         ItemData.Set("Filters", "type", "weapon.bow")
  715.     }Else If(RegExMatch("Claws", "^(" . Type . "|" . TypeDetail . ")" )){
  716.         ItemData.Set("Filters", "type", "weapon.claw")
  717.     }Else If(RegExMatch("Daggers", "^(" . Type . "|" . TypeDetail . ")" )){
  718.         ItemData.Set("Filters", "type", "weapon.dagger")
  719.     }Else If(RegExMatch("OneHandAxes", "^(" . Type . "|" . TypeDetail . ")" )){
  720.         ItemData.Set("Filters", "type", "weapon.oneaxe")
  721.     }Else If(RegExMatch("OneHandMaces", "^(" . Type . "|" . TypeDetail . ")" )){
  722.         ItemData.Set("Filters", "type", "weapon.onemace")
  723.     }Else If(RegExMatch("OneHandSwords", "^(" . Type . "|" . TypeDetail . ")" )){
  724.         ItemData.Set("Filters", "type", "weapon.onesword")
  725.     }Else If(RegExMatch("OneHandThrustingSwords", "^(" . Type . "|" . TypeDetail . ")" )){
  726.         ItemData.Set("Filters", "type", "weapon.onesword")
  727.     }Else If(RegExMatch("Staves", "^(" . Type . "|" . TypeDetail . ")" )){
  728.         ItemData.Set("Filters", "type", "weapon.staff")
  729.     }Else If(RegExMatch("TwoHandAxes", "^(" . Type . "|" . TypeDetail . ")" )){
  730.         ItemData.Set("Filters", "type", "weapon.twoaxe")
  731.     }Else If(RegExMatch("TwoHandMaces", "^(" . Type . "|" . TypeDetail . ")" )){
  732.         ItemData.Set("Filters", "type", "weapon.twomace")
  733.     }Else If(RegExMatch("TwoHandSwords", "^(" . Type . "|" . TypeDetail . ")" )){
  734.         ItemData.Set("Filters", "type", "weapon.twosword")
  735.     }Else If(RegExMatch("Wands", "^(" . Type . "|" . TypeDetail . ")" )){
  736.         ItemData.Set("Filters", "type", "weapon.wand")
  737.     }Else If(RegExMatch("FishingRods", "^(" . Type . "|" . TypeDetail . ")" )){
  738.         ItemData.Set("Filters", "type", "weapon.rod")
  739.     }Else If(RegExMatch("BodyArmours", "^(" . Type . "|" . TypeDetail . ")")){
  740.         ItemData.Set("Filters", "type", "armour.chest")
  741.     }Else If(RegExMatch("Boots", "^(" . Type . "|" . TypeDetail . ")")){
  742.         ItemData.Set("Filters", "type", "armour.boots")
  743.     }Else If(RegExMatch("Gloves", "^(" . Type . "|" . TypeDetail . ")")){
  744.         ItemData.Set("Filters", "type", "armour.gloves")
  745.     }Else If(RegExMatch("Helmets", "^(" . Type . "|" . TypeDetail . ")")){
  746.         ItemData.Set("Filters", "type", "armour.helmet")
  747.     }Else If(RegExMatch("Shields", "^(" . Type . "|" . TypeDetail . ")")){
  748.         ItemData.Set("Filters", "type", "armour.shield")
  749.     }Else If(RegExMatch("Quivers", "^(" . Type . "|" . TypeDetail . ")")){
  750.         ItemData.Set("Filters", "type", "armour.quiver")
  751.     }Else If(RegExMatch("Amulets", "^(" . Type . "|" . TypeDetail . ")" )){
  752.         ItemData.Set("Filters", "type", "accessory.amulet")
  753.     }Else If(RegExMatch("Belts", "^(" . Type . "|" . TypeDetail . ")" )){
  754.         ItemData.Set("Filters", "type", "accessory.belt")
  755.     }Else If(RegExMatch("Rings", "^(" . Type . "|" . TypeDetail . ")" )){
  756.         ItemData.Set("Filters", "type", "accessory.ring")
  757.     }Else If(RegExMatch("Gems", "^(" . Type . "|" . TypeDetail . ")" )){
  758.         ItemData.Set("Filters", "type", "gem")
  759.     }Else If(RegExMatch("Jewels", "^(" . Type . "|" . TypeDetail . ")" )){
  760.         ItemData.Set("Filters", "type", "jewel")
  761.     ; }Else If(RegExMatch(@, "^(" . Type . "|" . TypeDetail . ")" )){
  762.     ;   ItemData.Set("Filters", "type", "jewel.abyss")
  763.     }Else If(RegExMatch("Flasks", "^(" . Type . "|" . TypeDetail . ")" )){
  764.         ItemData.Set("Filters", "type", "flask")
  765.     }Else If(RegExMatch("Maps", "^(" . Type . "|" . TypeDetail . ")" )){
  766.         ItemData.Set("Filters", "type", "map")
  767.     }Else If(RegExMatch("Leaguestones", "^(" . Type . "|" . TypeDetail . ")" )){
  768.         ItemData.Set("Filters", "type", "leaguestone")
  769.     ; }Else If(RegExMatch("", "^(" . Type . "|" . TypeDetail . ")" )){
  770.     ;   ItemData.Set("Filters", "type", "prophecy")
  771.     ; }Else If(RegExMatch(@, "^(" . Type . "|" . TypeDetail . ")" )){
  772.     ;   ItemData.Set("Filters", "type", "card")
  773.     ; }Else If(RegExMatch(@, "^(" . Type . "|" . TypeDetail . ")" )){
  774.     ;   ItemData.Set("Filters", "type", "monster")
  775.     ; }Else If(RegExMatch(@, "^(" . Type . "|" . TypeDetail . ")" )){
  776.     ;   ItemData.Set("Filters", "type", "currency")
  777.     ; }Else If(RegExMatch(@, "^(" . Type . "|" . TypeDetail . ")" )){
  778.     ;   ItemData.Set("Filters", "type", "currency.piece")
  779.     ; }Else If(RegExMatch(@, "^(" . Type . "|" . TypeDetail . ")" )){
  780.     ;   ItemData.Set("Filters", "type", "currency.resonator")
  781.     ; }Else If(RegExMatch(@, "^(" . Type . "|" . TypeDetail . ")" )){
  782.     ;   ItemData.Set("Filters", "type", "currency.fossil")
  783.     ; }Else If(RegExMatch(@, "^(" . Type . "|" . TypeDetail . ")" )){
  784.     ;   ItemData.Set("Filters", "type", "currency.incubator")
  785.     ; }
  786.     }Else{
  787.         ItemData.Set("Filters", "type", "null")
  788.     }
  789.     return
  790. }
  791.  
  792.  
  793. SetStatFilter(Str, ByRef StatList){
  794.     If (!StatFiltersKr){
  795.         MsgBox, StatFiltersKr.json 파일 로딩을 실패하였습니다.
  796.         return
  797.     }
  798.  
  799.     StatLabel :=
  800.     Str := RegExReplace(Str, "<<.*>>", "")
  801.     Signs := 1
  802.  
  803.     If (RegExMatch(Str, "\([a-zA-Z]+\)", match)){
  804.         StatType := match1
  805.         StatLabel := GetStatTypeLabel(StatType)
  806.     }
  807.  
  808.     If (RegExMatch(Str, "감소")){
  809.         Str := RegExReplace(Str, "감소", "증가")
  810.         StatLabel := GetStatTypeLabel(StatType)
  811.         Signs := -1
  812.     }
  813.  
  814.     StatFilter :=
  815.     If (StatLabel){
  816.         For idx in StatFiltersKr {
  817.             If (StatLabel = StatFiltersKr[idx]["label"]){
  818.                 StatFilter := StatFiltersKr[idx]["entries"]
  819.                 break
  820.             }
  821.         }
  822.         For idx in StatFilter {
  823.             regex := RegExReplace(Str, "[0-9\.+]+", "#")
  824.             regex := RegExReplace(regex, " \([a-zA-Z]+\)", "")
  825.             regex := RegExReplace(regex, "\+#", "(\+|)#")
  826.             regex := "^" . regex . "(\n|\s*$)"
  827.             If (RegExMatch(StatFilter[idx]["text"], regex, mat)) {
  828.                 Stat := {}
  829.                 Stat["id"] := StatFilter[idx]["id"]
  830.                 Stat["text"] :=  RegExReplace(StatFilter[idx]["text"], "\n", " ")
  831.                 Stat["isChecked"] := False
  832.                 StatList.push(Stat)
  833.  
  834.                 If (RegExMatch(Str, "([0-9\.+]+)~([0-9\.+]+)", match)){
  835.                     Stat["values"] := [Signs * match1 , Signs * match2]
  836.                 }Else If(RegExMatch(Str, "([0-9\.+]+)", match)){
  837.                     Stat["values"] := [Signs * match1]
  838.                 }Else {
  839.                     Stat["values"] := []
  840.                 }
  841.                 return
  842.             }
  843.         }
  844.     }else{
  845.         ; TODO : 순서
  846.         StatLabelOrder = []
  847.         For fdx in StatFiltersKr{
  848.             StatFilter := StatFiltersKr[fdx]["entries"]
  849.             For idx in StatFilter {
  850.                 regex := RegExReplace(Str, "[0-9\.+]+", "#")
  851.                 regex := RegExReplace(regex, " \([a-zA-Z]+\)", "")
  852.                 regex := RegExReplace(regex, "\+#", "(\+|)#")
  853.                 regex := "^" . regex . "(\n|\s*$)"
  854.  
  855.                 If (RegExMatch(StatFilter[idx]["text"], regex, mat)) {
  856.                     Stat := {}
  857.                     Stat["id"] :=  StatFilter[idx]["id"]
  858.                     Stat["text"] :=  RegExReplace(StatFilter[idx]["text"], "\n", " ")
  859.                     Stat["isChecked"] := False
  860.  
  861.                     If (RegExMatch(Str, "([0-9\.+]+)~([0-9\.+]+)", match)){
  862.                         Stat["values"] := [Signs * match1 , Signs * match2]
  863.                     }Else If(RegExMatch(Str, "([0-9\.+]+)", match)){
  864.                         Stat["values"] := [Signs * match1]
  865.                     }Else {
  866.                         Stat["values"] := []
  867.                     }
  868.                     StatList.push(Stat)
  869.                     return
  870.                 }
  871.             }
  872.         }
  873.     }
  874.  
  875.     return
  876. }
  877.  
  878. GetStatTypeLabel(txt){
  879.     If (txt = "pseudo")
  880.         return "유사"
  881.     If (txt = "explict")
  882.         return "무작위"
  883.     Else If (txt = "implict")
  884.         return "고정"
  885.     Else If (txt = "fractured")
  886.         return "분열된"
  887.     Else If (txt = "enchant")
  888.         return "인챈트"
  889.     Else If (txt = "crafted")
  890.         return "제작된"
  891.     Else If (txt = "veiled")
  892.         return "장막"
  893.     Else If (txt = "monster")
  894.         return "몬스터"
  895.     Else If (txt = "delve")
  896.         return "탐광"
  897.     Else {
  898.         ; return "유사"
  899.         return
  900.     }
  901. }
  902.  
  903. WikiSearch(){
  904.  
  905.     Keyword := GetNameOrBase("en")
  906.     If (Keyword == ""){
  907.         return
  908.     }
  909.     StringReplace, Search, Keyword, %A_SPACE%, +, All
  910.     url = http://pathofexile.gamepedia.com/index.php?search=%Search%
  911.     Run %url%
  912. }
  913.  
  914. /*
  915.     Trade Parameter
  916. */
  917.  
  918. GetSourceParam(lang){
  919.     ; HACK : 추후에 추가로 정리할것
  920.     ItemName := ItemData.get("Name", lang)
  921.     ItemBase := ItemData.get("ItemBase", lang)
  922.     ItemCategory := ItemData.get("Filters", "Category")
  923.  
  924.     p_params := {}
  925.     p_query := {}
  926.     p_status := {}
  927.     p_option := "online"
  928.     p_status["option"] := p_option
  929.     p_query["status"] := p_status
  930.     If (!ItemCategory["isChecked"])
  931.     {
  932.         If (ItemName != ""){
  933.             p_name := ItemName
  934.             p_query["name"] := p_name
  935.         }
  936.         If (ItemBase != ""){
  937.             p_type := ItemBase
  938.             p_query["type"] := ItemBase
  939.         }
  940.     }else{
  941.         p_query["filters"] := {}
  942.         p_query["filters"]["type_filters"] := GetTypeFilterParam()
  943.     }
  944.     p_query["stats"] := GetStatFilterParam()
  945.  
  946.     p_params["query"] := p_query
  947.     p_params["sort"] := {}
  948.     p_params["sort"]["price"] := "asc"
  949.  
  950.     jsonStr := JSON.dump(p_params)
  951.  
  952.     return jsonStr
  953. }
  954.  
  955. GetFetchSource(obj){
  956.     If (not obj){
  957.         return
  958.     }
  959.  
  960.     params :=
  961.  
  962.     result := obj.result
  963.     maxIdx := result.MaxIndex()
  964.     For idx in result{
  965.         params .= result[idx]
  966.  
  967.         If (idx != maxIdx && idx != 10){
  968.             params .= ","
  969.         } Else {
  970.             break
  971.         }
  972.  
  973.     }
  974.     params .= "?query="
  975.     params .= obj.id
  976.  
  977.     return params
  978. }
  979.  
  980. GetToolTipString(obj)
  981. {
  982.     resultStr := ""
  983.     If (not obj.result){
  984.         return "검색결과가 없습니다."
  985.     }
  986.  
  987.     resultList := obj.result
  988.  
  989.     name := GetNameOrBase("kr")
  990.  
  991.     resultStr .= "검색아이템 : " . name . "`r"
  992.     resultStr .= "-----------------------------------------------------------------------------------------" . "`r"
  993.     resultStr .= StrPad("계정", 20) . "|"
  994.     resultStr .= StrPad("캐릭터명", 20) . "|"
  995.     resultStr .= StrPad("가격", 26) . "|"
  996.     resultStr .= StrPad("ilvl", 4) . "|"
  997.     resultStr .= StrPad("등록", 9) . "`r"
  998.     resultStr .= "-----------------------------------------------------------------------------------------" . "`r"
  999.     for idx in resultList {
  1000.         result := resultList[idx]
  1001.         resultStr .= StrPad(result.listing.account.name, 20) . "|"
  1002.         resultStr .= StrPad(result.listing.account.lastCharacterName, 20) . "|"
  1003.         resultStr .= StrPad(result.listing.price.amount, 5, "left") . " "
  1004.         resultStr .= StrPad(TradeFilter2Kr(result.listing.price.currency), 20) . "|"
  1005.         resultStr .= StrPad(result.item.ilvl, 4 ) . "|"
  1006.         resultStr .= StrPad(TradeAddedDate2Kr(result.listing.indexed), 9)
  1007.         resultStr .= "`r"
  1008.     }
  1009.  
  1010.     return resultStr
  1011. }
  1012.  
  1013. ; Pads a string with a multiple of PadChar to become a wanted total length.
  1014. ; Note that Side is the side that is padded not the anchored side.
  1015. ; Meaning, if you pad right side, the text will move left. If Side was an
  1016. ; anchor instead, the text would move right if anchored right.
  1017. StrPad(String, Length, Side="right", PadChar=" ")
  1018. {
  1019.     Len := StrLength(String)
  1020.     AddLen := Length-Len
  1021.     If (AddLen <= 0)
  1022.     {
  1023.         return String
  1024.     }
  1025.     Pad := StrMult(PadChar, AddLen)
  1026.     If (Side == "right")
  1027.     {
  1028.         Result := String . Pad
  1029.     }
  1030.     Else
  1031.     {
  1032.         Result := Pad . String
  1033.     }
  1034.     return Result
  1035. }
  1036.  
  1037. StrMult(Char, Times)
  1038. {
  1039.     Result =
  1040.     Loop, %Times%
  1041.     {
  1042.         Result := Result . Char
  1043.     }
  1044.     return Result
  1045. }
  1046.  
  1047. StrLength(String)
  1048. {
  1049.     len := StrLen(String)
  1050.     StrSize := 0
  1051.     result := ""
  1052.     i := 1
  1053.     While (i <= len) {
  1054.         char := SubStr(String, i, 1) ;
  1055.         if(RegExMatch(char, "[ㄱ-ㅎ가-힣]")){
  1056.             StrSize += 2
  1057.         }else{
  1058.             StrSize += 1
  1059.         }
  1060.         i++
  1061.     }
  1062.     return StrSize
  1063. }
  1064.  
  1065. GetTypeFilterParam(){
  1066.     params := []
  1067.     pFilters := []
  1068.     pTypeFilters := []
  1069.     filterType := ItemData.Get("Filters", "type")
  1070.  
  1071.     If ( filterType ){
  1072.  
  1073.         ;p2 := RegExReplace(p2, "s$", "")
  1074.         pInnerFilters := []
  1075.         pInnerFilters["category"] := []
  1076.         pInnerFilters["category"]["option"] :=  filterType
  1077.         pTypeFilters["filters"] := pInnerFilters
  1078.         pTypeFilters["disabled"] := false
  1079.     }Else {
  1080.         pTypeFilters["disabled"] := true
  1081.     }
  1082.  
  1083.     return pTypeFilters
  1084. }
  1085.  
  1086. GetStatFilterParam(){
  1087.  
  1088.     params := []
  1089.     pStats := []
  1090.     pStatsOne := {}
  1091.     pType := "and"
  1092.     pFilters := []
  1093.  
  1094.     statList := ItemData.get("Stat", "StatList")
  1095.     for idx in StatList{
  1096.         stat := {}
  1097.         value := {}
  1098.         If ( StatList[idx]["isChecked"] ){
  1099.             stat["id"] := StatList[idx]["id"]
  1100.             value["max"] := StatList[idx]["max"]
  1101.             value["min"] := StatList[idx]["min"]
  1102.             stat["value"] := value
  1103.  
  1104.             pFilters.push(stat)
  1105.         }
  1106.     }
  1107.     pStatsOne["type"] := pType
  1108.     pStatsOne["filters"] := pFilters
  1109.     pStats.push(pStatsOne)
  1110.     params["stats"] := pStats
  1111.  
  1112.     return pStats
  1113. }
  1114.  
  1115. TradeOptionCheck(){
  1116.     Global
  1117.  
  1118.     paramList := ItemData.get("Stat", "StatList")
  1119.  
  1120.     Itemname := GetNameOrBase("kr") . "(" . GetNameOrBase("en") . ")"
  1121.     Rarity := ItemData.get("Rarity", "en")
  1122.     IsBase := ""
  1123.     If (Rarity != "Unique"){
  1124.         IsBase := "Checked"
  1125.     }
  1126.  
  1127.     Gui 1:Destroy
  1128.     Gui 1:Add, Text, x48 y20 w312 h23 +0x200, %Itemname%
  1129.     Gui 1:Add, Checkbox, x447 y20 w139 h23 %IsBase% vIsCheckedBase, 베이스로 검색
  1130.  
  1131.     ; Name
  1132.     Gui 1:Add, Text, x48 y48 w312 h23 +0x200, 옵션
  1133.     Gui 1:Add, Text, x368 y48 w60 h23, 최소
  1134.     Gui 1:Add, Text, x447 y48 w60 h23, 현재
  1135.     Gui 1:Add, Text, x526 y48 w60 h23, 최대
  1136.     ; Split Line
  1137.     Gui 1:Add, Text, x45 y68 w532 h2 +0x10
  1138.  
  1139.     option_cnt := 6
  1140.     optionY := 88
  1141.     IntrvY := 33
  1142.  
  1143.     For idx In paramList
  1144.     {
  1145.         txt := paramList[idx]["text"]
  1146.         values := paramList[idx]["values"]
  1147.         value := 0
  1148.         for jdx in values {
  1149.             value += values[jdx]
  1150.         }
  1151.         value := Round( value / paramList[idx]["values"].MaxIndex() , 1 )
  1152.         ; value := paramList[idx]["values"][1]
  1153.         Gui 1:Add, Text, x48 y%optionY% w312 h23 +0x200, %txt%
  1154.         Gui 1:Add, Edit, x368 y%optionY% w60 h23 vMin%idx%
  1155.         Gui 1:Add, Text, x447 y%optionY% w60 h23, %value%
  1156.         Gui 1:Add, Edit, x526 y%optionY% w60 h23 vMax%idx%
  1157.         Gui 1:Add, Checkbox, x595 y%optionY% w23 h23 vIsChecked%idx% Checked
  1158.         optionY += IntrvY
  1159.     }
  1160.  
  1161.     optionY += 20
  1162.  
  1163.     Gui 1:Add, Button, x402 y%optionY% w80 h23 gGuiSearch, &Search
  1164.     Gui 1:Add, Button, x508 y%optionY% w80 h23 gGuiClose, &Cancel
  1165.  
  1166.     optionY += 33
  1167.  
  1168.     Gui 1:Show, w620 h%optionY%, Window
  1169.     Return
  1170. }
  1171.  
  1172. TradeOptionChange(){
  1173.     Global
  1174.  
  1175.     Gui, 1:Submit
  1176.  
  1177.     paramList := ItemData.get("Stat", "StatList")
  1178.  
  1179.     obj := []
  1180.     obj["isChecked"] := IsCheckedBase
  1181.  
  1182.     ItemData.Set("Filters", "Category", obj)
  1183.  
  1184.     For idx In paramList
  1185.     {
  1186.         paramList[idx]["isChecked"] := IsChecked%idx%
  1187.         If (IsChecked%idx%){
  1188.             paramList[idx]["min"] := Min%idx%
  1189.             paramList[idx]["max"] := Max%idx%
  1190.         }
  1191.     }
  1192.  
  1193.     ItemData.set("Stat", paramList)
  1194.  
  1195.     return
  1196. }
  1197.  
  1198. ShowToolTip(String)
  1199. {
  1200.     ; Global X, Y, ToolTipTimeout, Opts, gdipTooltip, Item
  1201.     Global X,Y,IsActiveWindow
  1202.  
  1203.     SetTimer, ToolTipTimer, Off
  1204.     ; Get position of mouse cursor
  1205.     MouseGetPos, X, Y
  1206.     WinGet, PoEWindowHwnd, ID, ahk_group PoEWindowGrp
  1207.     ; RelativeToActiveWindow := true    ; default tooltip behaviour
  1208.     ; IsActiveWindow := true
  1209.  
  1210.     ; If (not RelativeToActiveWindow) {
  1211.     ;   OldCoordMode := A_CoordModeToolTip
  1212.     ;   CoordMode, Tooltip, Screen
  1213.     ; }
  1214.  
  1215.     XCoord := (X - 135 >= 0) ? X - 135 : 0
  1216.     YCoord := (Y +  35 >= 0) ? Y +  35 : 0
  1217.  
  1218.     ToolTip, %String%, XCoord, YCoord
  1219.     Fonts.SetFixedFont()
  1220.     Sleep, 10
  1221.     ToolTip, %String%, XCoord, YCoord
  1222.  
  1223.     ; ToolTip, Timed ToolTip`nThis will be displayed for 10 seconds.
  1224.     SetTimer, ToolTipTimer, 200
  1225.  
  1226.     ; If (OldCoordMode) {
  1227.     ;   CoordMode, Tooltip, % OldCoordMode
  1228.     ; }
  1229.  
  1230.     return
  1231.  
  1232. }
  1233.  
  1234. CreateFont(options="", font="") {
  1235.     Loop 99 {
  1236.         g = %a_index%
  1237.         Gui %g%: +LastfoundExist
  1238.         If ! WinExist()
  1239.         break
  1240.     }
  1241.     Gui, %g%: +Lastfound
  1242.     Gui, %g%: Font, %options%, %font%
  1243.     Gui, Add, Button
  1244.     SendMessage, 0x31, 0, 0, Button1  ;WM_GETFONT
  1245.     Gui, %g%: Destroy
  1246.     return errorLevel
  1247. }
  1248.  
  1249. SetFont(ctrl, win, font=0) {
  1250.     SendMessage, 0x30, %font%, 1, %ctrl%, ahk_id%win%
  1251.     return errorLevel
  1252. }
  1253.  
  1254. GetAhkExeFilename(Default_="AutoHotkey.exe")
  1255. {
  1256.     AhkExeFilename := Default_
  1257.     If (A_AhkPath)
  1258.     {
  1259.         StringSplit, AhkPathParts, A_AhkPath, \
  1260.         Loop, % AhkPathParts0
  1261.         {
  1262.             IfInString, AhkPathParts%A_Index%, .exe
  1263.             {
  1264.                 AhkExeFilename := AhkPathParts%A_Index%
  1265.                 Break
  1266.             }
  1267.         }
  1268.     }
  1269.     return AhkExeFilename
  1270. }
  1271.  
  1272. TradeFilter2Kr(String = "")
  1273. {
  1274.     If (!TradeFiltersKr){
  1275.         MsgBox, TradeFiltersKr.json 파일 로딩을 실패하였습니다.
  1276.         return
  1277.     }
  1278.     For idx in TradeFiltersKr {
  1279.         If (TradeFiltersKr[idx]["id"] = String) {
  1280.             return TradeFiltersKr[idx]["text"]
  1281.         }
  1282.     }
  1283.     return
  1284. }
  1285.  
  1286. TradeAddedDate2Kr(String = "")
  1287. {
  1288.  
  1289.     InputDate := RegExReplace(String, "[T,Z,\-,:]", "")
  1290.     FormatTime,TargetTime,%InputDate%, yyyyMMddHHmmss'
  1291.     DifDate := a_nowutc
  1292.  
  1293.     DifDate -= %TargetTime%, s
  1294.  
  1295.     ; DifDate := TargetTime - InputDate ; Sec
  1296.     DifMin := DifDate // 60
  1297.     If (DifMin < 1){
  1298.         resultStr := DifDate . "초전"
  1299.         return resultStr
  1300.     }
  1301.     DifHour := DifMin // 60
  1302.     If (DifHour < 1){
  1303.         resultStr := DifMin . "분전"
  1304.         return resultStr
  1305.     }
  1306.     DifDay := DifHour // 24
  1307.     If (DifDay < 1){
  1308.         resultStr := DifHour . "시간전"
  1309.         return resultStr
  1310.     }
  1311.     DifMonth := DifDay // 30
  1312.     If (DifMonth < 1){
  1313.         resultStr := DifDay . "일전"
  1314.         return resultStr
  1315.     }
  1316.     DifYear := DifMonth // 12
  1317.     If (DifYear < 1){
  1318.         resultStr := DifDay . "달전"
  1319.         return resultStr
  1320.     }
  1321.  
  1322.     resultStr := DifYear . "년전"
  1323.  
  1324.     return resultStr
  1325. }
  1326.  
  1327.  
  1328. ; TODO 예언 검색
  1329. PropheciesSearchGUI(){
  1330.  
  1331.     Global
  1332.     Gui, 2:Destroy
  1333.  
  1334.     LVArray := []
  1335.     Gui, 2:Add, Text, ,Search:
  1336.     Gui, 2:Add, Edit, w400 vSearchTerm gPrpSearch
  1337.     Gui, 2:Add, ListView, grid r20 w400 vLV gPrpListClick, 예언명|영어|ID
  1338.     Gui, 2: Default
  1339.  
  1340.     For idx in Prophecies {
  1341.         pName := Prophecies[idx]["kr"]
  1342.         pValue := Prophecies[idx]["en"]
  1343.         pId := Prophecies[idx]["id"]
  1344.         LV_Add("", pName, pValue, pId)
  1345.         LVArray.Push(Prophecies[idx])
  1346.     }
  1347.  
  1348.     LV_ModifyCol(2, 0)
  1349.     LV_ModifyCol(3, 0)
  1350.     LV_ModifyCol(1, 390)
  1351.  
  1352.     TotalItems := LVArray.Length()
  1353.     Gui, 2:Add, StatusBar, , % "   " . TotalItems . " of " . TotalItems . " Items"
  1354.  
  1355.     Gui, 2:Add, Button, x122 y+20 w80 h23 gGuiPrpWikiSearch, &Wiki
  1356.     Gui, 2:Add, Button, x+10 w80 h23 gGuiPrpNinjaSearch, &Ninja
  1357.     Gui, 2:Add, Button, x+10 w80 h23 gGuiClose, &Cancel
  1358.     Gui, 2:Show, , ListView
  1359.     GuiControl, +Redraw, LV
  1360.     Return
  1361. }
  1362.  
  1363. ; -------------------------------------------------------------------------
  1364. ; GUI Functions
  1365. ;--------------------------------------------------------------------------
  1366.  
  1367.  
  1368. GuiClose:
  1369.     Gui, Cancel
  1370.     return
  1371.    
  1372. GuiShow:
  1373.     Gui, 2:Show
  1374.     return
  1375.    
  1376. 2GuiClose:
  1377.     Gui, 2:Cancel
  1378.     return
  1379.  
  1380. GuiSearch:
  1381.     TradeOptionChange()
  1382.     TradeDaumSearch()
  1383.     Gui, 1:Destroy
  1384.     return
  1385.  
  1386. PrpSearch:
  1387.     GuiControlGet, SearchTerm
  1388.     GuiControl, -Redraw, LV
  1389.     LV_Delete()
  1390.  
  1391.     For Each, Prp In LVArray
  1392.     {
  1393.         PrpName := Prp["kr"]
  1394.         PrpValue := Prp["en"]
  1395.         PrpId := Prp["id"]
  1396.     If (SearchTerm != "")
  1397.     {
  1398.         If (InStr(PrpName, SearchTerm) = 1) ; for matching at the start
  1399.         ; If InStr(FileName, SearchTerm) ; for overall matching
  1400.             LV_Add("", PrpName, PrpValue, PrpId)
  1401.     }
  1402.     Else
  1403.         LV_Add("", PrpName, PrpValue, PrpId)
  1404.     }
  1405.     Items := LV_GetCount()
  1406.     SB_SetText("   " . Items . " of " . TotalItems . " Items")
  1407.     GuiControl, +Redraw, LV
  1408.     Return
  1409.  
  1410. PrpListClick:
  1411.     if A_GuiEvent = DoubleClick
  1412.     {
  1413.         LV_GetText(RowText, A_EventInfo, 2)  ; Get the text from the row's first field.
  1414.         ;;ToolTip You double-clicked row number %A_EventInfo%. Text: "%RowText%";
  1415.         ;;SetTimer, RemoveToolTip, 3000
  1416.         GuiControl, +Redraw, LV
  1417.         msgbox, "%RowText%" 가 클립보드에 카피되었습니다. ctrl + v 를 이용해 붙여넣으세요.
  1418.         Clipboard := RowText
  1419.     }
  1420.     return
  1421.  
  1422.  
  1423. ToolTipTimer:
  1424.     ToolTipTimeout += 1
  1425.     MouseGetPos, CurrX, CurrY
  1426.     MouseMoved := (CurrX - X)**2 + (CurrY - Y)**2 > MouseMoveThreshold**2
  1427.     If (ToolTipTimeout >= 50)
  1428.     {
  1429.         ToolTipTimeout := 0
  1430.         SetTimer, ToolTipTimer, Off
  1431.         ToolTip
  1432.     }
  1433.     return
  1434.  
  1435. GuiPrpWikiSearch:
  1436.     If !(SelectedRow := LV_GetNext()) {
  1437.         MsgBox, 0, %A_ThisLabel%, 리스트에서 선택 후에 눌러주세요
  1438.         Return
  1439.     }
  1440.     LV_GetText(EnName, SelectedRow, 2)
  1441.  
  1442.     ItemData.Set("Classes", "kr", "예언")
  1443.     ItemData.Set("Classes", "en", "prophecies")
  1444.     ItemData.Set("ItemBase", "kr", "예언")
  1445.     ItemData.Set("ItemBase", "en", "prophecies")
  1446.     ItemData.Set("Name", "en", EnName)
  1447.  
  1448.     WikiSearch()
  1449.     Gui, 2:Destroy
  1450.     return
  1451.  
  1452. GuiPrpNinjaSearch:
  1453.     If !(SelectedRow := LV_GetNext()) {
  1454.         MsgBox, 0, %A_ThisLabel%, 리스트에서 선택 후에 눌러주세요
  1455.         Return
  1456.     }
  1457.     LV_GetText(EnName, SelectedRow, 2)
  1458.  
  1459.     ItemData.Set("Classes", "kr", "예언")
  1460.     ItemData.Set("Classes", "en", "prophecies")
  1461.     ItemData.Set("ItemBase", "kr", "예언")
  1462.     ItemData.Set("ItemBase", "en", "prophecies")
  1463.     ItemData.Set("Name", "en", EnName)
  1464.  
  1465.     TradeNinjaSearch()
  1466.     Gui, 2:Destroy
  1467.     return
  1468.  
  1469. TradeDaumSearch(isWeb := true){
  1470.     If (g_league == ""){
  1471.         return
  1472.     }
  1473.     Source := GetSourceParam("kr")
  1474.  
  1475.     resultJson := PoETradeApiSearch("https://poe.game.daum.net/api/trade/search/" . g_league, Source)
  1476.     urlId := resultJson["id"]
  1477.  
  1478.     If (ItemData.isWeb){
  1479.         url = https://poe.game.daum.net/trade/search/%g_league%/%urlId%
  1480.         Run, %url%
  1481.     } Else {
  1482.         TradeToolTip("https://poe.game.daum.net/api/trade/fetch/" , resultJson)
  1483.     }
  1484.     return
  1485. }
  1486.  
  1487. ; TODO : 필요할날이 오면 그때 작업
  1488. TradePoeHomeSearch(isWeb := true){
  1489.     If (g_league == ""){
  1490.         return
  1491.     }
  1492.     Source := GetSourceParam("en")
  1493.  
  1494.     resultJson := PoETradeApiSearch("https://www.pathofexile.com/api/trade/search/" . g_league, Source)
  1495.     urlId := resultJson["id"]
  1496.     url = https://www.pathofexile.com/api/trade/search/%g_league%/%urlId%
  1497.  
  1498.     Run, %runUrl%
  1499.     return
  1500. }
  1501.  
  1502. TradeToolTip(url, resultObj){
  1503.     params := GetFetchSource(resultObj)
  1504.     resultJson := PoETradeApiSearch(url . params)
  1505.     resultStr := GetToolTipString(resultJson)
  1506.     ShowToolTip(resultStr)
  1507.     return
  1508. }
  1509.  
  1510.  
  1511. ; TODO :  ctrl - f 하이라이트 아이템
  1512. HighLightItem(){
  1513.     If (!ItemData.get("Name")){
  1514.         return
  1515.     }
  1516. }
  1517.  
  1518. TradeNinjaSearch(){
  1519.     league := g_league
  1520.     If (league == ""){
  1521.         return
  1522.     }else{
  1523.         StringReplace, league, league, Legion, challenge, All
  1524.     }
  1525.  
  1526.     ItemName := GetNameOrBase("en")
  1527.     Rarity := ItemData.get("Rarity", "en")
  1528.     Classes := ItemData.get("Classes", "en")
  1529.  
  1530.     If (Classes == "" && Rarity = "Unique"){
  1531.         MetaType := ItemData.get("Metadat", "Type")
  1532.         If (MetaType = "Rings" || MetaType = "Amulets" || MetaType = "Belts"){
  1533.             MetaType := "accessories"
  1534.         }
  1535.         Stringlower MetaType, MetaType
  1536.         Classes := "unique-" . MetaType
  1537.     }
  1538.  
  1539.     If (Classes == "" || ItemName == ""){
  1540.         return
  1541.     }
  1542.     ; ItemName := URLEncode(ItemName)
  1543.     url = https://poe.ninja/%league%/%Classes%?name=%ItemName%
  1544.     Run %url%
  1545.  
  1546.     return
  1547. }
  1548.  
  1549. /*
  1550. *********************************************************************************************
  1551.  HOTKEY
  1552. *********************************************************************************************
  1553. */
  1554.  
  1555.  
  1556. LogOut(){ ; log out to character Selection
  1557.     Sleep, 50
  1558.     SendInput {Enter}/{U+0065}{U+0078}{U+0069}{U+0074}{Enter}
  1559.     return
  1560. }
  1561.  
  1562. HideOut(){ ; goto hideout
  1563.     Sleep, 50
  1564.     SendInput {Enter}/{U+0068}{U+0069}{U+0064}{U+0065}{U+006F}{U+0075}{U+0074}{Enter}
  1565.     return
  1566. }
  1567.  
  1568. Oos(){ ; oos
  1569.     Sleep, 50
  1570.     SendInput {Enter}/{U+006F}{U+006F}{U+0073}{Enter}
  1571.     return
  1572. }
  1573.  
  1574. ;UI 추가 소스
  1575. remaining(){ ; 몬스터 확인
  1576.     Sleep, 50
  1577.     SendInput {Enter}/{U+0072}{U+0065}{U+006D}{U+0061}{U+0069}{U+006E}{U+0069}{U+006E}{U+0067}{Enter}
  1578.     return
  1579. }
  1580.  
  1581. ; 클립보드
  1582. CopyText(){
  1583.     Clipboard := ""
  1584.  
  1585.     If (!fileLoadsChck()){
  1586.         MsgBox, 파일로딩이 끝나지 않았습니다.
  1587.         return False
  1588.     }
  1589.     SendInput ^c
  1590.     Sleep, 200
  1591.  
  1592.     If (Clipboard = ""){
  1593.         return False
  1594.     }
  1595.  
  1596.     ClearItemData()
  1597.     GetClipboardName()
  1598.     return True
  1599. }
  1600.  
  1601. ClearItemData(){
  1602.     ItemData := new ItemInfo()
  1603. }
  1604.  
  1605. ;UI추가소스
  1606. Save:
  1607.     GuiControlGet, chkRunAsMinimized
  1608.     GuiControlGet, Lea
  1609.     GuiControlGet, Hot1
  1610.     GuiControlGet, Hot2
  1611.     GuiControlGet, Hot3
  1612.     GuiControlGet, Hot4
  1613.     GuiControlGet, Hot5
  1614.     GuiControlGet, Hot6
  1615.     GuiControlGet, Hot7
  1616.     GuiControlGet, Hot8
  1617.     GuiControlGet, Hot9
  1618.     GuiControlGet, Hot10
  1619.     GuiControlGet, Hot11
  1620.     GuiControlGet, Hot12
  1621.     GuiControlGet, Hot13
  1622.     if Lea = Legion
  1623.     {
  1624.         IniWrite, 1, setting.ini, KeySetting, L
  1625.     }
  1626.     else if Lea = Hardcore Legion
  1627.     {
  1628.         IniWrite, 2, setting.ini, KeySetting, L
  1629.     }
  1630.     else if Lea = Standard
  1631.     {
  1632.         IniWrite, 3, setting.ini, KeySetting, L
  1633.     }
  1634.     else if Lea = Hardcore
  1635.     {
  1636.         IniWrite, 4, setting.ini, KeySetting, L
  1637.     }
  1638.    
  1639.     IniWrite, %chkRunAsMinimized%, setting.ini, General, runAsMinimized
  1640.     IniWrite, %Hot1%, setting.ini, KeySetting, Key1
  1641.     IniWrite, %Hot2%, setting.ini, KeySetting, Key2
  1642.     IniWrite, %Hot3%, setting.ini, KeySetting, Key3
  1643.     IniWrite, %Hot4%, setting.ini, KeySetting, Key4
  1644.     IniWrite, %Hot5%, setting.ini, KeySetting, Key5
  1645.     IniWrite, %Hot6%, setting.ini, KeySetting, Key6
  1646.     IniWrite, %Hot7%, setting.ini, KeySetting, Key7
  1647.     IniWrite, %Hot8%, setting.ini, KeySetting, Key8
  1648.     IniWrite, %Hot9%, setting.ini, KeySetting, Key9
  1649.     IniWrite, %Hot10%, setting.ini, KeySetting, Key10
  1650.     IniWrite, %Hot11%, setting.ini, KeySetting, Key11
  1651.     IniWrite, %Hot12%, setting.ini, KeySetting, Key12
  1652.     IniWrite, %Hot13%, setting.ini, KeySetting, Key13
  1653.     return
  1654.  
  1655. Apply:
  1656.     GuiControlGet, Lea
  1657.     Hotkey, %Hot1%, Hot1, Off
  1658.     Hotkey, %Hot2%, Hot2, Off
  1659.     Hotkey, %Hot3%, Hot3, Off
  1660.     Hotkey, %Hot4%, Hot4, Off
  1661.     Hotkey, %Hot5%, Hot5, Off
  1662.     Hotkey, %Hot6%, Hot6, Off
  1663.     Hotkey, %Hot7%, Hot7, Off
  1664.     Hotkey, %Hot8%, Hot8, Off
  1665.     Hotkey, %Hot9%, Hot9, Off
  1666.     Hotkey, %Hot10%, Hot10, Off
  1667.     Hotkey, %Hot11%, Hot11, Off
  1668.     Hotkey, %Hot12%, Hot12, Off
  1669.     Hotkey, %Hot13%, Hot13, Off
  1670.     if Lea = Legion
  1671.     {
  1672.         ;MsgBox, 1
  1673.         global g_League := "Legion"
  1674.     }
  1675.     else if Lea = Hardcore Legion
  1676.     {
  1677.         ;MsgBox, 2
  1678.         global g_League := "Hardcore Legion"
  1679.     }
  1680.     else if Lea = Standard
  1681.     {
  1682.         ;MsgBox, 3
  1683.         global g_League := "Standard"
  1684.     }
  1685.     else if Lea = Hardcore
  1686.     {
  1687.         ;MsgBox, 4
  1688.         global g_League := "Hardcore"
  1689.     }
  1690.     IniRead, KH1, setting.ini, KeySetting, Key1
  1691.     IniRead, KH2, setting.ini, KeySetting, Key2
  1692.     IniRead, KH3, setting.ini, KeySetting, Key3
  1693.     IniRead, KH4, setting.ini, KeySetting, Key4
  1694.     IniRead, KH5, setting.ini, KeySetting, Key5
  1695.     IniRead, KH6, setting.ini, KeySetting, Key6
  1696.     IniRead, KH7, setting.ini, KeySetting, Key7
  1697.     IniRead, KH8, setting.ini, KeySetting, Key8
  1698.     IniRead, KH9, setting.ini, KeySetting, Key9
  1699.     IniRead, KH10, setting.ini, KeySetting, Key10
  1700.     IniRead, KH11, setting.ini, KeySetting, Key11
  1701.     IniRead, KH12, setting.ini, KeySetting, Key12
  1702.     IniRead, KH13, setting.ini, KeySetting, Key13
  1703.     Hot1 = %KH1%
  1704.     Hot2 = %KH2%
  1705.     Hot3 = %KH3%
  1706.     Hot4 = %KH4%
  1707.     Hot5 = %KH5%
  1708.     Hot6 = %KH6%
  1709.     Hot7 = %KH7%
  1710.     Hot8 = %KH8%
  1711.     Hot9 = %KH9%
  1712.     Hot10 = %KH10%
  1713.     Hot11 = %KH11%
  1714.     Hot12 = %KH12%
  1715.     Hot13 = %KH13%
  1716.     Gui, 2:Submit, Nohide
  1717.     Hotkey, %Hot1%, Hot1, On
  1718.     Hotkey, %Hot2%, Hot2, On
  1719.     Hotkey, %Hot3%, Hot3, On
  1720.     Hotkey, %Hot4%, Hot4, On
  1721.     Hotkey, %Hot5%, Hot5, On
  1722.     Hotkey, %Hot6%, Hot6, On
  1723.     Hotkey, %Hot7%, Hot7, On
  1724.     Hotkey, %Hot8%, Hot8, On
  1725.     Hotkey, %Hot9%, Hot9, On
  1726.     Hotkey, %Hot10%, Hot10, On
  1727.     Hotkey, %Hot11%, Hot11, On
  1728.     Hotkey, %Hot12%, Hot12, On
  1729.     Hotkey, %Hot13%, Hot13, On
  1730.     ;GuiControlGet, Lea
  1731.     ;MsgBox, %Lea%
  1732.     ;MsgBox, %g_league%
  1733.     Return
  1734. Start:
  1735. {
  1736. return
  1737. }
  1738.  
  1739. ; 단축키 항목
  1740. ;#IfWinActive, ahk_group PoEWindowGrp
  1741.  
  1742. hot1:
  1743. {
  1744.     LogOut()
  1745.     return
  1746. }
  1747.  
  1748. hot2:
  1749. {
  1750.     HideOut()
  1751.     return
  1752. }
  1753.  
  1754. hot3:
  1755. {
  1756.     If (CopyText()){
  1757.         WikiSearch()
  1758.     }
  1759.     return
  1760. }
  1761.  
  1762. hot4:
  1763. {
  1764.     If (CopyText()){
  1765.         pasteText := GetNameOrBase("en")
  1766.         Clipboard := pasteText
  1767.     }
  1768.     return
  1769. }
  1770.  
  1771. hot5:
  1772. {
  1773.     If (CopyText()){
  1774.         ItemData.isWeb := true
  1775.         TradeDaumSearch()
  1776.     }
  1777.     return
  1778. }
  1779.  
  1780. hot6:
  1781. {
  1782.     If (CopyText()){
  1783.         ItemData.isWeb := true
  1784.         TradeOptionCheck()
  1785.     }
  1786.     return
  1787. }
  1788.  
  1789. hot7:
  1790. {
  1791.     If (CopyText()){
  1792.         ItemData.isWeb := false
  1793.         TradeDaumSearch()
  1794.     }
  1795.     return
  1796. }
  1797.  
  1798. hot8:
  1799. {
  1800.     If (CopyText()){
  1801.         ItemData.isWeb := false
  1802.         TradeOptionCheck()
  1803.     }
  1804.     return
  1805. }
  1806.  
  1807. hot9:
  1808. {
  1809.     PropheciesSearchGUI()()
  1810.     return
  1811. }
  1812.  
  1813. ; POE Ninja
  1814. hot10:
  1815. {
  1816.     If (CopyText()){
  1817.         TradeNinjaSearch()
  1818.     }
  1819.     return
  1820. }
  1821.  
  1822. hot11:
  1823. {
  1824.     Oos()
  1825.     return
  1826. }
  1827.  
  1828. Hot12:
  1829. Reload
  1830.  
  1831. Hot13:
  1832. {
  1833.     remaining()
  1834.     return
  1835. }
  1836.  
  1837. ~LButton::
  1838. {
  1839.     MouseGetPos,,, winID
  1840.     if (winID = WinExist("ahk_class tooltips_class32"))
  1841.     {
  1842.         ToolTipTimeout := 0
  1843.         ToolTip
  1844.     }
  1845.     return
  1846. }
  1847. ^WheelUp::SendInput {Left}  ;cntl-mouse wheel up toggles stash tabs left
  1848. ^WheelDown::SendInput {Right}  ;cntl-mouse wheel down toggles stash tabs right.
  1849.  
  1850. F12::
  1851. ExitApp
  1852. return
  1853.  
  1854. ; ; PoE 외부에서 실행
  1855.  #IfWinNotActive, ahk_group PoEWindowGrp
  1856.  
  1857. F12::
  1858. ExitApp
  1859. return
  1860. ; ^e::
  1861. ; {
  1862. ;   ClipLine := StrSplit(Clipboard, "`n", "`r")
  1863. ;   SetUniqueName(ClipLine[1])
  1864. ;   pastText := ItemData.get("Name", "en")
  1865. ;   If (pastText = ""){
  1866. ;       pastText := ItemData.get("ItemBase", "en")
  1867. ;   }
  1868. ;   clipboard := pastText
  1869. ;   return
  1870. ; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement