Advertisement
davideugenepeterson

AHKPoeSalesTrader

Mar 24th, 2017
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Pause::TogglePOEItemScript()                ;pause item parsing with the pause key (other macros remain). key bind enabled by default.
  2. ;^Escape::CloseScripts()                    ;Ctrl+Esc closes all running scripts specified by (and including) ItemInfo or TradeMacro.  
  3. F1::invitePlayer()
  4. ^F1::soldOut()
  5. F2::tradeWith()
  6. F3::thankYou()
  7. ^F4::globalBad()
  8. ^F5::tradingMacro()
  9. F5::SendInput {Enter}/hideout{Enter}        ; go to hideout with F5
  10. ^WheelUp::SendInput {Left}                  ; Ctrl+mouse wheel up toggles stash tabs left
  11. ^WheelDown::SendInput {Right}               ; Ctrl+mouse wheel down toggles stash tabs right   
  12. ;^RButton::SendInput ^c                     ; Ctrl+right mouse button sends ctrl+c
  13. ;F2::^c                                     ; binds ctrl+c to F2 key (in addition, not instead)
  14. ;^F9::instructionsMacro()
  15. F10::SendInput {Enter}/global 1{Enter}  ; join a channel with F10
  16.  
  17.  
  18. invitePlayer(){
  19. send {ctrl down}{enter down}
  20. sleep 500
  21.         send {enter up}{ctrl up}
  22.         Loop, 26 {
  23.             send {left down}{left up}  
  24.         }
  25.         send {delete down}{delete up}
  26.         SendInput {Raw}/invite%A_Space% ;!!!!!Allan please add chat console as functions with parameters to make code less ugly!!!!!!
  27.         SendInput {Enter}
  28. }
  29. tradeWith(){
  30. send {ctrl down}{enter down}
  31.         sleep 500
  32.         send {enter up}{ctrl up}
  33.         Loop, 26 {
  34.             send {left down}{left up}  
  35.         }
  36.         send {delete down}{delete up}
  37.         SendInput {Raw}/tradewith%A_Space% ;!!!!!Allan please add chat console as functions with parameters to make code less ugly!!!!!!
  38.         SendInput {Enter}
  39. }
  40. thankYou(){
  41.     sleep 500
  42.     send {ctrl down}{enter down}
  43.     send {enter up}{ctrl up}           
  44.     sleep 500
  45.     Send Thank you very much!»-(¯`·.·´¯)->
  46.     SendInput {Enter}  
  47. }
  48. soldOut(){
  49.     sleep 500
  50.     send {ctrl down}{enter down}
  51.     send {enter up}{ctrl up}           
  52.     sleep 500
  53.     Send Sold Out
  54.     SendInput {Enter}  
  55. }
  56. globalBad() {      
  57.     clipboard := "globalTrading ? 'Trading in global is bad, M\'kay?' : NULL"
  58.     SendInput {Enter}
  59.     SendInput {Raw}# %clipboard%
  60.     SendInput {Enter} ;Scold those naysayers who think they can clutter up the already spam induced cesspool we call global 1.             
  61. }
  62. tradingMacro() {
  63.     global
  64.     Gui, macroTrader:Add, Edit, vcurrencyAmount, ;these couple of lines just add the interface for the window to ask user for input values
  65.     Gui, macroTrader:Add, DropDownList, vcurrencyType, Alteration|Alchemy|Chromes|Fuses|Chaos|Exalts|
  66.     Gui, macroTrader:Add, Button, default, OK  
  67.     Gui, macroTrader:Show,
  68.     return
  69.     macroTraderGuiClose:
  70.         Gui, macroTrader:Destroy ; if closed through x on interface, destroy the entire macro
  71.         Return
  72.         macroTraderButtonOK:
  73.         Gui, macroTrader:Submit,
  74.     InputBox, timeInMins, Time To Wait, How many minutes to make this person wait? ; prompt text on how long you need in minutes (like if you are in a map)  
  75.     InputBox, itemForSale, Item Input, What is ready to be purchased? ; prompt text for this is what the item they are buying
  76.     if(currencyType = "" || currencyAmount = "" || itemForSale = "" || timeInMins = "") { ;if user didn't fill out the inputs from the interface destroy interface
  77.         Gui, macroTrader:Destroy
  78.         return
  79.     }else{      
  80.         clipboard := "Please wait in my Hideout. I will be able to sell you " itemForSale " in " timeInMins " minute(s)  for " currencyAmount " " currencyType "  " ;using 4 variables the user put in, create a custom invite text for buyer. You could put in a >= check to determine if the minute(s) is plural or not but didn't get around to it.         
  81.         send {ctrl down}{enter down}
  82.         sleep 500
  83.         send {enter up}{ctrl up}
  84.         Loop, 26 {
  85.             send {left down}{left up}  
  86.         }
  87.         send {delete down}{delete up}
  88.         SendInput {Raw}/invite%A_Space% ;!!!!!Allan please add chat console as functions with parameters to make code less ugly!!!!!!
  89.         SendInput {Enter}  
  90.         send {ctrl down}{enter down} ; ctrl + enter for shortcut for last person who pm you
  91.         sleep 500
  92.         send {enter up}{ctrl up}
  93.         SendInput {Raw}%clipboard% ; send them the message we input at the start of function
  94.         send {Enter}
  95.         Loop { ; endless loop till ^f7 breaks it or ^f8 is pressed.
  96.             Sleep,10
  97.             if (GetKeystate("Control") && GetKeystate("F6") = 1) {         
  98.                 clipboard := "" itemForSale " is in my inventory. YOU start trade when ready."
  99.                 SendInput {Enter}
  100.                 sleep 500
  101.                 SendInput `% %clipboard%
  102.                 SendInput {Enter}
  103.                 continue                      
  104.             }
  105.             if (GetKeystate("Control") && GetKeystate("F7") = 1) {         
  106.                         clipboard := "Thanks for buying " itemForSale "! »-(¯`·.·´¯)->"                  
  107.                 sleep 500
  108.                 send {ctrl down}{enter down}
  109.                 send {enter up}{ctrl up}           
  110.                 sleep 500
  111.                 Send {_}{~}{"}{~}{_}{_}{_}{~}{"}{~}{_}{_}{_}{~}{"}{~}{_}{_}{_}{~}{"}{~}{_}{_}{_}{~}{"}{~}{_}{_}{_}{~}{"}{~}{_}{_}{_}{~}{"}{~}{_}{_}{_}{~}{"}{~}{_}{_} ;woohoo waves!
  112.                 send {Enter}
  113.                         sleep 500
  114.                         send {ctrl down}{enter down}
  115.                 send {enter up}{ctrl up}           
  116.                 sleep 500
  117.                 SendInput {Raw}%clipboard%
  118.                 send {Enter}
  119.                         sleep 500
  120.                         send {ctrl down}{enter down}
  121.                 send {enter up}{ctrl up}           
  122.                 sleep 500
  123.                 Send {_}{~}{"}{~}{_}{_}{_}{~}{"}{~}{_}{_}{_}{~}{"}{~}{_}{_}{_}{~}{"}{~}{_}{_}{_}{~}{"}{~}{_}{_}{_}{~}{"}{~}{_}{_}{_}{~}{"}{~}{_}{_}{_}{~}{"}{~}{_}{_} ;woohoo waves!
  124.                 send {Enter}
  125.                 send {ctrl down}{enter down}
  126.                 sleep 500
  127.                 send {enter up}{ctrl up}
  128.                 Loop, 26 {
  129.                     send {left down}{left up}  
  130.                 }
  131.                 send {delete down}{delete up}
  132.                 SendInput {Raw}/kick%A_Space%
  133.                 SendInput {Enter}
  134.                 timestamp = %A_Now%
  135.                 FormatTime Y, T, yyyy
  136.                 FormatTime D, T, YDay
  137.                 FormatTime H, T, H
  138.                 FormatTime M, T, m
  139.                 FormatTime S, T, s
  140.                 timestamp := 31536000*(Y-1970) + (D+Floor((Y-1972)/4))*86400 + H*3600 + M*60 + S ;Timestamp will be set to your windows clock and your timezone. This is not good practice it should be UTC, but it makes it easier to view locally without adding/subtracting hours.
  141.                 FileAppend, `n%timestamp%`,%timeInMins%`,%itemForSale%`,%currencyAmount%`,%currencyType%, C:\Users\Dave\Documents\poeLog.csv ;change this unless your username is also Dave on windows. Column headers are not added in this macro so you'll need to edit the file.
  142.                 Gui, macroTrader:Destroy
  143.                 return
  144.                     break                  
  145.             }
  146.             if (GetKeystate("Control") && GetKeystate("F8") = 1) { ; if multiple people pm during a trade use this or whisper them something like a . first before using ^f7. you can whisper yourself and do the trades to yourself if you really want the csv log and it becomes cumbersome.
  147.                 Gui, macroTrader:Destroy
  148.                 return
  149.                     break                
  150.             }
  151.         }
  152.     }              
  153. }
  154. instructionsMacro(){
  155.     clipboard := "I created it, my own extension trade macro. 1. download autohotkey 2. download poe-trademacro.github.io 3. replace *:\Users\*****\Documents\PoE-TradeMacro in the users folder with my macro found at pastebin.com/v28dghv9 4. run poe trade macro main file."
  156.     clipboard2 := "Instructions: DO NOT USE WHEN YOU HAVE MULTIPLE PEOPLE PM YOU!!!! ctrl+f5: starts macro and invites last person to pm you on poe. ctrl+f6 lets party know the item is in your inventory now. ctrl+f7: kicks person, thanks them and logs sale into a csv file specified in the macro. default is C:\Users\Dave\Documents\poeLog.csv change this path or remove the line from the macro. This macro will not create the file's csv column headers for you. ctrl+f8 cancels the trade and no log is made or person kicked."  
  157.     send {ctrl down}{enter down}
  158.     send {enter up}{ctrl up}           
  159.     sleep 500
  160.     SendInput {Raw}%clipboard%
  161.     send {Enter}
  162.         sleep 500
  163.         send {ctrl down}{enter down}
  164.     send {enter up}{ctrl up}           
  165.     sleep 500
  166.     SendInput {Raw}%clipboard2%
  167.     send {Enter}
  168. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement