Code:
; ,--------------------------------------.
; | PoE TradeChannelAdvertisement by immo! |
; `--------------------------------------´
;
; Version: v1.5g
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Persistent ; Only the user can kill the application
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
StringCaseSense, On ; Match strings with case.
SetWorkingDir %A_ScriptDir%
CoordMode, ToolTip, Relative
CoordMode, Mouse, Screen
#MaxThreadsPerHotkey 2
; =[User config]=======================================
; Edit the following variables according to your needs!
; =====================================================
_tcaDuration = 2 ; Time in minutes between each advertisement-loop!
_tcaStart = F5 ; Hotkey to start advertising
_tcaPause = F6 ; Hotkey to pause advertising
_tcaExit = F8 ; Hotkey to exit script
_delay = 450 ; delay between each inputs (value gets automaticaly randomized)
_chans = 5 ; Number of tradechannels you want to advertise at
; ================================================================
; DO NOT EDIT BELOW THIS LINE - UNLESS YOU KNOW WHAT YOU'RE DOING!
; ================================================================
; some needed calculations
_tcaDurationMS := ((_tcaDuration * 1000) * 60)
; Internal config
_scriptName = TradeChannelAdvertisement
_scriptVer = v1.6
endchan := 667
; linking Hotkeys
Hotkey, %_tcaStart%, tcaStart
Hotkey, %_tcaPause%, tcaPause
Hotkey, %_tcaExit%, tcaExit
; poor method of "stopping" the script
^!F9::
; main Tradescript for advertising in an array of Tradechannels.
tcaStart:
TrayTip, Executing the Tradechannel advertisement! , Spamming advertisement every %_tcaDuration% minutes!`n`n%_scriptName%.%_scriptVer%, 2
Sleep, % Random(75,225)
SetTimer, tcaMain, %_tcaDurationMS%
tcaMain:
TrayTip, Executing the advertisement! , Spamming advertisement on %_chans% channels!`n`n%_scriptName%.%_scriptVer%, 2
; main loop
Loop
{
; checking if PoE is the active window and/or activating it
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
; main advertising part
if a_index > %_chans%
break
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {NumpadEnter}
Blockinput off
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {/}trade %a_index%
Blockinput off
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {NumpadEnter}
Blockinput off
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {NumpadEnter}
Blockinput off
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {UP}{UP}
Blockinput off
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {NumpadEnter}
Blockinput off
}
Blockinput off
; checking if PoE is the active window and/or activating it (one last time)
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
; joining next endchannel to not spam your advertisment twice in a vibrant channel
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {NumpadEnter}
Blockinput off
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {/}trade %endchan%
Blockinput off
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {NumpadEnter}
Blockinput off
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {NumpadEnter}
Blockinput off
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {UP}{UP}
Blockinput off
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {NumpadEnter}
Blockinput off
TrayTip, Finished advertising! , Next advertisement-loop in %_tcaDuration% minutes.`n`n%_scriptName%.%_scriptVer% > made by immo, 2
Sleep, % Random(75,225)
return
^F5::
TrayTip, Executing the Tradechannel advertisement! , Spamming advertisement every %_tcaDuration% minutes!`n`n%_scriptName%.%_scriptVer%, 2
Sleep, % Random(75,225)
TrayTip, Executing the advertisement! , Spamming advertisement on %_chans% channels!`n`n%_scriptName%.%_scriptVer%, 2
; main loop
Loop
{
; checking if PoE is the active window and/or activating it
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
; main advertising part
if a_index > %_chans%
break
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {NumpadEnter}
Blockinput off
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {/}trade %a_index%
Blockinput off
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {NumpadEnter}
Blockinput off
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {NumpadEnter}
Blockinput off
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {UP}{UP}
Blockinput off
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {NumpadEnter}
Blockinput off
}
Blockinput off
; checking if PoE is the active window and/or activating it (one last time)
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
; joining next endchannel to not spam your advertisment twice in a vibrant channel
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {NumpadEnter}
Blockinput off
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {/}trade %endchan%
Blockinput off
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {NumpadEnter}
Blockinput off
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {NumpadEnter}
Blockinput off
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {UP}{UP}
Blockinput off
Sleep, % Random((_delay - 25),(_delay + 25))
WinActivate, Path of Exile ahk_class Direct3DWindowClass
#IfWinActive Path of Exile ahk_class Direct3DWindowClass
Blockinput on
SendInput, {NumpadEnter}
Blockinput off
TrayTip, Finished advertising! , Next advertisement-loop in %_tcaDuration% minutes.`n`n%_scriptName%.%_scriptVer% > made by immo, 2
Sleep, % Random(75,225)
return
; randomization
Random(min,max) {
Random, out, %min%, %max%
return out
}
Enter::
if A_IsPaused
{
SendInput {NumpadEnter}
reload
}
else
{
SendInput {NumpadEnter}
TrayTip, manuel chatinput recognized... , resetting Script!`nPress %_tcaStart% to resume advertising... , 2
sleep 2000
reload
}
return
; Simple Pause/Unpause Function
tcaPause:
if A_IsPaused
{
Pause off
TrayTip, resuming %_scriptName%.%_scriptVer%!, `nPress %_tcaPause% to pause Script again... , 1, 2
reload
}
else
{
TrayTip, %_scriptName%.%_scriptVer% paused!, `nPress %_tcaPause% to resume script... , 1, 2
Pause On
}
return
; simple exit routine
tcaExit:
TrayTip, , >> Terminating %_scriptName%.%_scriptVer%! <<, 2
Sleep, % Random(775,2225)
exitapp
return