From cad096e52e67ca1dd36134c2d222e894416b00c1 Mon Sep 17 00:00:00 2001 From: VijayS1 Date: Thu, 21 Jan 2016 03:53:52 +0530 Subject: [PATCH 1/4] Update SteamBulkKeyActivator.ahk Updated it with some keyboard shortcuts, new positions of some buttons. New routine to find buttons on the form. Basically making it work with steam today. TO DO: Test if it now works with all test cases. I've tested with : Duplicate key: works too many attempts : works New product : Not tested yet invalid key: works --- AHK/SteamBulkKeyActivator.ahk | 98 ++++++++++++++++++++++++++++------- 1 file changed, 80 insertions(+), 18 deletions(-) diff --git a/AHK/SteamBulkKeyActivator.ahk b/AHK/SteamBulkKeyActivator.ahk index 87f15a9..25f2c8c 100644 --- a/AHK/SteamBulkKeyActivator.ahk +++ b/AHK/SteamBulkKeyActivator.ahk @@ -26,7 +26,7 @@ License: Apache License, Version 2.0 */ #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. -#Warn All, Off ; Disable warnings (error dialog boxes being shown to user) +;#Warn All, Off ; Disable warnings (error dialog boxes being shown to user) #singleinstance force ;force looping SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. @@ -47,12 +47,15 @@ steam_activate_key(key){ ;method that takes a string variable (the key) and log_to_file("`n[" . Time . "] " . "'key' =>" . " '" . key . "'",false) steam_close_all() steam_open_activation_window() - steam_move_window() - steam_click_next() - steam_click_next() - steam_activate_product_code_field() + get_button_pos() +; steam_move_window() + steam_click_next() ;or click_btn(2) +; steam_click_next() + steam_click_iagree() ;or click_btn(2) +; steam_activate_product_code_field() steam_send_input(key) - steam_click_next() + ;steam_click_next() + steam_click_iagree() ;or click_btn(2) steam_wait_until_done() if(steam_check_if_key_worked()){ applog("[sucessfull] key activated without problems !") @@ -70,13 +73,64 @@ steam_activate_key(key){ ;method that takes a string variable (the key) and ;mouse and keyboard interactions +get_button_pos() { +; button width = 465 - 374 = 91 +buttonwidth := 91 +; button height = 387 - 364 = 23 +; button x spacing = 11 +; button x offset (right) = 476 - 465 = 11 +xoffset := 11 +; button y offset (bottom) = 400 - 387 = 13 +yoffset := 13 +precision := 5 +;based on above, button locations are: +; button 1 = BACK +; right - (3*xoffset + 2*buttonwidth + precision), bottom - (yoffset + precision) +; button 2 = NEXT, I AGREE +; right - (2*xoffset + buttonwidth + precision), bottom - (yoffset + precision) +; button 3 = CANCEL, FINISH +; right - (xoffset + precision), bottom - (yoffset + precision) +; THUS +steam_activate_window() +WinGetPos, , , wnWidth, wnHeight +global ypos := wnHeight - (yoffset + precision) +global xpos3 := wnWidth - (xoffset + precision) +global xpos2 := xpos3 - (xoffset + buttonwidth) +global xpos1 := xpos2 - (xoffset + buttonwidth) +;Test moving to those co-ordinates +Loop, 3 { + MouseMove, xpos%A_Index%, ypos + ;MsgBox, , ,%xpos3% %ypos% + Sleep, 100 +} +} + +click_btn(num) { + MouseClick, left, xpos%num%, ypos +} + steam_click_next(){ ;click the next button steam_activate_window() - MouseClick, left, 320, 575 ;click next + ;MouseClick, left, 320, 575 ;click next + Send {Tab} + Sleep,100 + Send {Space} applog("> clicked next [activation]") Sleep,100 return } +steam_click_iagree(){ ;click the next button + steam_activate_window() + ;MouseClick, left, 320, 575 ;click next + Send {Tab} + Sleep,100 + Send {Tab} + Sleep,100 + Send {Space} + applog("> clicked I Agree [activation]") + Sleep,100 + return +} steam_click_cancel(){ ;click the cancel button steam_activate_window() MouseClick, left, 422, 568 ;click cancel. @@ -86,21 +140,23 @@ steam_click_cancel(){ ;click the cancel button } steam_click_back(){ ;click the back button steam_activate_window() - MouseClick, left, 212, 568 ;click back + ;MouseClick, left, 212, 568 ;click back + click_btn(1) applog("> clicked back [activation]") Sleep,100 return } steam_click_print(){ ;click the print button steam_activate_window() - MouseClick, left, 221, 407 ;click print + MouseClick, left, 225, 275 ;click print *VARIABLE* applog("> clicked print [activation]") Sleep,100 return } steam_install_click_back(){ ;install window click back steam_activate_install() - MouseClick, left, 212, 568 ;click back + ;MouseClick, left, 212, 568 ;click back + click_btn(1) applog("> clicked back [install]") Sleep,100 return @@ -108,14 +164,22 @@ steam_install_click_back(){ ;install window click back } steam_install_click_cancel(){ ;install window click cancel steam_activate_install() - MouseClick, left, 422, 568 ;click cancel. + ;MouseClick, left, 422, 568 ;click cancel. + ;click_btn(3) + ;Send, {Esc} + Send {Tab} + Sleep,100 + Send {Tab} + Sleep,100 + Send {Space} applog("> clicked cancel [install]") Sleep,100 return } steam_install_click_next(){ ;install window click next steam_activate_install() - MouseClick, left, 320, 575 ;click next + ;MouseClick, left, 320, 575 ;click next + click_btn(2) applog("> clicked next [install]") Sleep,100 return @@ -226,7 +290,7 @@ steam_check_if_key_worked(){ ;check if steam key worked }else{ applog("[duplicate product] we activated a duplicate product") log_to_file(", 'new product' => 'false'",false) - ;this means there is a print window & we closed it. + ;this means there is no print window } steam_click_next() ;we click next (past print screen) applog("now we need to check if we are on the install screen") @@ -238,7 +302,7 @@ steam_check_if_key_worked(){ ;check if steam key worked } steam_check_invalid_or_too_many_attempts(){ ;check if steam is angry at us steam_activate_window() - MouseMove, 61, 207 ;move mouse to the invalid link + MouseMove, 61, 207 ;move mouse to the invalid link *VARIABLE* applog("moved mouse to check if there is an invalid link") Sleep,100 If(A_Cursor = "Unknown"){ @@ -253,8 +317,8 @@ steam_check_if_on_install_screen(){ ;check if we are on the install screen applog("checking if we are on the install window") ;steam_activate_window() <--- does not work, because title changed steam_activate_install() - WinMove, 100, 100 ;lets move the window to the left. - applog("moved install window to 100,100") + ;WinMove, 100, 100 ;lets move the window to the left. + ;applog("moved install window to 100,100") Sleep,100 WinGetTitle, WindowTitle, StringTrimLeft,gameTitle,WindowTitle,10 @@ -336,5 +400,3 @@ applog("pressed escape!") applog(" ----- App End ------") ExitApp Return - - From eec83cb448a9e3c2e4eedfd3c252bdfb8d0e067f Mon Sep 17 00:00:00 2001 From: Vijay Date: Sun, 24 Jan 2016 18:24:32 +0530 Subject: [PATCH 2/4] Update SteamBulkKeyActivator.ahk Fixed the screenflows, and now it works flawlessly across all the use cases! --- AHK/SteamBulkKeyActivator.ahk | 74 +++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 33 deletions(-) diff --git a/AHK/SteamBulkKeyActivator.ahk b/AHK/SteamBulkKeyActivator.ahk index 25f2c8c..a5291ce 100644 --- a/AHK/SteamBulkKeyActivator.ahk +++ b/AHK/SteamBulkKeyActivator.ahk @@ -12,8 +12,6 @@ ; See the License for the specific language governing permissions and ; limitations under the License. - - ;Variables> http://ahkscript.org/docs/Variables.htm#Cursor ;Gendocs > https://github.com/fincs/GenDocs ;OutPutDebug http://www.autohotkey.com/docs/commands/OutputDebug.htm @@ -35,6 +33,19 @@ SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. ;general methods/functions +;~ ScreenFLow Notes + +;~ 1 : Activation 1 basic info: click_btn(2, "next") +;~ 2 : Activation 2 subscriber agreement: click_btn(2, "i agree") +;~ 3 : Activation 3 product key: Enter Key and click_btn(2, "next") +;~ NOW 3 options and different flows (handled in steam_check_if_key_worked()) +;~ 4a : Invalid Key or Too many attempts: click_btn(3, "cancel") ; check for link + +;~ 4b : Already Owned: click_btn(2, "next") ; fall through case +;~ 4b1 : Install : click_btn(3, "cancel") + +;~ 4c : Success : click_btn(3, "finish") ; check for print + steam_activate_key(key){ ;method that takes a string variable (the key) and places it into the key box of steam activator window if(key = ""){ ;check to make sure key is not empty applog("we got an empty key ? ignoring this one") @@ -48,9 +59,7 @@ steam_activate_key(key){ ;method that takes a string variable (the key) and steam_close_all() steam_open_activation_window() get_button_pos() -; steam_move_window() steam_click_next() ;or click_btn(2) -; steam_click_next() steam_click_iagree() ;or click_btn(2) ; steam_activate_product_code_field() steam_send_input(key) @@ -60,12 +69,9 @@ steam_activate_key(key){ ;method that takes a string variable (the key) and if(steam_check_if_key_worked()){ applog("[sucessfull] key activated without problems !") log_to_file(", 'success' => 'true'",false) - ;log_to_file(" <---- Activated",false) }else{ applog("[faillure] key failed to activate !") log_to_file(", 'success' => 'false' ",false) - ;log_to_file(" <---- Failed",false) - } applog("[end of this key]") return @@ -105,8 +111,13 @@ Loop, 3 { } } -click_btn(num) { +click_btn(num, logmsg="") { + global ypos, xpos1, xpos2, xpos3 MouseClick, left, xpos%num%, ypos + ;TrayTip, , % Clicked xpos%num% ypos ;debug message + if (logmsg != "") { + applog(logmsg) + } } steam_click_next(){ ;click the next button @@ -115,34 +126,33 @@ steam_click_next(){ ;click the next button Send {Tab} Sleep,100 Send {Space} - applog("> clicked next [activation]") + ;click_btn(2,"> clicked next [activation]") Sleep,100 return } steam_click_iagree(){ ;click the next button steam_activate_window() ;MouseClick, left, 320, 575 ;click next - Send {Tab} - Sleep,100 - Send {Tab} - Sleep,100 - Send {Space} - applog("> clicked I Agree [activation]") + ;~ Send {Tab} + ;~ Sleep,100 + ;~ Send {Tab} + ;~ Sleep,100 + ;~ Send {Space} + click_btn(2,"> clicked I Agree [activation]") Sleep,100 return } steam_click_cancel(){ ;click the cancel button steam_activate_window() - MouseClick, left, 422, 568 ;click cancel. - applog("> clicked cancel [activation]") + ;MouseClick, left, 422, 568 ;click cancel. + click_btn(2,"> clicked cancel [activation]") Sleep,100 return } steam_click_back(){ ;click the back button steam_activate_window() ;MouseClick, left, 212, 568 ;click back - click_btn(1) - applog("> clicked back [activation]") + click_btn(1,"> clicked back [activation]") Sleep,100 return } @@ -156,8 +166,7 @@ steam_click_print(){ ;click the print button steam_install_click_back(){ ;install window click back steam_activate_install() ;MouseClick, left, 212, 568 ;click back - click_btn(1) - applog("> clicked back [install]") + click_btn(1,"> clicked back [install]") Sleep,100 return @@ -179,12 +188,11 @@ steam_install_click_cancel(){ ;install window click cancel steam_install_click_next(){ ;install window click next steam_activate_install() ;MouseClick, left, 320, 575 ;click next - click_btn(2) - applog("> clicked next [install]") + click_btn(2,"> clicked next [install]") Sleep,100 return } -steam_activate_product_code_field(){ ;activate the product code field +steam_activate_product_code_field(){ ;activate the product code field, maybe not necessary? steam_activate_window() MouseClick, left, 40, 190 ;click Product code field applog("> clicked product code field") @@ -271,7 +279,7 @@ steam_close_all(){ ;this will close the activation window (it should not } steam_check_if_key_worked(){ ;check if steam key worked applog("we need to check if the key worked") - if(steam_check_invalid_or_too_many_attempts()){ + if(steam_check_invalid_or_too_many_attempts()){ ;4a applog("product code invalid or to many key tries") ;Steam is whining (to many keys tries, or product code is invalid) steam_click_cancel() @@ -283,21 +291,21 @@ steam_check_if_key_worked(){ ;check if steam key worked ;we need to press the print button & close that window again applog("checking if this is a new product") steam_click_print() - if(is_print_window()){ + if(is_print_window()){ ;4c applog("[new product] we activated a new product") log_to_file(", 'new product' => 'true'",false) ;this means there is a print window & we closed it. - }else{ + click_btn(3,"> clicked Finish [activation]") + return true + }else{ ;4b applog("[duplicate product] we activated a duplicate product") log_to_file(", 'new product' => 'false'",false) ;this means there is no print window + click_btn(2,"> clicked next [activation]") + steam_check_if_on_install_screen() + click_btn(3,"> clicked Cancel [Install]") + return true } - steam_click_next() ;we click next (past print screen) - applog("now we need to check if we are on the install screen") - ;in order to see if they key worked we need to check if we are on the install screen, if we are press cancel & report that the key worked - steam_check_if_on_install_screen() - steam_install_click_cancel() - } } steam_check_invalid_or_too_many_attempts(){ ;check if steam is angry at us From 9dfe758ce75ab9c7db5931b26ffc1d1de289b1fe Mon Sep 17 00:00:00 2001 From: Steven Vascellaro Date: Tue, 29 Aug 2017 14:16:47 -0400 Subject: [PATCH 3/4] Readme: Correctly display headings --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 16ea9f0..bb0a29b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -#Steam Bulk Key Activator +# Steam Bulk Key Activator ===================== ## Activate keys in bulk -######A little macro program that allows you to activate steam keys in bulk +###### A little macro program that allows you to activate steam keys in bulk Add a keys.txt file in the root directory of the binary/script. add 1 key per line and save the file. @@ -12,16 +12,16 @@ After a successful activation it will cancel the game's installation so it does Do not touch keyboard and or mouse you can press escape at any time to cancel the macro -##Download +## Download ![Release](https://raw.githubusercontent.com/colingg/SteamBulkKeyActivator/master/Recources/web/Releases.png) [You can download the latest release over here](https://github.com/colingg/SteamBulkKeyActivator/releases) -##Demo +## Demo ![Demo](https://raw.githubusercontent.com/colingg/SteamBulkKeyActivator/master/Recources/web/demo.gif) -##VAC anti-cheat concerns +## VAC anti-cheat concerns This is a script that uses Autohotkey to emulate keyboard and mouse, no reasons to be concerned about VAC. ;) This script is written in AutoHotKey @@ -30,7 +30,7 @@ http://ahkscript.org/ This is a script that automates the repetitive task of activating steam keys. as this does not inject anything whatsoever you don't have to worry about VAC. -##License +## License Copyright 2014 colingg (colin.gg) Licensed under the Apache License, Version 2.0 (the "License"); From c130e82316e078fad11cfcb923058b92e7543f25 Mon Sep 17 00:00:00 2001 From: Colin <7887972+cln-io@users.noreply.github.com> Date: Wed, 23 Mar 2022 11:46:00 +0100 Subject: [PATCH 4/4] Archive --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index bb0a29b..1a1cedc 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ +# Archived +I'm no longer maintaining this repo, check out its forks, or https://store.steampowered.com/account/registerkey + + + # Steam Bulk Key Activator =====================