se7enek

asdf

Jul 5th, 2020
2,019
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. ;#Warn  ; Enable warnings to assist with detecting common errors.
  3. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
  4. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  5. SetControlDelay, 5
  6. CoordMode, Mouse, Screen
  7. CoordMode, Pixel, Screen
  8. SetMouseDelay, 5
  9. #SingleInstance Force
  10. #InstallMouseHook
  11. SetBatchLines, -1
  12.  
  13. plik = ustawienia.ini
  14.  
  15. defRestart = F11
  16. defSloty = 2
  17.  
  18. ifExist, %plik%
  19. {
  20.     IniRead, Sloty, %plik%, Ustawienia, Sloty
  21.     IniRead, Restart,%plik%, Ustawienia, Restart
  22.    
  23.     defRestart := Restart
  24.     defSloty := Sloty
  25. }
  26.  
  27. GroupAdd, POEGame, ahk_exe PathOfExile.exe
  28. GroupAdd, POEGame, ahk_exe PathOfExile_x64.exe
  29. GroupAdd, POEGame, ahk_exe PathOfExileSteam.exe
  30. GroupAdd, POEGame, ahk_exe PathOfExile_x64Steam.exe
  31.  
  32.  
  33. Gui, ToStash: +E0x20 -Caption +AlwaysOnTop +LastFound +ToolWindow
  34. Gui, FromStash: +E0x20 -Caption +AlwaysOnTop +LastFound +ToolWindow
  35. Gui, ToTrade: +E0x20 -Caption +AlwaysOnTop +LastFound +ToolWindow
  36. Gui, ToStash: Add, Picture, x0 y0 +BackgroundTrans vToStash gButtonToStash, ToStash.png
  37. Gui, FromStash: Add, Picture, x0 y0 +BackgroundTrans vFromStash gButtonFromStash, FromStash.png
  38. Gui, ToTrade: Add, Picture, x0 y0 +BackgroundTrans vToTrade gButtonToTrade, ToTrade.png
  39.  
  40.  
  41. ;;Logo = %A_ScriptDir%\logo.png
  42. Gui, Settings: +E0x20 -Caption +AlwaysOnTop +LastFound +ToolWindow
  43. Gui, Settings: Color, A0A0A0
  44.  
  45. ;;Gui, Settings: Add, Picture, x0 y0 gUImove, %Logo%
  46. Gui, Settings: font, s30 c2690ad, Microsoft Sans Serif
  47. Gui, Settings: Add, Text, x0 y0 w180 h40 gUImove, 7PoETool
  48.  
  49. Gui, Settings: font, s10 cF0F0F0, Verdana
  50. Gui, Settings: Add, GroupBox, x10 y55 w165 h160, Ustawienia
  51. Gui, Settings: font
  52. Gui, Settings: Add, text, x20 y80, Ilosc Slotów do pominięcia
  53. Gui, Settings: Add, text, x50 y92, (od prawej w pionie)
  54.  
  55.  
  56. Gui, Settings: Add, Edit, x60 y120 w65 h20 Number
  57. Gui, Settings: Add, UpDown, vSlots x82 y148 Range0-60,%defSloty%
  58.  
  59. Gui, Settings: Add, text, x20 y154 , Skrót do restartu programu
  60. Gui, Settings: Add, Hotkey, vRestart w128 x26 y175, %defRestart%
  61.  
  62. Gui, Settings: Add, Button, x22 y224 w140 h22 default gZapiszUstawienia, Zapisz i Uruchom
  63.  
  64.  
  65. IfNotExist, %plik%
  66. {
  67.     Gui, Settings: Show
  68.     gui_hwnd := WinExist()
  69.     WinWait, AHK_ID %gui_hwnd%
  70.     WinWaitClose, AHK_ID %gui_hwnd%
  71. }
  72.  
  73. Sleep, 15
  74.  
  75. Menu, Tray, NoStandard
  76. Menu, Tray, Icon, icon.ico
  77. Menu, Tray, Add, Otworz Ustawienia, Settings
  78. Menu, Tray, Default, Otworz Ustawienia
  79. Menu, Tray, Add
  80. Menu, Tray, Add, Restartuj Skrypt (%Restart%), BReload
  81. Menu, Tray, Add, Wyjdz (F12), BExit
  82. Menu, Tray, Click, 1
  83. Menu, Tray, Tip, Kliknij aby wejsc w ustawienia
  84.  
  85. Hotkey,%Restart%,Restart
  86.  
  87. MaxC = % Ceil((60 - Sloty)/5)  ;;12
  88. MaxR = % Mod(60 - Sloty, 5) ;; 3
  89.  
  90. if ( MaxR == 0)
  91.     MaxC = % MaxC + 1
  92.    
  93. ;;336,31
  94. ;;0x9BDAEE
  95. ;;Stash
  96.  
  97. ;;1590,28
  98. ;;0xBFE4EF
  99. ;;Character
  100.  
  101. ;;460,895
  102. ;;0x627580
  103. ;;Search Unchecked
  104.  
  105. ;;634,89
  106. ;;0x72BCE2
  107. ;;Trade Window
  108.  
  109. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  110. ;;;;;;;;;; TODO:  
  111. ;; =
  112. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  113.  
  114.  
  115. Free := 1
  116.  
  117. Loop {
  118.     PixelGetColor, Stash, 336, 31
  119.     PixelGetColor, Character, 1590, 28
  120.     PixelGetColor, Search, 460, 895
  121.     PixelGetColor, Trade, 634, 89
  122.  
  123.     If (Character == 0xB4E3EF && Stash == 0xABE9F5 && Free == 1 && WinActive("ahk_group POEGame")) ;;Stash + Character wymagany
  124.     {
  125.         If (Search != 0x627580)
  126.             Gui, FromStash: Show, w123 h35 x400 y825 NoActivate
  127.         else
  128.             Gui, FromStash: Hide
  129.  
  130.         Gui, ToStash: Show, w123 h35 x530 y825 NoActivate
  131.     }
  132.     else If(Character == 0xB4E3EF && Trade == 0x72BCE2 && Free == 1 && WinActive("ahk_group POEGame")) ;;character + trade wymagany
  133.     {
  134.         Gui, ToStash: Hide
  135.         Gui, FromStash: Hide
  136.         Gui, ToTrade: Show, w123 h35 x555 y818 NoActivate
  137.     }
  138.     else
  139.     {
  140.         Gui, ToStash: Hide
  141.         Gui, FromStash: Hide
  142.         Gui, ToTrade: Hide
  143.     }
  144.     Sleep, 50
  145. }
  146.  
  147.  
  148. ButtonToStash:
  149.    GroupActivate, POEGame
  150.     WinWaitActive, ahk_group POEGame, ,5
  151.     Free := 0
  152.     StartX := 1300 ;; +52
  153.     StartY := 615 ;; +52
  154.     Row := 1
  155.     Column := 1
  156.     BlockInput, MouseMove
  157.     Sleep, 5
  158.     Puste := 0
  159.     MouseMove, StartX, StartY
  160.     Sleep, 15
  161.     Send {Control Down}
  162.     Sleep, 15
  163.     While (Column != MaxC or Row <= MaxR) {
  164.         Clipboard = Uzywam najlepszego PoE Tool'a se7en'a
  165.         MouseMove, (StartX + (Column-1)*52), (StartY + (Row-1)*52)
  166.         Sleep, 15
  167.         Send {C}{Click} ;; clip=itemek
  168.         Row := Row + 1
  169.         if (Row == 6){
  170.             Column := Column + 1
  171.             Row := 1
  172.         }
  173.         Sleep, 15
  174.         If (Clipboard == "Uzywam najlepszego PoE Tool'a se7en'a")
  175.             Puste := Puste + 1
  176.         Else
  177.             Puste = 0
  178.         If (Puste > 9)
  179.             break
  180.     }
  181.     Send {Control Up}
  182.     Free := 1
  183.     BlockInput, MouseMoveOff
  184. Return
  185.  
  186.  
  187.  
  188. ButtonFromStash:
  189.    GroupActivate, POEGame
  190.     WinWaitActive, ahk_group POEGame, ,5
  191.     LastPx = 0
  192.     LastPy = 0
  193.     Sleep, 5
  194.     PixelSearch, Px, Py, 15, 160, 650, 800, 0xE7B477, 3, Fast RGB
  195.     Sleep, 5
  196.     If (!ErrorLevel)
  197.     {
  198.         BlockInput, MouseMove
  199.         Free := 0
  200.         Gui, FromStash: Hide
  201.         Send {Ctrl Down}
  202.     }
  203.     While((!ErrorLevel) and ((LastPx != Px) or (LastPy != Py)))
  204.     {
  205.         LastPx := Px
  206.         LastPy := Py
  207.         MouseMove, Px+5, Py+5
  208.         Sleep, 50
  209.         ;;MouseClick, Left, Px+5, Py+5
  210.         Send {Click}
  211.         Sleep, 150
  212.         PixelSearch, Px, Py, 15, 160, 650, 800, 0xE7B477, 3, Fast RGB
  213.         Sleep, 50
  214.         ;;ToolTip, %Px%/%Py%`r`n%LastPx%/%LastPy%
  215.        
  216.     }
  217.     Send {Ctrl Up}
  218.     Free := 1
  219.     BlockInput, MouseMoveOff
  220. Return
  221.  
  222.  
  223. ButtonToTrade:
  224.    GroupActivate, POEGame
  225.     WinWaitActive, ahk_group POEGame, ,5
  226.     Free := 0
  227.     StartX := 1300 ;; +52
  228.     StartY := 615 ;; +52
  229.     Row := 1
  230.     Column := 1
  231.     BlockInput, MouseMove
  232.     Sleep, 5
  233.     MouseMove, StartX, StartY
  234.     Sleep, 15
  235.     Clipboard := ""
  236.     Test = Uzywam najlepszego PoE Tool'a se7en'a
  237.     Sleep, 5
  238.     Send {Control Down}{C}
  239.     Sleep, 15
  240.     While (Clipboard != Test) {
  241.         Clipboard = %Test%
  242.         Sleep, 15
  243.         MouseMove, (StartX + (Column-1)*52), (StartY + (Row-1)*52)
  244.         Sleep, 15
  245.         Send {C}{Click}
  246.         Row := Row + 1
  247.         if (Row == 6){
  248.             Column := Column + 1
  249.             Row := 1
  250.         }
  251.         Sleep, 25
  252.     }
  253.     Send {Control Up}
  254.     Free := 1
  255.     BlockInput, MouseMoveOff
  256. Return
  257.  
  258.  
  259. Settings:
  260.     Gui, Settings: Show, x880 y350 h255 w180, 7PoETool
  261. Return
  262.  
  263. UImove:
  264.    PostMessage, 0xA1,2,,,A
  265. Return
  266.  
  267. ZapiszUstawienia:
  268.    Gui, Settings: Submit
  269.     IniWrite, %Slots%, %plik%, Ustawienia, Sloty
  270.     IniWrite, %Restart%, %plik%, Ustawienia, Restart
  271.     Reload
  272. Return
  273.  
  274.  
  275. Restart:
  276. BReload:
  277.    Send {Ctrl Up}
  278.     Send {Click Up}
  279. Reload
  280.  
  281. F10::
  282.     PixelGetColor, XStash, 336, 31
  283.     PixelGetColor, XCharacter, 1590, 28
  284.     PixelGetColor, XSearch, 460, 895
  285.     PixelGetColor, XTrade, 634, 89
  286. MsgBox, %XCharacter%`r`n%XTrade%`r`n%XSearch%`r`n%XStash%
  287. Return
  288.  
  289. F12::
  290. BExit:
  291.    ExitApp
Advertisement
Add Comment
Please, Sign In to add comment