Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SetWorkingDir, %A_ScriptDir%
- #Include %A_ScriptDir%\lib\
- #Include PoeSearch.ahk
- ; #Include PoEGUI_Trade.ahk
- #Include %A_ScriptDir%\lib\third\
- #Include JSON.ahk
- #Include StdOutStream.ahk
- #Include Class_CustomFont.ahk
- ; trade madcro source :
- ; https://github.com/PoE-TradeMacro/POE-TradeMacro
- ; #Include %A_ScriptDir%\lib\third\PoE_TradeMacro\
- ; #Include Class_GdipTooltip.ahk
- ; #Include Script_Gui.ahk
- ; #Include Class_ColorPicker.ahk
- ; #Include Class_SplashUI.ahk
- ; 폰트로딩
- ; global FixedFont := New CustomFont(A_ScriptDir "\resource\fonts\D2Coding.ttf")
- ; global fonts := CreateFont("s10", "D2Coding")
- ; 관리자권한 체크
- if not A_IsAdmin{
- Run *RunAs "%A_ScriptFullPath%"
- ExitApp
- }
- Menu, Tray, add, Open window, GuiShow
- Menu, Tray, Default, Open window
- Menu, Tray, Click, 2
- ; Exe 그룹
- GroupAdd, PoEWindowGrp, Path of Exile ahk_class POEWindowClass ahk_exe PathOfExile.exe
- GroupAdd, PoEWindowGrp, Path of Exile ahk_class POEWindowClass ahk_exe PathOfExile_KG.exe
- GroupAdd, PoEWindowGrp, Path of Exile ahk_class POEWindowClass ahk_exe PathOfExileSteam.exe
- GroupAdd, PoEWindowGrp, Path of Exile ahk_class POEWindowClass ahk_exe PathOfExile_x64.exe
- GroupAdd, PoEWindowGrp, Path of Exile ahk_class POEWindowClass ahk_exe PathOfExile_x64_KG.exe
- GroupAdd, PoEWindowGrp, Path of Exile ahk_class POEWindowClass ahk_exe PathOfExile_x64Steam.exe
- ;UI추가 소스
- IniRead, LL, setting.ini, KeySetting, L
- IniRead, KH1, setting.ini, KeySetting, Key1
- IniRead, KH2, setting.ini, KeySetting, Key2
- IniRead, KH3, setting.ini, KeySetting, Key3
- IniRead, KH4, setting.ini, KeySetting, Key4
- IniRead, KH5, setting.ini, KeySetting, Key5
- IniRead, KH6, setting.ini, KeySetting, Key6
- IniRead, KH7, setting.ini, KeySetting, Key7
- IniRead, KH8, setting.ini, KeySetting, Key8
- IniRead, KH9, setting.ini, KeySetting, Key9
- IniRead, KH10, setting.ini, KeySetting, Key10
- IniRead, KH11, setting.ini, KeySetting, Key11
- IniRead, KH12, setting.ini, KeySetting, Key12
- IniRead, KH13, setting.ini, KeySetting, Key13
- IniRead, KH14, setting.ini, KeySetting, Key14
- IniRead, runAsMinimized, setting.ini, General, runAsMinimized
- Lea =
- Hotkey, ifwinactive, ahk_group PoEWindowGrp
- Gui, 2:Submit, Nohide
- Hotkey, %KH1%, Hot1, On
- Hotkey, %KH2%, Hot2, On
- Hotkey, %KH3%, Hot3, On
- Hotkey, %KH4%, Hot4, On
- Hotkey, %KH5%, Hot5, On
- Hotkey, %KH6%, Hot6, On
- Hotkey, %KH7%, Hot7, On
- Hotkey, %KH8%, Hot8, On
- Hotkey, %KH9%, Hot9, On
- Hotkey, %KH10%, Hot10, On
- Hotkey, %KH11%, Hot11, On
- Hotkey, %KH12%, Hot12, On
- Hotkey, %KH13%, Hot13, On
- Gui, 2:Add, Text, x10 y10 w100 h15 Center, 리 그 선 택
- Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 로 그 아 웃
- Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 은 신 처 이 동
- Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 위 키 검 색
- Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 영문 이름 복사
- Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 다음 공홈 검색
- Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 다음 옵션 검색
- Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 툴 팁 검 색
- Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 툴팁 옵션 검색
- Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 예 언 검 색
- Gui, 2:Add, Text, x10 y+10 w100 h15 Center, POE NINJA 검색
- Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 싱 크 맞 춤
- Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 재 실 행
- Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 몬 스 터 확 인
- Gui, 2:Add, Checkbox, vchkRunAsMinimized Checked%runAsMinimized% x10 y+10 w150 h15 Center, 최소화 상태로 실행하기
- ;Gui, 2:Add, Text, x10 y+10 w100 h15 Center, 재실행
- Gui, 2:Add, DropDownList, vLea gStart x115 y6 w100 h80 Choose%LL%, Legion|Hardcore Legion|Standard|Hardcore
- Gui, 2:Add, Hotkey, vHot1 x115 y+5 w100 h20, %KH1% ;F4
- Gui, 2:Add, Hotkey, vHot2 x115 y+5 w100 h20, %KH2% ;F5
- Gui, 2:Add, Hotkey, vHot3 x115 y+5 w100 h20, %KH3% ;^W
- Gui, 2:Add, Hotkey, vHot4 x115 y+5 w100 h20, %KH4% ;^E
- Gui, 2:Add, Hotkey, vHot5 x115 y+5 w100 h20, %KH5% ;^Q
- Gui, 2:Add, Hotkey, vHot6 x115 y+5 w100 h20, %KH6% ;^D
- Gui, 2:Add, Hotkey, vHot7 x115 y+5 w100 h20, %KH7% ;^N
- Gui, 2:Add, Hotkey, vHot8 x115 y+5 w100 h20, %KH8% ;^~
- Gui, 2:Add, Hotkey, vHot9 x115 y+5 w100 h20, %KH9% ;^!R
- Gui, 2:Add, Hotkey, vHot10 x115 y+5 w100 h20, %KH10% ;F3
- Gui, 2:Add, Hotkey, vHot11 x115 y+5 w100 h20, %KH11%
- Gui, 2:Add, Hotkey, vHot12 x115 y+5 w100 h20, %KH12%
- Gui, 2:Add, Hotkey, vHot13 x115 y+5 w100 h20, %KH13%
- ;Gui, 2:Add, Hotkey, vHot14 x115 y+5 w100 h20, %KH14%
- Gui, 2:Add, Button, gSave x10 y+35 w205 h30, 저장
- Gui, 2:Add, Button, gApply x10 y+5 w205 h30, 적용
- Gui, 2:-MinimizeBox
- if(runAsMinimized != 1)
- Gui, 2:Show, ,단축키 설정
- ; 리그설정
- global g_league := "Legion" ; 챌린지
- ; global g_league := "Hardcore Legion" ; 챌린지 하드코어
- ; global g_league := "Standard" ;스탠다드
- ; global g_league := "Hardcore" ;하드코어
- ; Json 저장
- global WordList :=
- global BaseItemTypes :=
- global ItemClasses :=
- global Prophecies :=
- global StatFiltersKr :=
- global TradeFiltersKr :=
- global TypeFiltersKr :=
- global Mods :=
- class ItemInfo {
- isWeb := "true"
- Set(name, lang, value) {
- If (!This[name]){
- This[name] := {}
- }
- This[name][lang] := value
- return value
- }
- Get(name, lang, value_default="") {
- result := This[name][lang]
- If (result == "") {
- result := value_default
- }
- return result
- }
- }
- class Fonts {
- __New(FontSizeFixed, FontSizeUI = 9)
- {
- this.FontSizeFixed := FontSizeFixed
- this.FontSizeUI := FontSizeUI
- this.FixedFont := this.CreateFixedFont(this.FontSizeFixed)
- this.UIFont := this.CreateUIFont(this.FontSizeUI)
- ;debugprintarray(this)
- }
- CreateFixedFont(FontSize_, Options = "")
- {
- ; Q5 = Windows XP and later: If set, text is rendered (when possible) using ClearType antialiasing method.
- Options .= " q5 "
- If (!(FontSize_ == ""))
- {
- Options .= "s" FontSize_
- }
- ; Gui Font, %Options%, Courier New
- Gui Font, %Options%, D2Coding
- Gui Add, Text, HwndHidden h0 w0 x0 y0,
- SendMessage, 0x31,,,, ahk_id %Hidden%
- return ErrorLevel
- }
- CreateUIFont(FontSize_, Options = "")
- {
- ; Q5 = Windows XP and later: If set, text is rendered (when possible) using ClearType antialiasing method.
- Options .= " q5 "
- If (!(FontSize_ == ""))
- {
- Options .= "s" FontSize_
- }
- Gui, SettingsUI:Font, %Options%, Arial
- Gui, SettingsUI:Font, %Options%, Tahoma
- Gui, SettingsUI: Font, %Options%, Segoe UI
- Gui, SettingsUI: Font, %Options%, Verdana
- Gui, SettingsUI: Add, Text, HwndHidden h0 w0 x0 y0,
- SendMessage, 0x31,,,, ahk_id %Hidden%
- return ErrorLevel
- }
- Set(NewFont)
- {
- AhkExe := GetAhkExeFilename()
- SendMessage, 0x30, NewFont, 1,, ahk_class tooltips_class32 ahk_exe %AhkExe%
- ; Development versions of AHK
- SendMessage, 0x30, NewFont, 1,, ahk_class tooltips_class32 ahk_exe AutoHotkeyA32.exe
- SendMessage, 0x30, NewFont, 1,, ahk_class tooltips_class32 ahk_exe AutoHotkeyU32.exe
- SendMessage, 0x30, NewFont, 1,, ahk_class tooltips_class32 ahk_exe AutoHotkeyU64.exe
- }
- SetFixedFont(FontSize_=-1, Options = "")
- {
- If (FontSize_ != -1) {
- FontSize_ := this.FontSizeFixed
- } Else {
- this.FontSizeFixed := FontSize_
- }
- FixedFont := this.CreateFixedFont(FontSize_, Options)
- If (FixedFont) {
- this.Set(this.FixedFont)
- this.FontSizeFixed := FixedFont
- }
- }
- SetUIFont(FontSize_=-1, Options = "")
- {
- If (FontSize_ == -1) {
- FontSize_ := this.FontSizeUI
- } Else {
- this.FontSizeUI := FontSize_
- }
- UIFont := this.CreateUIFont(FontSize_, Options)
- If (UIFont and (this.UIFont != UIFont)) {
- this.Set(this.UIFont)
- this.UIFont := UIFont
- }
- }
- GetFixedFont()
- {
- return this.FixedFont
- }
- GetUIFont()
- {
- return this.UIFont
- }
- }
- Fonts := new Fonts(9, 9)
- global ItemData := new ItemInfo()
- fileLoad()
- fileLoadsChck(){
- If (!WordList){
- MsgBox, WordList.json 파일 로딩을 실패하였습니다.
- FileRead, JSONFile, %A_ScriptDir%\data\Words.json
- parsedJSON := JSON.Load(JSONFile)
- WordList := parsedJSON
- return False
- }else If (!BaseItemTypes){
- MsgBox, BaseItemTypes.json 파일 로딩을 실패하였습니다.
- FileRead, JSONFile, %A_ScriptDir%\data\BaseItemTypes.json
- parsedJSON := JSON.Load(JSONFile)
- BaseItemTypes := parsedJSON
- return False
- }else If (!ItemClasses){
- MsgBox, ItemClasses.json 파일 로딩을 실패하였습니다.
- FileRead, JSONFile, %A_ScriptDir%\data\ItemClasses.json
- parsedJSON := JSON.Load(JSONFile)
- ItemClasses := parsedJSON
- return False
- }else If (!Prophecies){
- MsgBox, Prophecies.json 파일 로딩을 실패하였습니다.
- FileRead, JSONFile, %A_ScriptDir%\data\Prophecies.json
- parsedJSON := JSON.Load(JSONFile)
- Prophecies := parsedJSON
- return False
- }else If (!StatFiltersKr){
- MsgBox, StatFiltersKr.json 파일 로딩을 실패하였습니다.
- FileRead, JSONFile, %A_ScriptDir%\data\StatFiltersKr.json
- parsedJSON := JSON.Load(JSONFile)
- StatFiltersKr := parsedJSON
- return False
- }else If (!TypeFiltersKr){
- MsgBox, TypeFiltersKr.json 파일 로딩을 실패하였습니다.
- FileRead, JSONFile, %A_ScriptDir%\data\TypeFiltersKr.json
- parsedJSON := JSON.Load(JSONFile)
- TypeFiltersKr := parsedJSON
- return False
- }else If (!TradeFiltersKr){
- MsgBox, TradeFiltersKr.json 파일 로딩을 실패하였습니다.
- FileRead, JSONFile, %A_ScriptDir%\data\TradeFiltersKr.json
- parsedJSON := JSON.Load(JSONFile)
- TradeFiltersKr := parsedJSON
- return False
- }else If (!Mods){
- MsgBox, Mods.json 파일 로딩을 실패하였습니다.
- FileRead, JSONFile, %A_ScriptDir%\data\Mods.json
- parsedJSON := JSON.Load(JSONFile)
- Mods := parsedJSON
- return False
- }
- return True
- }
- fileLoad(){
- ; Json File 읽기
- FileRead, JSONFile, %A_ScriptDir%\data\Words.json
- parsedJSON := JSON.Load(JSONFile)
- WordList := parsedJSON
- FileRead, JSONFile, %A_ScriptDir%\data\BaseItemTypes.json
- parsedJSON := JSON.Load(JSONFile)
- BaseItemTypes := parsedJSON
- FileRead, JSONFile, %A_ScriptDir%\data\ItemClasses.json
- parsedJSON := JSON.Load(JSONFile)
- ItemClasses := parsedJSON
- FileRead, JSONFile, %A_ScriptDir%\data\Prophecies.json
- parsedJSON := JSON.Load(JSONFile)
- Prophecies := parsedJSON
- FileRead, JSONFile, %A_ScriptDir%\data\StatFiltersKr.json
- parsedJSON := JSON.Load(JSONFile)
- StatFiltersKr := parsedJSON
- FileRead, JSONFile, %A_ScriptDir%\data\TypeFiltersKr.json
- parsedJSON := JSON.Load(JSONFile)
- TypeFiltersKr := parsedJSON
- FileRead, JSONFile, %A_ScriptDir%\data\TradeFiltersKr.json
- parsedJSON := JSON.Load(JSONFile)
- TradeFiltersKr := parsedJSON
- FileRead, JSONFile, %A_ScriptDir%\data\Mods.json
- parsedJSON := JSON.Load(JSONFile)
- Mods := parsedJSON
- ; MsgBox, 로딩완료
- fileLoadsChck()
- return
- }
- IsSeperate(ClipLine){
- If (RegExMatch(ClipLine, "--------")) {
- return True
- } else {
- return False
- }
- }
- GetNameOrBase(lang){
- result := ItemData.get("Name", lang)
- If (result = ""){
- result := ItemData.get("ItemBase", lang)
- }
- return result
- }
- SetRarity(ClipLine){
- ClipLine := Trim(ClipLine)
- If (RegExMatch(ClipLine, "^희귀도: 고유")) {
- ItemData.Set("Rarity", "kr", "고유")
- ItemData.Set("Rarity", "lvl", 4)
- return ItemData.Set("Rarity", "en", "Unique")
- }Else If (RegExMatch(ClipLine, "^희귀도: 희귀")) {
- ItemData.Set("Rarity", "kr", "희귀")
- ItemData.Set("Rarity", "lvl", 3)
- return ItemData.Set("Rarity", "en", "Rare")
- }Else If (RegExMatch(ClipLine, "^희귀도: 마법")) {
- ItemData.Set("Rarity", "kr", "마법")
- ItemData.Set("Rarity", "lvl", 2)
- return ItemData.Set("Rarity", "en", "Magic")
- }Else If (RegExMatch(ClipLine, "^희귀도: 보통")) {
- ItemData.Set("Rarity", "kr", "보통")
- ItemData.Set("Rarity", "lvl", 1)
- return ItemData.Set("Rarity", "en", "Normal")
- }Else If (RegExMatch(ClipLine, "^희귀도: 점술 카드")) {
- SetClasses(ClipLine)
- ItemData.Set("Rarity", "kr", "점술 카드")
- ItemData.Set("Rarity", "lvl", 0)
- return ItemData.Set("Rarity", "en", "Divination Card")
- }Else If (RegExMatch(ClipLine, "^희귀도: 화폐")) {
- ItemData.Set("Rarity", "kr", "화폐")
- ItemData.Set("Rarity", "lvl", 0)
- return ItemData.Set("Rarity", "en", "Currency")
- }Else If (RegExMatch(ClipLine, "^희귀도: 젬")) {
- SetClasses(ClipLine)
- ItemData.Set("Rarity", "kr", "젬")
- ItemData.Set("Rarity", "lvl", 0)
- return ItemData.Set("Rarity", "en", "Gem")
- }
- return
- }
- SetClasses(StringLine){
- If( ItemData.Get("Classes", "kr") != "" ){
- return
- }
- If (RegExMatch(StringLine, ".*화석$")) {
- ItemData.Set("Classes", "kr", "화석")
- ItemData.Set("Classes", "en", "fossils")
- }Else If (RegExMatch(StringLine, ".*에센스$")) {
- ItemData.Set("Classes", "kr", "에센스")
- ItemData.Set("Classes", "en", "essences")
- }Else If (RegExMatch(StringLine, ".*카드$")) {
- ItemData.Set("Classes", "kr", "점술 카드")
- ItemData.Set("Classes", "en", "divinationcards")
- }Else If (RegExMatch(StringLine, ".*공명기$")) {
- ItemData.Set("Classes", "kr", "공명기")
- ItemData.Set("Classes", "en", "resonators")
- }Else If (RegExMatch(StringLine, ".*젬$")) {
- ItemData.Set("Classes", "kr", "젬")
- ItemData.Set("Classes", "en", "skill-gems")
- }Else If (RegExMatch(StringLine, ".*인큐베이터$")) {
- ItemData.Set("Classes", "kr", "인큐베이터")
- ItemData.Set("Classes", "en", "incubators")
- }Else If (RegExMatch(StringLine, "우클릭으로 이 예언을 캐릭터에 추가하십시오.")) {
- ItemData.Set("Classes", "kr", "예언")
- ItemData.Set("Classes", "en", "prophecies")
- ItemData.Set("ItemBase", "kr", "예언")
- ItemData.Set("ItemBase", "en", "prophecies")
- }Else If (RegExMatch(StringLine, ".*지도$")) {
- If (ItemData.Get("Rarity", "en") = "Unique"){
- ItemData.Set("Classes", "kr", "지도")
- ItemData.Set("Classes", "en", "unique-maps")
- }else{
- ItemData.Set("Classes", "kr", "지도")
- ItemData.Set("Classes", "en", "maps")
- }
- }Else {
- For idx in ItemClasses {
- If (RegExMatch(StringLine, ".*"ItemClasses[idx]["kr"]"$")) {
- ItemData.Set("Classes", "kr", ItemClasses[idx]["kr"])
- ItemData.Set("Classes", "en", ItemClasses[idx]["en"])
- If (ItemClasses[idx]["category"] != ""){
- ItemData.Set("Category", "en", ItemClasses[idx]["category"])
- }
- }
- }
- }
- return
- }
- GetClipboardName(DropNewlines=False){
- ClipText := Clipboard
- ; ClipLine := StrSplit(ClipText, "`n", "`r")
- ; idx := 1
- ; cIdx := 1
- ; ItemString := StrSplit(ClipText, "`n", "`r")
- ItemStringParts := StrSplit(ClipText, "`--------", "`r")
- PartsLen := ItemStringParts.MaxIndex()
- PartsIdx := 1
- ; isProphecies
- If (PartsLen = 4 || PartsLen = 5 && RegExMatch(ItemStringParts[4], ".*예언.*")){
- SetClasses(ItemStringParts[4])
- }
- ; Name&Base&Category
- ParseItemNamePart(ItemStringParts[PartsIdx])
- ; 희귀도
- rarity := ItemData.Get("Rarity", "en")
- ; 메타 - 타입
- metaType := ItemData.Get("Metadat", "Type")
- ; 무기스탯 파싱
- If(metaType = "Weapons"){
- ParseWeaponStats(ItemStringParts[2])
- }Else If (metaType = "Armours"){
- ParseArmourStats(ItemStringParts[2])
- }
- ; 아이템 스탯 파싱
- AffixIdx := PartsLen
- If (metaType = "Flasks"){
- AffixIdx := AffixIdx - 1
- }
- If (rarity = "Rare" || rarity = "Magic"){
- While (HasMiscellaneousMod(ItemStringParts, AffixIdx) && AffixIdx > 1) {
- continue
- }
- ParseStatFilter(ItemStringParts[AffixIdx])
- } Else If(rarity = "Unique"){
- While (HasMiscellaneousMod(ItemStringParts, AffixIdx) && AffixIdx > 1) {
- continue
- }
- AffixIdx := AffixIdx - 1
- ParseStatFilter(ItemStringParts[AffixIdx])
- }
- RareIdx := PartsLen
- ; Qulity&Armor
- ; Requirement
- ; Socket
- ; ilvl
- ; affix
- return
- }
- ParseItemNamePart(ItemStringPart){
- ClipLine := StrSplit(ItemStringPart, "`n", "`r")
- ; 희귀도
- Rarity := SetRarity(ClipLine[1])
- Classes := ItemData.Get("Classes", "en")
- If (Rarity = "Unique"){
- SetUniqueName(ClipLine[2])
- idx ++
- SetBase(ClipLine[3])
- SetClasses(ClipLine[3])
- }Else If (Rarity = "Divination Card" || Rarity = "Gem"){
- SetBase(ClipLine[2])
- }Else If ( Rarity = "Currency" ){
- SetBase(ClipLine[2])
- SetClasses(ClipLine[2])
- }Else If ( Classes = "prophecies" ){
- SetProphecyName(ClipLine[2])
- }Else If (Rarity = "Rare"){
- SetBase(ClipLine[3])
- }Else If (Rarity = "Magic"){
- SetBase(ClipLine[2])
- }Else {
- SetBase(ClipLine[2])
- SetClasses(ClipLine[2])
- }
- return
- }
- ; 쉐이퍼, 엘더, 커럽등 체크
- HasMiscellaneousMod(ItemStringParts, ByRef Idx){
- LineList := StrSplit(ItemStringParts[Idx], "`n", "`r")
- For i in LineList {
- If (RegExMatch(LineList[i], "^.*(미확인|타락|엘더 아이템|분열된 아이템|쉐이퍼 아이템|메모|패시브)")) {
- Idx := Idx - 1
- return True
- }
- }
- return False
- }
- ; 아이템 옵션 Parse
- ParseStatFilter(ItemStringPart){
- StatList := []
- Loop, Parse, ItemStringPart, `n, `r
- {
- If (StrLen(A_LoopField) = 0){
- continue
- }
- SetStatFilter(A_LoopField, StatList)
- }
- ItemData.Set("Stat", "StatList", StatList)
- return
- }
- ParseWeaponStats(ItemStringPart){
- isFirst := true
- Loop, Parse, ItemStringPart, `n, `r
- {
- If (StrLen(A_LoopField) = 0){
- continue
- }
- ; if( isFirst ){
- ; SetTypeFilter(A_LoopField, true)
- ; isFirst := false
- ; }
- ; TODO : 공격력 등 파싱
- }
- return
- }
- ParseArmourStats(ItemStringPart){
- return
- }
- SetTypeFilter(Str, isWeapon:=false){
- If (!TypeFiltersKr){
- MsgBox, TypeFiltersKr.json 파일 로딩을 실패하였습니다.
- return
- }
- For idx in TypeFiltersKr {
- Str := RegExReplace(Str, "<<.*>>", "")
- If (TypeFiltersKr[idx]["text"] = Str) {
- ItemData.Set("Filters", "type", TypeFiltersKr[idx])
- return
- }
- }
- return
- }
- SetUniqueName(ItemName){
- If (!WordList){
- MsgBox, WordList.json 파일 로딩을 실패하였습니다.
- return
- }
- For idx in WordList {
- ItemName := RegExReplace(ItemName, "<<.*>>", "")
- If (WordList[idx]["kr"] = ItemName) {
- ItemData.Set("Name", "kr", WordList[idx]["kr"])
- ItemData.Set("Name", "en", WordList[idx]["en"])
- return
- }
- }
- return
- }
- SetProphecyName(ItemName){
- If (!Prophecies){
- MsgBox, Prophecies.json 파일 로딩을 실패하였습니다.
- return
- }
- For idx in Prophecies {
- If (Prophecies[idx]["kr"] = ItemName) {
- ItemData.Set("Name", "kr", ItemName)
- ItemData.Set("Name", "en", Prophecies[idx]["en"])
- return
- }
- }
- return
- }
- SetBase(BaseName){
- If (!BaseItemTypes){
- MsgBox, BaseItemTypes.json 파일 로딩을 실패하였습니다.
- return
- }
- If ( ItemData.Get("Rarity", "en") = "Magic"){
- RemoveAffix(BaseName)
- }
- For idx in BaseItemTypes {
- BaseList := StrSplit(BaseItemTypes[idx]["Id"], "/", "`r")
- ; Metadata/Items/Armours/Shields/ShieldStrDex13
- ; BaseTypeRx := BaseItemTypes[idx]["kr"]
- ; BaseTypeRx := RegExReplace(BaseTypeRx, "\.", "\.")
- ; BaseTypeRx := "(?<=[^가-힣])" . BaseTypeRx . "(?=[^가-힣])"
- If (BaseList[3] != "MicrotransactionItemEffects" && BaseItemTypes[idx]["kr"] = BaseName) {
- ItemData.Set("ItemBase", "kr", BaseItemTypes[idx]["kr"])
- ItemData.Set("ItemBase", "en", BaseItemTypes[idx]["en"])
- ItemData.Set("ItemBase", "id", BaseItemTypes[idx]["Id"])
- ItemData.Set("Metadat", "List", BaseList)
- ItemData.Set("Metadat", "Type", BaseList[3])
- If (BaseList[3] = "Weapons") {
- ItemData.Set("Metadat", "TypeDetail", BaseList[5])
- }Else{
- ItemData.Set("Metadat", "TypeDetail", BaseList[4])
- }
- ParseFilterCategory()
- return
- }
- }
- return
- }
- RemoveAffix(ByRef Name){
- If (!Mods){
- MsgBox, Mods.json 파일 로딩을 실패하였습니다.
- return
- }
- Name := RegExReplace(Name, " - [가-힣 ]+$", "")
- For idx in Mods {
- regex := "^" . Mods[idx]["kr"] . "(\s+|)"
- Name := RegExReplace(Name, regex, "")
- }
- ; MsgBox, %Name%
- return
- }
- ParseFilterCategory(){
- Type := ItemData.Get("Metadat", "Type")
- TypeDetail := ItemData.Get("Metadat", "TypeDetail")
- If(RegExMatch("Bows", "^(" . Type . "|" . TypeDetail . ")" )){
- ItemData.Set("Filters", "type", "weapon.bow")
- }Else If(RegExMatch("Claws", "^(" . Type . "|" . TypeDetail . ")" )){
- ItemData.Set("Filters", "type", "weapon.claw")
- }Else If(RegExMatch("Daggers", "^(" . Type . "|" . TypeDetail . ")" )){
- ItemData.Set("Filters", "type", "weapon.dagger")
- }Else If(RegExMatch("OneHandAxes", "^(" . Type . "|" . TypeDetail . ")" )){
- ItemData.Set("Filters", "type", "weapon.oneaxe")
- }Else If(RegExMatch("OneHandMaces", "^(" . Type . "|" . TypeDetail . ")" )){
- ItemData.Set("Filters", "type", "weapon.onemace")
- }Else If(RegExMatch("OneHandSwords", "^(" . Type . "|" . TypeDetail . ")" )){
- ItemData.Set("Filters", "type", "weapon.onesword")
- }Else If(RegExMatch("OneHandThrustingSwords", "^(" . Type . "|" . TypeDetail . ")" )){
- ItemData.Set("Filters", "type", "weapon.onesword")
- }Else If(RegExMatch("Staves", "^(" . Type . "|" . TypeDetail . ")" )){
- ItemData.Set("Filters", "type", "weapon.staff")
- }Else If(RegExMatch("TwoHandAxes", "^(" . Type . "|" . TypeDetail . ")" )){
- ItemData.Set("Filters", "type", "weapon.twoaxe")
- }Else If(RegExMatch("TwoHandMaces", "^(" . Type . "|" . TypeDetail . ")" )){
- ItemData.Set("Filters", "type", "weapon.twomace")
- }Else If(RegExMatch("TwoHandSwords", "^(" . Type . "|" . TypeDetail . ")" )){
- ItemData.Set("Filters", "type", "weapon.twosword")
- }Else If(RegExMatch("Wands", "^(" . Type . "|" . TypeDetail . ")" )){
- ItemData.Set("Filters", "type", "weapon.wand")
- }Else If(RegExMatch("FishingRods", "^(" . Type . "|" . TypeDetail . ")" )){
- ItemData.Set("Filters", "type", "weapon.rod")
- }Else If(RegExMatch("BodyArmours", "^(" . Type . "|" . TypeDetail . ")")){
- ItemData.Set("Filters", "type", "armour.chest")
- }Else If(RegExMatch("Boots", "^(" . Type . "|" . TypeDetail . ")")){
- ItemData.Set("Filters", "type", "armour.boots")
- }Else If(RegExMatch("Gloves", "^(" . Type . "|" . TypeDetail . ")")){
- ItemData.Set("Filters", "type", "armour.gloves")
- }Else If(RegExMatch("Helmets", "^(" . Type . "|" . TypeDetail . ")")){
- ItemData.Set("Filters", "type", "armour.helmet")
- }Else If(RegExMatch("Shields", "^(" . Type . "|" . TypeDetail . ")")){
- ItemData.Set("Filters", "type", "armour.shield")
- }Else If(RegExMatch("Quivers", "^(" . Type . "|" . TypeDetail . ")")){
- ItemData.Set("Filters", "type", "armour.quiver")
- }Else If(RegExMatch("Amulets", "^(" . Type . "|" . TypeDetail . ")" )){
- ItemData.Set("Filters", "type", "accessory.amulet")
- }Else If(RegExMatch("Belts", "^(" . Type . "|" . TypeDetail . ")" )){
- ItemData.Set("Filters", "type", "accessory.belt")
- }Else If(RegExMatch("Rings", "^(" . Type . "|" . TypeDetail . ")" )){
- ItemData.Set("Filters", "type", "accessory.ring")
- }Else If(RegExMatch("Gems", "^(" . Type . "|" . TypeDetail . ")" )){
- ItemData.Set("Filters", "type", "gem")
- }Else If(RegExMatch("Jewels", "^(" . Type . "|" . TypeDetail . ")" )){
- ItemData.Set("Filters", "type", "jewel")
- ; }Else If(RegExMatch(@, "^(" . Type . "|" . TypeDetail . ")" )){
- ; ItemData.Set("Filters", "type", "jewel.abyss")
- }Else If(RegExMatch("Flasks", "^(" . Type . "|" . TypeDetail . ")" )){
- ItemData.Set("Filters", "type", "flask")
- }Else If(RegExMatch("Maps", "^(" . Type . "|" . TypeDetail . ")" )){
- ItemData.Set("Filters", "type", "map")
- }Else If(RegExMatch("Leaguestones", "^(" . Type . "|" . TypeDetail . ")" )){
- ItemData.Set("Filters", "type", "leaguestone")
- ; }Else If(RegExMatch("", "^(" . Type . "|" . TypeDetail . ")" )){
- ; ItemData.Set("Filters", "type", "prophecy")
- ; }Else If(RegExMatch(@, "^(" . Type . "|" . TypeDetail . ")" )){
- ; ItemData.Set("Filters", "type", "card")
- ; }Else If(RegExMatch(@, "^(" . Type . "|" . TypeDetail . ")" )){
- ; ItemData.Set("Filters", "type", "monster")
- ; }Else If(RegExMatch(@, "^(" . Type . "|" . TypeDetail . ")" )){
- ; ItemData.Set("Filters", "type", "currency")
- ; }Else If(RegExMatch(@, "^(" . Type . "|" . TypeDetail . ")" )){
- ; ItemData.Set("Filters", "type", "currency.piece")
- ; }Else If(RegExMatch(@, "^(" . Type . "|" . TypeDetail . ")" )){
- ; ItemData.Set("Filters", "type", "currency.resonator")
- ; }Else If(RegExMatch(@, "^(" . Type . "|" . TypeDetail . ")" )){
- ; ItemData.Set("Filters", "type", "currency.fossil")
- ; }Else If(RegExMatch(@, "^(" . Type . "|" . TypeDetail . ")" )){
- ; ItemData.Set("Filters", "type", "currency.incubator")
- ; }
- }Else{
- ItemData.Set("Filters", "type", "null")
- }
- return
- }
- SetStatFilter(Str, ByRef StatList){
- If (!StatFiltersKr){
- MsgBox, StatFiltersKr.json 파일 로딩을 실패하였습니다.
- return
- }
- StatLabel :=
- Str := RegExReplace(Str, "<<.*>>", "")
- Signs := 1
- If (RegExMatch(Str, "\([a-zA-Z]+\)", match)){
- StatType := match1
- StatLabel := GetStatTypeLabel(StatType)
- }
- If (RegExMatch(Str, "감소")){
- Str := RegExReplace(Str, "감소", "증가")
- StatLabel := GetStatTypeLabel(StatType)
- Signs := -1
- }
- StatFilter :=
- If (StatLabel){
- For idx in StatFiltersKr {
- If (StatLabel = StatFiltersKr[idx]["label"]){
- StatFilter := StatFiltersKr[idx]["entries"]
- break
- }
- }
- For idx in StatFilter {
- regex := RegExReplace(Str, "[0-9\.+]+", "#")
- regex := RegExReplace(regex, " \([a-zA-Z]+\)", "")
- regex := RegExReplace(regex, "\+#", "(\+|)#")
- regex := "^" . regex . "(\n|\s*$)"
- If (RegExMatch(StatFilter[idx]["text"], regex, mat)) {
- Stat := {}
- Stat["id"] := StatFilter[idx]["id"]
- Stat["text"] := RegExReplace(StatFilter[idx]["text"], "\n", " ")
- Stat["isChecked"] := False
- StatList.push(Stat)
- If (RegExMatch(Str, "([0-9\.+]+)~([0-9\.+]+)", match)){
- Stat["values"] := [Signs * match1 , Signs * match2]
- }Else If(RegExMatch(Str, "([0-9\.+]+)", match)){
- Stat["values"] := [Signs * match1]
- }Else {
- Stat["values"] := []
- }
- return
- }
- }
- }else{
- ; TODO : 순서
- StatLabelOrder = []
- For fdx in StatFiltersKr{
- StatFilter := StatFiltersKr[fdx]["entries"]
- For idx in StatFilter {
- regex := RegExReplace(Str, "[0-9\.+]+", "#")
- regex := RegExReplace(regex, " \([a-zA-Z]+\)", "")
- regex := RegExReplace(regex, "\+#", "(\+|)#")
- regex := "^" . regex . "(\n|\s*$)"
- If (RegExMatch(StatFilter[idx]["text"], regex, mat)) {
- Stat := {}
- Stat["id"] := StatFilter[idx]["id"]
- Stat["text"] := RegExReplace(StatFilter[idx]["text"], "\n", " ")
- Stat["isChecked"] := False
- If (RegExMatch(Str, "([0-9\.+]+)~([0-9\.+]+)", match)){
- Stat["values"] := [Signs * match1 , Signs * match2]
- }Else If(RegExMatch(Str, "([0-9\.+]+)", match)){
- Stat["values"] := [Signs * match1]
- }Else {
- Stat["values"] := []
- }
- StatList.push(Stat)
- return
- }
- }
- }
- }
- return
- }
- GetStatTypeLabel(txt){
- If (txt = "pseudo")
- return "유사"
- If (txt = "explict")
- return "무작위"
- Else If (txt = "implict")
- return "고정"
- Else If (txt = "fractured")
- return "분열된"
- Else If (txt = "enchant")
- return "인챈트"
- Else If (txt = "crafted")
- return "제작된"
- Else If (txt = "veiled")
- return "장막"
- Else If (txt = "monster")
- return "몬스터"
- Else If (txt = "delve")
- return "탐광"
- Else {
- ; return "유사"
- return
- }
- }
- WikiSearch(){
- Keyword := GetNameOrBase("en")
- If (Keyword == ""){
- return
- }
- StringReplace, Search, Keyword, %A_SPACE%, +, All
- url = http://pathofexile.gamepedia.com/index.php?search=%Search%
- Run %url%
- }
- /*
- Trade Parameter
- */
- GetSourceParam(lang){
- ; HACK : 추후에 추가로 정리할것
- ItemName := ItemData.get("Name", lang)
- ItemBase := ItemData.get("ItemBase", lang)
- ItemCategory := ItemData.get("Filters", "Category")
- p_params := {}
- p_query := {}
- p_status := {}
- p_option := "online"
- p_status["option"] := p_option
- p_query["status"] := p_status
- If (!ItemCategory["isChecked"])
- {
- If (ItemName != ""){
- p_name := ItemName
- p_query["name"] := p_name
- }
- If (ItemBase != ""){
- p_type := ItemBase
- p_query["type"] := ItemBase
- }
- }else{
- p_query["filters"] := {}
- p_query["filters"]["type_filters"] := GetTypeFilterParam()
- }
- p_query["stats"] := GetStatFilterParam()
- p_params["query"] := p_query
- p_params["sort"] := {}
- p_params["sort"]["price"] := "asc"
- jsonStr := JSON.dump(p_params)
- return jsonStr
- }
- GetFetchSource(obj){
- If (not obj){
- return
- }
- params :=
- result := obj.result
- maxIdx := result.MaxIndex()
- For idx in result{
- params .= result[idx]
- If (idx != maxIdx && idx != 10){
- params .= ","
- } Else {
- break
- }
- }
- params .= "?query="
- params .= obj.id
- return params
- }
- GetToolTipString(obj)
- {
- resultStr := ""
- If (not obj.result){
- return "검색결과가 없습니다."
- }
- resultList := obj.result
- name := GetNameOrBase("kr")
- resultStr .= "검색아이템 : " . name . "`r"
- resultStr .= "-----------------------------------------------------------------------------------------" . "`r"
- resultStr .= StrPad("계정", 20) . "|"
- resultStr .= StrPad("캐릭터명", 20) . "|"
- resultStr .= StrPad("가격", 26) . "|"
- resultStr .= StrPad("ilvl", 4) . "|"
- resultStr .= StrPad("등록", 9) . "`r"
- resultStr .= "-----------------------------------------------------------------------------------------" . "`r"
- for idx in resultList {
- result := resultList[idx]
- resultStr .= StrPad(result.listing.account.name, 20) . "|"
- resultStr .= StrPad(result.listing.account.lastCharacterName, 20) . "|"
- resultStr .= StrPad(result.listing.price.amount, 5, "left") . " "
- resultStr .= StrPad(TradeFilter2Kr(result.listing.price.currency), 20) . "|"
- resultStr .= StrPad(result.item.ilvl, 4 ) . "|"
- resultStr .= StrPad(TradeAddedDate2Kr(result.listing.indexed), 9)
- resultStr .= "`r"
- }
- return resultStr
- }
- ; Pads a string with a multiple of PadChar to become a wanted total length.
- ; Note that Side is the side that is padded not the anchored side.
- ; Meaning, if you pad right side, the text will move left. If Side was an
- ; anchor instead, the text would move right if anchored right.
- StrPad(String, Length, Side="right", PadChar=" ")
- {
- Len := StrLength(String)
- AddLen := Length-Len
- If (AddLen <= 0)
- {
- return String
- }
- Pad := StrMult(PadChar, AddLen)
- If (Side == "right")
- {
- Result := String . Pad
- }
- Else
- {
- Result := Pad . String
- }
- return Result
- }
- StrMult(Char, Times)
- {
- Result =
- Loop, %Times%
- {
- Result := Result . Char
- }
- return Result
- }
- StrLength(String)
- {
- len := StrLen(String)
- StrSize := 0
- result := ""
- i := 1
- While (i <= len) {
- char := SubStr(String, i, 1) ;
- if(RegExMatch(char, "[ㄱ-ㅎ가-힣]")){
- StrSize += 2
- }else{
- StrSize += 1
- }
- i++
- }
- return StrSize
- }
- GetTypeFilterParam(){
- params := []
- pFilters := []
- pTypeFilters := []
- filterType := ItemData.Get("Filters", "type")
- If ( filterType ){
- ;p2 := RegExReplace(p2, "s$", "")
- pInnerFilters := []
- pInnerFilters["category"] := []
- pInnerFilters["category"]["option"] := filterType
- pTypeFilters["filters"] := pInnerFilters
- pTypeFilters["disabled"] := false
- }Else {
- pTypeFilters["disabled"] := true
- }
- return pTypeFilters
- }
- GetStatFilterParam(){
- params := []
- pStats := []
- pStatsOne := {}
- pType := "and"
- pFilters := []
- statList := ItemData.get("Stat", "StatList")
- for idx in StatList{
- stat := {}
- value := {}
- If ( StatList[idx]["isChecked"] ){
- stat["id"] := StatList[idx]["id"]
- value["max"] := StatList[idx]["max"]
- value["min"] := StatList[idx]["min"]
- stat["value"] := value
- pFilters.push(stat)
- }
- }
- pStatsOne["type"] := pType
- pStatsOne["filters"] := pFilters
- pStats.push(pStatsOne)
- params["stats"] := pStats
- return pStats
- }
- TradeOptionCheck(){
- Global
- paramList := ItemData.get("Stat", "StatList")
- Itemname := GetNameOrBase("kr") . "(" . GetNameOrBase("en") . ")"
- Rarity := ItemData.get("Rarity", "en")
- IsBase := ""
- If (Rarity != "Unique"){
- IsBase := "Checked"
- }
- Gui 1:Destroy
- Gui 1:Add, Text, x48 y20 w312 h23 +0x200, %Itemname%
- Gui 1:Add, Checkbox, x447 y20 w139 h23 %IsBase% vIsCheckedBase, 베이스로 검색
- ; Name
- Gui 1:Add, Text, x48 y48 w312 h23 +0x200, 옵션
- Gui 1:Add, Text, x368 y48 w60 h23, 최소
- Gui 1:Add, Text, x447 y48 w60 h23, 현재
- Gui 1:Add, Text, x526 y48 w60 h23, 최대
- ; Split Line
- Gui 1:Add, Text, x45 y68 w532 h2 +0x10
- option_cnt := 6
- optionY := 88
- IntrvY := 33
- For idx In paramList
- {
- txt := paramList[idx]["text"]
- values := paramList[idx]["values"]
- value := 0
- for jdx in values {
- value += values[jdx]
- }
- value := Round( value / paramList[idx]["values"].MaxIndex() , 1 )
- ; value := paramList[idx]["values"][1]
- Gui 1:Add, Text, x48 y%optionY% w312 h23 +0x200, %txt%
- Gui 1:Add, Edit, x368 y%optionY% w60 h23 vMin%idx%
- Gui 1:Add, Text, x447 y%optionY% w60 h23, %value%
- Gui 1:Add, Edit, x526 y%optionY% w60 h23 vMax%idx%
- Gui 1:Add, Checkbox, x595 y%optionY% w23 h23 vIsChecked%idx% Checked
- optionY += IntrvY
- }
- optionY += 20
- Gui 1:Add, Button, x402 y%optionY% w80 h23 gGuiSearch, &Search
- Gui 1:Add, Button, x508 y%optionY% w80 h23 gGuiClose, &Cancel
- optionY += 33
- Gui 1:Show, w620 h%optionY%, Window
- Return
- }
- TradeOptionChange(){
- Global
- Gui, 1:Submit
- paramList := ItemData.get("Stat", "StatList")
- obj := []
- obj["isChecked"] := IsCheckedBase
- ItemData.Set("Filters", "Category", obj)
- For idx In paramList
- {
- paramList[idx]["isChecked"] := IsChecked%idx%
- If (IsChecked%idx%){
- paramList[idx]["min"] := Min%idx%
- paramList[idx]["max"] := Max%idx%
- }
- }
- ItemData.set("Stat", paramList)
- return
- }
- ShowToolTip(String)
- {
- ; Global X, Y, ToolTipTimeout, Opts, gdipTooltip, Item
- Global X,Y,IsActiveWindow
- SetTimer, ToolTipTimer, Off
- ; Get position of mouse cursor
- MouseGetPos, X, Y
- WinGet, PoEWindowHwnd, ID, ahk_group PoEWindowGrp
- ; RelativeToActiveWindow := true ; default tooltip behaviour
- ; IsActiveWindow := true
- ; If (not RelativeToActiveWindow) {
- ; OldCoordMode := A_CoordModeToolTip
- ; CoordMode, Tooltip, Screen
- ; }
- XCoord := (X - 135 >= 0) ? X - 135 : 0
- YCoord := (Y + 35 >= 0) ? Y + 35 : 0
- ToolTip, %String%, XCoord, YCoord
- Fonts.SetFixedFont()
- Sleep, 10
- ToolTip, %String%, XCoord, YCoord
- ; ToolTip, Timed ToolTip`nThis will be displayed for 10 seconds.
- SetTimer, ToolTipTimer, 200
- ; If (OldCoordMode) {
- ; CoordMode, Tooltip, % OldCoordMode
- ; }
- return
- }
- CreateFont(options="", font="") {
- Loop 99 {
- g = %a_index%
- Gui %g%: +LastfoundExist
- If ! WinExist()
- break
- }
- Gui, %g%: +Lastfound
- Gui, %g%: Font, %options%, %font%
- Gui, Add, Button
- SendMessage, 0x31, 0, 0, Button1 ;WM_GETFONT
- Gui, %g%: Destroy
- return errorLevel
- }
- SetFont(ctrl, win, font=0) {
- SendMessage, 0x30, %font%, 1, %ctrl%, ahk_id%win%
- return errorLevel
- }
- GetAhkExeFilename(Default_="AutoHotkey.exe")
- {
- AhkExeFilename := Default_
- If (A_AhkPath)
- {
- StringSplit, AhkPathParts, A_AhkPath, \
- Loop, % AhkPathParts0
- {
- IfInString, AhkPathParts%A_Index%, .exe
- {
- AhkExeFilename := AhkPathParts%A_Index%
- Break
- }
- }
- }
- return AhkExeFilename
- }
- TradeFilter2Kr(String = "")
- {
- If (!TradeFiltersKr){
- MsgBox, TradeFiltersKr.json 파일 로딩을 실패하였습니다.
- return
- }
- For idx in TradeFiltersKr {
- If (TradeFiltersKr[idx]["id"] = String) {
- return TradeFiltersKr[idx]["text"]
- }
- }
- return
- }
- TradeAddedDate2Kr(String = "")
- {
- InputDate := RegExReplace(String, "[T,Z,\-,:]", "")
- FormatTime,TargetTime,%InputDate%, yyyyMMddHHmmss'
- DifDate := a_nowutc
- DifDate -= %TargetTime%, s
- ; DifDate := TargetTime - InputDate ; Sec
- DifMin := DifDate // 60
- If (DifMin < 1){
- resultStr := DifDate . "초전"
- return resultStr
- }
- DifHour := DifMin // 60
- If (DifHour < 1){
- resultStr := DifMin . "분전"
- return resultStr
- }
- DifDay := DifHour // 24
- If (DifDay < 1){
- resultStr := DifHour . "시간전"
- return resultStr
- }
- DifMonth := DifDay // 30
- If (DifMonth < 1){
- resultStr := DifDay . "일전"
- return resultStr
- }
- DifYear := DifMonth // 12
- If (DifYear < 1){
- resultStr := DifDay . "달전"
- return resultStr
- }
- resultStr := DifYear . "년전"
- return resultStr
- }
- ; TODO 예언 검색
- PropheciesSearchGUI(){
- Global
- Gui, 2:Destroy
- LVArray := []
- Gui, 2:Add, Text, ,Search:
- Gui, 2:Add, Edit, w400 vSearchTerm gPrpSearch
- Gui, 2:Add, ListView, grid r20 w400 vLV gPrpListClick, 예언명|영어|ID
- Gui, 2: Default
- For idx in Prophecies {
- pName := Prophecies[idx]["kr"]
- pValue := Prophecies[idx]["en"]
- pId := Prophecies[idx]["id"]
- LV_Add("", pName, pValue, pId)
- LVArray.Push(Prophecies[idx])
- }
- LV_ModifyCol(2, 0)
- LV_ModifyCol(3, 0)
- LV_ModifyCol(1, 390)
- TotalItems := LVArray.Length()
- Gui, 2:Add, StatusBar, , % " " . TotalItems . " of " . TotalItems . " Items"
- Gui, 2:Add, Button, x122 y+20 w80 h23 gGuiPrpWikiSearch, &Wiki
- Gui, 2:Add, Button, x+10 w80 h23 gGuiPrpNinjaSearch, &Ninja
- Gui, 2:Add, Button, x+10 w80 h23 gGuiClose, &Cancel
- Gui, 2:Show, , ListView
- GuiControl, +Redraw, LV
- Return
- }
- ; -------------------------------------------------------------------------
- ; GUI Functions
- ;--------------------------------------------------------------------------
- GuiClose:
- Gui, Cancel
- return
- GuiShow:
- Gui, 2:Show
- return
- 2GuiClose:
- Gui, 2:Cancel
- return
- GuiSearch:
- TradeOptionChange()
- TradeDaumSearch()
- Gui, 1:Destroy
- return
- PrpSearch:
- GuiControlGet, SearchTerm
- GuiControl, -Redraw, LV
- LV_Delete()
- For Each, Prp In LVArray
- {
- PrpName := Prp["kr"]
- PrpValue := Prp["en"]
- PrpId := Prp["id"]
- If (SearchTerm != "")
- {
- If (InStr(PrpName, SearchTerm) = 1) ; for matching at the start
- ; If InStr(FileName, SearchTerm) ; for overall matching
- LV_Add("", PrpName, PrpValue, PrpId)
- }
- Else
- LV_Add("", PrpName, PrpValue, PrpId)
- }
- Items := LV_GetCount()
- SB_SetText(" " . Items . " of " . TotalItems . " Items")
- GuiControl, +Redraw, LV
- Return
- PrpListClick:
- if A_GuiEvent = DoubleClick
- {
- LV_GetText(RowText, A_EventInfo, 2) ; Get the text from the row's first field.
- ;;ToolTip You double-clicked row number %A_EventInfo%. Text: "%RowText%";
- ;;SetTimer, RemoveToolTip, 3000
- GuiControl, +Redraw, LV
- msgbox, "%RowText%" 가 클립보드에 카피되었습니다. ctrl + v 를 이용해 붙여넣으세요.
- Clipboard := RowText
- }
- return
- ToolTipTimer:
- ToolTipTimeout += 1
- MouseGetPos, CurrX, CurrY
- MouseMoved := (CurrX - X)**2 + (CurrY - Y)**2 > MouseMoveThreshold**2
- If (ToolTipTimeout >= 50)
- {
- ToolTipTimeout := 0
- SetTimer, ToolTipTimer, Off
- ToolTip
- }
- return
- GuiPrpWikiSearch:
- If !(SelectedRow := LV_GetNext()) {
- MsgBox, 0, %A_ThisLabel%, 리스트에서 선택 후에 눌러주세요
- Return
- }
- LV_GetText(EnName, SelectedRow, 2)
- ItemData.Set("Classes", "kr", "예언")
- ItemData.Set("Classes", "en", "prophecies")
- ItemData.Set("ItemBase", "kr", "예언")
- ItemData.Set("ItemBase", "en", "prophecies")
- ItemData.Set("Name", "en", EnName)
- WikiSearch()
- Gui, 2:Destroy
- return
- GuiPrpNinjaSearch:
- If !(SelectedRow := LV_GetNext()) {
- MsgBox, 0, %A_ThisLabel%, 리스트에서 선택 후에 눌러주세요
- Return
- }
- LV_GetText(EnName, SelectedRow, 2)
- ItemData.Set("Classes", "kr", "예언")
- ItemData.Set("Classes", "en", "prophecies")
- ItemData.Set("ItemBase", "kr", "예언")
- ItemData.Set("ItemBase", "en", "prophecies")
- ItemData.Set("Name", "en", EnName)
- TradeNinjaSearch()
- Gui, 2:Destroy
- return
- TradeDaumSearch(isWeb := true){
- If (g_league == ""){
- return
- }
- Source := GetSourceParam("kr")
- resultJson := PoETradeApiSearch("https://poe.game.daum.net/api/trade/search/" . g_league, Source)
- urlId := resultJson["id"]
- If (ItemData.isWeb){
- url = https://poe.game.daum.net/trade/search/%g_league%/%urlId%
- Run, %url%
- } Else {
- TradeToolTip("https://poe.game.daum.net/api/trade/fetch/" , resultJson)
- }
- return
- }
- ; TODO : 필요할날이 오면 그때 작업
- TradePoeHomeSearch(isWeb := true){
- If (g_league == ""){
- return
- }
- Source := GetSourceParam("en")
- resultJson := PoETradeApiSearch("https://www.pathofexile.com/api/trade/search/" . g_league, Source)
- urlId := resultJson["id"]
- url = https://www.pathofexile.com/api/trade/search/%g_league%/%urlId%
- Run, %runUrl%
- return
- }
- TradeToolTip(url, resultObj){
- params := GetFetchSource(resultObj)
- resultJson := PoETradeApiSearch(url . params)
- resultStr := GetToolTipString(resultJson)
- ShowToolTip(resultStr)
- return
- }
- ; TODO : ctrl - f 하이라이트 아이템
- HighLightItem(){
- If (!ItemData.get("Name")){
- return
- }
- }
- TradeNinjaSearch(){
- league := g_league
- If (league == ""){
- return
- }else{
- StringReplace, league, league, Legion, challenge, All
- }
- ItemName := GetNameOrBase("en")
- Rarity := ItemData.get("Rarity", "en")
- Classes := ItemData.get("Classes", "en")
- If (Classes == "" && Rarity = "Unique"){
- MetaType := ItemData.get("Metadat", "Type")
- If (MetaType = "Rings" || MetaType = "Amulets" || MetaType = "Belts"){
- MetaType := "accessories"
- }
- Stringlower MetaType, MetaType
- Classes := "unique-" . MetaType
- }
- If (Classes == "" || ItemName == ""){
- return
- }
- ; ItemName := URLEncode(ItemName)
- url = https://poe.ninja/%league%/%Classes%?name=%ItemName%
- Run %url%
- return
- }
- /*
- *********************************************************************************************
- HOTKEY
- *********************************************************************************************
- */
- LogOut(){ ; log out to character Selection
- Sleep, 50
- SendInput {Enter}/{U+0065}{U+0078}{U+0069}{U+0074}{Enter}
- return
- }
- HideOut(){ ; goto hideout
- Sleep, 50
- SendInput {Enter}/{U+0068}{U+0069}{U+0064}{U+0065}{U+006F}{U+0075}{U+0074}{Enter}
- return
- }
- Oos(){ ; oos
- Sleep, 50
- SendInput {Enter}/{U+006F}{U+006F}{U+0073}{Enter}
- return
- }
- ;UI 추가 소스
- remaining(){ ; 몬스터 확인
- Sleep, 50
- SendInput {Enter}/{U+0072}{U+0065}{U+006D}{U+0061}{U+0069}{U+006E}{U+0069}{U+006E}{U+0067}{Enter}
- return
- }
- ; 클립보드
- CopyText(){
- Clipboard := ""
- If (!fileLoadsChck()){
- MsgBox, 파일로딩이 끝나지 않았습니다.
- return False
- }
- SendInput ^c
- Sleep, 200
- If (Clipboard = ""){
- return False
- }
- ClearItemData()
- GetClipboardName()
- return True
- }
- ClearItemData(){
- ItemData := new ItemInfo()
- }
- ;UI추가소스
- Save:
- GuiControlGet, chkRunAsMinimized
- GuiControlGet, Lea
- GuiControlGet, Hot1
- GuiControlGet, Hot2
- GuiControlGet, Hot3
- GuiControlGet, Hot4
- GuiControlGet, Hot5
- GuiControlGet, Hot6
- GuiControlGet, Hot7
- GuiControlGet, Hot8
- GuiControlGet, Hot9
- GuiControlGet, Hot10
- GuiControlGet, Hot11
- GuiControlGet, Hot12
- GuiControlGet, Hot13
- if Lea = Legion
- {
- IniWrite, 1, setting.ini, KeySetting, L
- }
- else if Lea = Hardcore Legion
- {
- IniWrite, 2, setting.ini, KeySetting, L
- }
- else if Lea = Standard
- {
- IniWrite, 3, setting.ini, KeySetting, L
- }
- else if Lea = Hardcore
- {
- IniWrite, 4, setting.ini, KeySetting, L
- }
- IniWrite, %chkRunAsMinimized%, setting.ini, General, runAsMinimized
- IniWrite, %Hot1%, setting.ini, KeySetting, Key1
- IniWrite, %Hot2%, setting.ini, KeySetting, Key2
- IniWrite, %Hot3%, setting.ini, KeySetting, Key3
- IniWrite, %Hot4%, setting.ini, KeySetting, Key4
- IniWrite, %Hot5%, setting.ini, KeySetting, Key5
- IniWrite, %Hot6%, setting.ini, KeySetting, Key6
- IniWrite, %Hot7%, setting.ini, KeySetting, Key7
- IniWrite, %Hot8%, setting.ini, KeySetting, Key8
- IniWrite, %Hot9%, setting.ini, KeySetting, Key9
- IniWrite, %Hot10%, setting.ini, KeySetting, Key10
- IniWrite, %Hot11%, setting.ini, KeySetting, Key11
- IniWrite, %Hot12%, setting.ini, KeySetting, Key12
- IniWrite, %Hot13%, setting.ini, KeySetting, Key13
- return
- Apply:
- GuiControlGet, Lea
- Hotkey, %Hot1%, Hot1, Off
- Hotkey, %Hot2%, Hot2, Off
- Hotkey, %Hot3%, Hot3, Off
- Hotkey, %Hot4%, Hot4, Off
- Hotkey, %Hot5%, Hot5, Off
- Hotkey, %Hot6%, Hot6, Off
- Hotkey, %Hot7%, Hot7, Off
- Hotkey, %Hot8%, Hot8, Off
- Hotkey, %Hot9%, Hot9, Off
- Hotkey, %Hot10%, Hot10, Off
- Hotkey, %Hot11%, Hot11, Off
- Hotkey, %Hot12%, Hot12, Off
- Hotkey, %Hot13%, Hot13, Off
- if Lea = Legion
- {
- ;MsgBox, 1
- global g_League := "Legion"
- }
- else if Lea = Hardcore Legion
- {
- ;MsgBox, 2
- global g_League := "Hardcore Legion"
- }
- else if Lea = Standard
- {
- ;MsgBox, 3
- global g_League := "Standard"
- }
- else if Lea = Hardcore
- {
- ;MsgBox, 4
- global g_League := "Hardcore"
- }
- IniRead, KH1, setting.ini, KeySetting, Key1
- IniRead, KH2, setting.ini, KeySetting, Key2
- IniRead, KH3, setting.ini, KeySetting, Key3
- IniRead, KH4, setting.ini, KeySetting, Key4
- IniRead, KH5, setting.ini, KeySetting, Key5
- IniRead, KH6, setting.ini, KeySetting, Key6
- IniRead, KH7, setting.ini, KeySetting, Key7
- IniRead, KH8, setting.ini, KeySetting, Key8
- IniRead, KH9, setting.ini, KeySetting, Key9
- IniRead, KH10, setting.ini, KeySetting, Key10
- IniRead, KH11, setting.ini, KeySetting, Key11
- IniRead, KH12, setting.ini, KeySetting, Key12
- IniRead, KH13, setting.ini, KeySetting, Key13
- Hot1 = %KH1%
- Hot2 = %KH2%
- Hot3 = %KH3%
- Hot4 = %KH4%
- Hot5 = %KH5%
- Hot6 = %KH6%
- Hot7 = %KH7%
- Hot8 = %KH8%
- Hot9 = %KH9%
- Hot10 = %KH10%
- Hot11 = %KH11%
- Hot12 = %KH12%
- Hot13 = %KH13%
- Gui, 2:Submit, Nohide
- Hotkey, %Hot1%, Hot1, On
- Hotkey, %Hot2%, Hot2, On
- Hotkey, %Hot3%, Hot3, On
- Hotkey, %Hot4%, Hot4, On
- Hotkey, %Hot5%, Hot5, On
- Hotkey, %Hot6%, Hot6, On
- Hotkey, %Hot7%, Hot7, On
- Hotkey, %Hot8%, Hot8, On
- Hotkey, %Hot9%, Hot9, On
- Hotkey, %Hot10%, Hot10, On
- Hotkey, %Hot11%, Hot11, On
- Hotkey, %Hot12%, Hot12, On
- Hotkey, %Hot13%, Hot13, On
- ;GuiControlGet, Lea
- ;MsgBox, %Lea%
- ;MsgBox, %g_league%
- Return
- Start:
- {
- return
- }
- ; 단축키 항목
- ;#IfWinActive, ahk_group PoEWindowGrp
- hot1:
- {
- LogOut()
- return
- }
- hot2:
- {
- HideOut()
- return
- }
- hot3:
- {
- If (CopyText()){
- WikiSearch()
- }
- return
- }
- hot4:
- {
- If (CopyText()){
- pasteText := GetNameOrBase("en")
- Clipboard := pasteText
- }
- return
- }
- hot5:
- {
- If (CopyText()){
- ItemData.isWeb := true
- TradeDaumSearch()
- }
- return
- }
- hot6:
- {
- If (CopyText()){
- ItemData.isWeb := true
- TradeOptionCheck()
- }
- return
- }
- hot7:
- {
- If (CopyText()){
- ItemData.isWeb := false
- TradeDaumSearch()
- }
- return
- }
- hot8:
- {
- If (CopyText()){
- ItemData.isWeb := false
- TradeOptionCheck()
- }
- return
- }
- hot9:
- {
- PropheciesSearchGUI()()
- return
- }
- ; POE Ninja
- hot10:
- {
- If (CopyText()){
- TradeNinjaSearch()
- }
- return
- }
- hot11:
- {
- Oos()
- return
- }
- Hot12:
- Reload
- Hot13:
- {
- remaining()
- return
- }
- ~LButton::
- {
- MouseGetPos,,, winID
- if (winID = WinExist("ahk_class tooltips_class32"))
- {
- ToolTipTimeout := 0
- ToolTip
- }
- return
- }
- ^WheelUp::SendInput {Left} ;cntl-mouse wheel up toggles stash tabs left
- ^WheelDown::SendInput {Right} ;cntl-mouse wheel down toggles stash tabs right.
- F12::
- ExitApp
- return
- ; ; PoE 외부에서 실행
- #IfWinNotActive, ahk_group PoEWindowGrp
- F12::
- ExitApp
- return
- ; ^e::
- ; {
- ; ClipLine := StrSplit(Clipboard, "`n", "`r")
- ; SetUniqueName(ClipLine[1])
- ; pastText := ItemData.get("Name", "en")
- ; If (pastText = ""){
- ; pastText := ItemData.get("ItemBase", "en")
- ; }
- ; clipboard := pastText
- ; return
- ; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement