概要
AutoHotkey (alt-ime-ahk) を起動したまま League of Legends をプレイすると、不正スクリプト扱いとなるようで、約10分経過後に強制切断されます。
また、切断後はPCを再起動してもそのマッチには復帰できなくなります。
この犯罪を複数回犯し、LeaverBuster1 ペナルティ を受けたので、反省と謝罪を兼ねて常駐スクリプトを作成しました。
本体
$autoHotkeyProcessName = "alt-ime-ahk"
の部分は使っている AutoHotkey ソフトのプロセス名に変更してください。
保存の際のエンコードはBOM付きUTF-8でお願いします。
$interval = 30 # 秒
$autoHotkeyProcessName = "alt-ime-ahk" # 適宜変更
$leagueClientProcessName = "LeagueClient"
while ($True) {
$autoHotkeyProcess = Get-Process -Name $autoHotkeyProcessName -ErrorAction SilentlyContinue
$leagueClientProcess = Get-Process -Name $leagueClientProcessName -ErrorAction SilentlyContinue
if($autoHotkeyProcess -And $leagueClientProcess){
# 停止処理
Stop-Process -Name $autoHotkeyProcessName
# 通知表示
$headlineText = 'AutoHotkey Killer'
$bodyText = 'LeagueClientの起動を確認したため、AutoHotkeyを終了しました。'
$ToastText02 = [Windows.UI.Notifications.ToastTemplateType, Windows.UI.Notifications, ContentType = WindowsRuntime]::ToastText02
$TemplateContent = [Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime]::GetTemplateContent($ToastText02)
$TemplateContent.SelectSingleNode('//text[@id="1"]').InnerText = $headlineText
$TemplateContent.SelectSingleNode('//text[@id="2"]').InnerText = $bodyText
$AppId = '{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\WindowsPowerShell\v1.0\powershell.exe'
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier($AppId).Show($TemplateContent)
}
Start-Sleep $interval
}
確認
右クリック > PowerShell で実行
で起動します。
LeagueClient
と AutoHotkey
を同時起動している状態で、AutoHotkey
の終了が確認できたら、動作確認は完了です。
スタートアップ化
ショートカットを作成して、プロパティ>リンク先をpowershell -WindowStyle Hidden -command <上記スクリプトのファイル>
になるように変更します。
Win+R
からshell:startup
を入力してOK、作成したショートカットを開いたディレクトリに移動してください。
参考記事
-
LoLの切断行為への処罰のこと。切断を繰り返すとゲームのマッチング時間が制限される。 ↩