on *:start: .timerautogame 0 30 autogame
alias autogame {
if ($chkprocess(CSGO.exe)) && ($chkprocess(Dayz.exe)) halt
if ($chkprocess(CSGO.exe)) && (%autogame != csgo) {
set %autogame csgo
msg #pball !updatetitle CSGO Comp w/ oBeE
.timer 1 5 msg #pball !updategame Counter-Strike: Global Offensive
}
elseif ($chkprocess(Dayz.exe)) && (%autogame != dayz) {
set %autogame dayz
msg #pball !updatetitle #Dayz PVP Elektro
.timer 1 5 msg #pball !updategame DayZ
}
else set %autogame none
}
alias chkprocess {
.comopen numMirc1 WbemScripting.SWbemLocator
if ($com(numMirc1)) .comclose numMirc1 $com(numMirc1,ConnectServer,3,dispatch* numMirc2)
if ($com(numMirc2)) .comclose numMirc2 $com(numMirc2,ExecQuery,3,bstr,SELECT Name FROM Win32_Process WHERE Name = $qt($1-),dispatch* numMirc3)
if ($com(numMirc3)) {
var %total $comval(numMirc3,0)
.comclose numMirc3
return %total
}
:error
if ($com(numMirc1)) .comclose numMirc1
if ($com(numMirc2)) .comclose numMirc2
if ($com(numMirc3)) .comclose numMirc3
return -1
}