Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #SingleInstance Force
- #Requires AutoHotKey >=v2.0 ; https://www.autohotkey.com/v2/
- ; Save this script as stacked_deck_opener.ahk on your desktop
- ; run the script, open path of exile
- ; config so hotkey only works on path of exile
- SetTitleMatchMode 2
- #HotIf Winactive("ahk_class POEWindowClass")
- ; VVVVVVVVV IMPORTANT PART
- ; hotkeys - https://www.autohotkey.com/docs/v2/Hotkeys.htm#Symbols
- >^.:: deck_opener()
- ; hover over a stacked deck, press 'Right Ctrl' and '.' (period) at the same time
- ; if you have 1,2,5,7,9 or 10 decks in a stack it doesn't matter.
- ; ^^^^^^^^^^ IMPORTANT PART
- ; functions required
- deck_opener()
- {
- WinGetPos , , &OutWidth, &OutHeight, "Path of Exile" ; get size of window
- MouseGetPos &xpos, &ypos ; get original cursor position of hovered stacked deck
- ; count_stack uses clipboard_get() function to get the stack size from the hovered item
- count_stack := StrReplace(StrReplace(clipboard_get()[5], "/", " "), "Stack Size:", "")
- count := StrSplit(count_stack, " ")[2]
- stack := StrSplit(count_stack, " ")[3]
- ; draw cards
- loop count {
- ; drop card around center of screen
- randclick := random(1.75, 2.25)
- Click "Right" ; This opens the deck
- sleep 25
- ; move to around center of screen
- MouseMove OutWidth / randclick, OutHeight / randclick, 2
- sleep 25
- Click
- sleep 25
- MouseMove xpos, ypos
- }
- }
- clipboard_get() { ; copy item info and index it
- A_Clipboard := "" ; Empty the clipboard
- this_array := [] ; initialize clipboard array
- MouseGetPos &inventItemXpos, &inventItemYpos, &WindowPID ; capture mouse cursor position
- Send "!^c" ; copy item text
- if !ClipWait(1) ; allow clipboard to load, may be slow
- {
- MsgBox "Nothing found! You must hover over an item"
- return ; bail if nothing copied
- }
- loop parse, A_Clipboard, "`n", "`r"
- {
- if (A_LoopField != "") ; if line is not blank
- {
- ; remove carriage returns, dash separators, empty lines
- LineStr := RegExReplace(RegExReplace(A_LoopField, "-{8}|`r|`n|`v|", ""), "^\h\R|^\R", "")
- this_array.Push LineStr ; push each line to array
- }
- }
- return this_array
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement