This is the first ahk script i wrote. I used the LoL Tools from the old Forum but it doesn't work any more. So i started figguring out how this works and wrote my own litte script. It is only to start and login to LoL for multiple accounts. For this first version i do not have things like window size detection a.s.o. so the relative Window coordinates for the clicks have to adjusted by yourself. I plan all that for my next version when i'm more into all that. The Anti AFK feature i wrote works but i do not want to release it jet. I don't want all users use the same way to anti afk abbout cheat delection so i plan to do this with much randomness way i can.
This script is NOT ready to use without changing something by yourself. For Example: Coordinates for the clicks, ammount of used LoL accounts a.s.o.
But i have a huge TODO list for feature versions. Please tell me if you see serious bugs or problems in my script, i'm open for any critics or tips to improve it.
And sorry for my bad english
Code: Select all
; LoL Login Script
; v1.0 beta
; by [email protected]
; (User Richard_Long in ahkscript.org forum)
;;; LoL Account Data ;;;
UsernameA = example_username1
PasswordA = example_password1
SummonerA = example_summonername1
UsernameB =
PasswordB =
SummonerB = Name2
UsernameC =
PasswordC =
SummonerC = Name3
UsernameD =
PasswordD =
SummonerD = Name4
; Sorry you have to delete a fiew lines below if you don't use that much accounts
;;; Game Data ;;;
RiotPath = C:\Riot Games\league of legends\lol.launcher.exe
InstallLocation = C:\Riot Games\league of legends\
;;; Misc settings ;;;
global AntiAfkEnabled := false ;This feature is not implemented jet. I work on this in a future version.
MenuUseSummonerNames := true ;Show Summoners Name instead of Username in the Tray Menu.
DefaultAccount = C ;Default Account to log in on Tray Icon double click. Leave it empty to disable it.
;;; Init ;;;
#NoEnv
#Persistent
#SingleInstance, force
SetBatchLines, 20ms
SendMode, Input
CoordMode,Mouse,Window
CoordMode,Pixel,Window
SetWorkingDir, %A_ScriptDir%
OnExit, EXIT
if not A_IsAdmin
Run *RunAs "%A_ScriptFullPath%"
if MenuUseSummonerNames
{
AccountDescA = %SummonerA%
AccountDescB = %SummonerB%
AccountDescC = %SummonerC%
AccountDescD = %SummonerD%
}
else
{
AccountDescA = %UsernameA%
AccountDescB = %UsernameB%
AccountDescC = %UsernameC%
AccountDescD = %UsernameD%
}
;Tray Menu
Menu, Tray, Icon, %RiotPath%, 1
Menu, Tray, Tip, LoL_Login v1.0
Menu, Tray, NoStandard
; TODO: create next lines with a loop and skip empty accounts...
; TODO: Use only one Handler function for all accounts
Menu, Tray, Add, Login to LoL (%AccountDescA%), STARTA
Menu, Tray, Add, Login to LoL (%AccountDescB%), STARTB
Menu, Tray, Add, Login to LoL (%AccountDescC%), STARTC
Menu, Tray, Add, Login to LoL (%AccountDescD%), STARTD
Menu, Tray, Add
Menu, Tray, Add, Anti-AFK, AfkTool
Menu, Tray, Add
Menu, Tray, Add, Reload This Script, RELOAD
Menu, Tray, Add, Exit Script, EXIT
If DefaultAccount
{
DefaultAccountname := AccountDesc%DefaultAccount%
menu, Tray, Default, Login to LoL (%DefaultAccountname%)
}
else
{
menu, Tray, NoDefault
}
If AntiAfkEnabled
{
Menu, Tray, Check, Anti-AFK
enableAFK()
}
return
AfkTool:
CheckAFKToggle( A_ThisMenuItem, A_ThisMenu )
return
CheckAFKToggle(MenuItem, MenuName){
AntiAfkEnabled := !AntiAfkEnabled
If (AntiAfkEnabled)
{
Menu, %MenuName%, Check, %MenuItem%
enableAFK()
}
else
{
Menu, %MenuName%, UnCheck, %MenuItem%
}
}
enableAFK()
{
Loop
{
if not AntiAfkEnabled
break
MsgBox, The Anti Afk Feature is not implemented in this version.
}
}
F8::
CheckAFKToggle("Anti-AFK", "Tray")
return
RELOAD:
Reload
return
STARTA:
Login(UsernameA,PasswordA,InstallLocation)
return
STARTB:
Login(UsernameB,PasswordB,InstallLocation)
return
STARTC:
Login(UsernameC,PasswordC,InstallLocation)
return
STARTD:
Login(UsernameD,PasswordD,InstallLocation)
return
EXIT:
ExitApp
Return
Login(username, password, installloc)
{
; Credits for this function to LoL Tools in http://www.autohotkey.com/board/topic/114985-league-of-legends-tools/
global
; I commented out something because i experienced, the Launcher is killed by LoL itself when killing the Client.
;===Kills League of Legends=====================================================================
IfWinExist, ahk_class ApolloRuntimeContentWindow
{ ;Runwait, taskkill /f /im LoLLauncher.exe,, Hide
;sleep, 250
Runwait, taskkill /f /im LolClient.exe,, Hide
sleep, 250
} else IfWinExist, ahk_class RADSWindowClass
{ ;Runwait, taskkill /f /im LoLLauncher.exe,, Hide
;sleep, 250
Runwait, taskkill /f /im LolClient.exe,, Hide
sleep, 250
} else IfWinExist, ahk_class LOLPATCHER
{ Runwait, taskkill /f /im LoLPatcher.exe,, Hide
sleep, 250
;Runwait, taskkill /f /im LolClient.exe,, Hide
;sleep, 250
}
;===Runs League of Legends======================================================================
Run, lol.launcher.exe,%installloc%
sleep, 5000
;===Clicks Play=================================================================================
WinWaitActive ahk_class LOLPATCHER
WinGetPos,,, w, h, A
Sleep 2000
WinActivate ahk_class LOLPATCHER
;MouseMove, 500, 30
MouseClick, left, 500, 30,,0 ; Change the position here if not working.
Goto, Login
Login:
WinWaitActive ahk_class ApolloRuntimeContentWindow
WinGetPos,,, w, h, A
WinActivate ahk_class ApolloRuntimeContentWindow
sleep, 3000
MouseClick, left, 120, 320,,0 ; Change the position here if not working.
sleep, 1000
SetKeyDelay, 5, 5
Sleep, 1000
Send, %username%
WinWaitActive ahk_class ApolloRuntimeContentWindow
WinGetPos,,, w, h, A
Sleep, 1000
MouseClick, left, 120, 380,,0 ; Change the position here if not working.
Sleep, 1000
SetKeyDelay, 5, 5
Sleep, 1000
Send, %password%
Sleep, 2500
WinGetPos,,, w, h, A
MouseClick, Left, 360, 430,,0 ; Change the position here if not working.
return
}
- GUI to add/edit/delete LoL accounts and LoL location choosing.
- Update/EULA detection.
- Randomized anti afk movement.
- Code simplification and improvements.
- Change to AutoHotkey_L
- Trigger my cygwin bash script to backup/restore created Item lists...
If you think this isn't good enaugh to release here, please tell me and i'll delete it.