Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ;#Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- SetControlDelay, 5
- CoordMode, Mouse, Screen
- CoordMode, Pixel, Screen
- SetMouseDelay, 5
- #SingleInstance Force
- #InstallMouseHook
- SetBatchLines, -1
- plik = ustawienia.ini
- defRestart = F11
- defSloty = 2
- ifExist, %plik%
- {
- IniRead, Sloty, %plik%, Ustawienia, Sloty
- IniRead, Restart,%plik%, Ustawienia, Restart
- defRestart := Restart
- defSloty := Sloty
- }
- GroupAdd, POEGame, ahk_exe PathOfExile.exe
- GroupAdd, POEGame, ahk_exe PathOfExile_x64.exe
- GroupAdd, POEGame, ahk_exe PathOfExileSteam.exe
- GroupAdd, POEGame, ahk_exe PathOfExile_x64Steam.exe
- Gui, ToStash: +E0x20 -Caption +AlwaysOnTop +LastFound +ToolWindow
- Gui, FromStash: +E0x20 -Caption +AlwaysOnTop +LastFound +ToolWindow
- Gui, ToTrade: +E0x20 -Caption +AlwaysOnTop +LastFound +ToolWindow
- Gui, ToStash: Add, Picture, x0 y0 +BackgroundTrans vToStash gButtonToStash, ToStash.png
- Gui, FromStash: Add, Picture, x0 y0 +BackgroundTrans vFromStash gButtonFromStash, FromStash.png
- Gui, ToTrade: Add, Picture, x0 y0 +BackgroundTrans vToTrade gButtonToTrade, ToTrade.png
- ;;Logo = %A_ScriptDir%\logo.png
- Gui, Settings: +E0x20 -Caption +AlwaysOnTop +LastFound +ToolWindow
- Gui, Settings: Color, A0A0A0
- ;;Gui, Settings: Add, Picture, x0 y0 gUImove, %Logo%
- Gui, Settings: font, s30 c2690ad, Microsoft Sans Serif
- Gui, Settings: Add, Text, x0 y0 w180 h40 gUImove, 7PoETool
- Gui, Settings: font, s10 cF0F0F0, Verdana
- Gui, Settings: Add, GroupBox, x10 y55 w165 h160, Ustawienia
- Gui, Settings: font
- Gui, Settings: Add, text, x20 y80, Ilosc Slotów do pominięcia
- Gui, Settings: Add, text, x50 y92, (od prawej w pionie)
- Gui, Settings: Add, Edit, x60 y120 w65 h20 Number
- Gui, Settings: Add, UpDown, vSlots x82 y148 Range0-60,%defSloty%
- Gui, Settings: Add, text, x20 y154 , Skrót do restartu programu
- Gui, Settings: Add, Hotkey, vRestart w128 x26 y175, %defRestart%
- Gui, Settings: Add, Button, x22 y224 w140 h22 default gZapiszUstawienia, Zapisz i Uruchom
- IfNotExist, %plik%
- {
- Gui, Settings: Show
- gui_hwnd := WinExist()
- WinWait, AHK_ID %gui_hwnd%
- WinWaitClose, AHK_ID %gui_hwnd%
- }
- Sleep, 15
- Menu, Tray, NoStandard
- Menu, Tray, Icon, icon.ico
- Menu, Tray, Add, Otworz Ustawienia, Settings
- Menu, Tray, Default, Otworz Ustawienia
- Menu, Tray, Add
- Menu, Tray, Add, Restartuj Skrypt (%Restart%), BReload
- Menu, Tray, Add, Wyjdz (F12), BExit
- Menu, Tray, Click, 1
- Menu, Tray, Tip, Kliknij aby wejsc w ustawienia
- Hotkey,%Restart%,Restart
- MaxC = % Ceil((60 - Sloty)/5) ;;12
- MaxR = % Mod(60 - Sloty, 5) ;; 3
- if ( MaxR == 0)
- MaxC = % MaxC + 1
- ;;336,31
- ;;0x9BDAEE
- ;;Stash
- ;;1590,28
- ;;0xBFE4EF
- ;;Character
- ;;460,895
- ;;0x627580
- ;;Search Unchecked
- ;;634,89
- ;;0x72BCE2
- ;;Trade Window
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;;;;;;;; TODO:
- ;; =
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- Free := 1
- Loop {
- PixelGetColor, Stash, 336, 31
- PixelGetColor, Character, 1590, 28
- PixelGetColor, Search, 460, 895
- PixelGetColor, Trade, 634, 89
- If (Character == 0xB4E3EF && Stash == 0xABE9F5 && Free == 1 && WinActive("ahk_group POEGame")) ;;Stash + Character wymagany
- {
- If (Search != 0x627580)
- Gui, FromStash: Show, w123 h35 x400 y825 NoActivate
- else
- Gui, FromStash: Hide
- Gui, ToStash: Show, w123 h35 x530 y825 NoActivate
- }
- else If(Character == 0xB4E3EF && Trade == 0x72BCE2 && Free == 1 && WinActive("ahk_group POEGame")) ;;character + trade wymagany
- {
- Gui, ToStash: Hide
- Gui, FromStash: Hide
- Gui, ToTrade: Show, w123 h35 x555 y818 NoActivate
- }
- else
- {
- Gui, ToStash: Hide
- Gui, FromStash: Hide
- Gui, ToTrade: Hide
- }
- Sleep, 50
- }
- ButtonToStash:
- GroupActivate, POEGame
- WinWaitActive, ahk_group POEGame, ,5
- Free := 0
- StartX := 1300 ;; +52
- StartY := 615 ;; +52
- Row := 1
- Column := 1
- BlockInput, MouseMove
- Sleep, 5
- Puste := 0
- MouseMove, StartX, StartY
- Sleep, 15
- Send {Control Down}
- Sleep, 15
- While (Column != MaxC or Row <= MaxR) {
- Clipboard = Uzywam najlepszego PoE Tool'a se7en'a
- MouseMove, (StartX + (Column-1)*52), (StartY + (Row-1)*52)
- Sleep, 15
- Send {C}{Click} ;; clip=itemek
- Row := Row + 1
- if (Row == 6){
- Column := Column + 1
- Row := 1
- }
- Sleep, 15
- If (Clipboard == "Uzywam najlepszego PoE Tool'a se7en'a")
- Puste := Puste + 1
- Else
- Puste = 0
- If (Puste > 9)
- break
- }
- Send {Control Up}
- Free := 1
- BlockInput, MouseMoveOff
- Return
- ButtonFromStash:
- GroupActivate, POEGame
- WinWaitActive, ahk_group POEGame, ,5
- LastPx = 0
- LastPy = 0
- Sleep, 5
- PixelSearch, Px, Py, 15, 160, 650, 800, 0xE7B477, 3, Fast RGB
- Sleep, 5
- If (!ErrorLevel)
- {
- BlockInput, MouseMove
- Free := 0
- Gui, FromStash: Hide
- Send {Ctrl Down}
- }
- While((!ErrorLevel) and ((LastPx != Px) or (LastPy != Py)))
- {
- LastPx := Px
- LastPy := Py
- MouseMove, Px+5, Py+5
- Sleep, 50
- ;;MouseClick, Left, Px+5, Py+5
- Send {Click}
- Sleep, 150
- PixelSearch, Px, Py, 15, 160, 650, 800, 0xE7B477, 3, Fast RGB
- Sleep, 50
- ;;ToolTip, %Px%/%Py%`r`n%LastPx%/%LastPy%
- }
- Send {Ctrl Up}
- Free := 1
- BlockInput, MouseMoveOff
- Return
- ButtonToTrade:
- GroupActivate, POEGame
- WinWaitActive, ahk_group POEGame, ,5
- Free := 0
- StartX := 1300 ;; +52
- StartY := 615 ;; +52
- Row := 1
- Column := 1
- BlockInput, MouseMove
- Sleep, 5
- MouseMove, StartX, StartY
- Sleep, 15
- Clipboard := ""
- Test = Uzywam najlepszego PoE Tool'a se7en'a
- Sleep, 5
- Send {Control Down}{C}
- Sleep, 15
- While (Clipboard != Test) {
- Clipboard = %Test%
- Sleep, 15
- MouseMove, (StartX + (Column-1)*52), (StartY + (Row-1)*52)
- Sleep, 15
- Send {C}{Click}
- Row := Row + 1
- if (Row == 6){
- Column := Column + 1
- Row := 1
- }
- Sleep, 25
- }
- Send {Control Up}
- Free := 1
- BlockInput, MouseMoveOff
- Return
- Settings:
- Gui, Settings: Show, x880 y350 h255 w180, 7PoETool
- Return
- UImove:
- PostMessage, 0xA1,2,,,A
- Return
- ZapiszUstawienia:
- Gui, Settings: Submit
- IniWrite, %Slots%, %plik%, Ustawienia, Sloty
- IniWrite, %Restart%, %plik%, Ustawienia, Restart
- Reload
- Return
- Restart:
- BReload:
- Send {Ctrl Up}
- Send {Click Up}
- Reload
- F10::
- PixelGetColor, XStash, 336, 31
- PixelGetColor, XCharacter, 1590, 28
- PixelGetColor, XSearch, 460, 895
- PixelGetColor, XTrade, 634, 89
- MsgBox, %XCharacter%`r`n%XTrade%`r`n%XSearch%`r`n%XStash%
- Return
- F12::
- BExit:
- ExitApp
Advertisement
Add Comment
Please, Sign In to add comment