on *:START:{
noop $rundrop(C:\cricket\WinDrop\eggdrop.exe,neeharika.conf)
}
alias RunDrop {
if (!$isid) { echo 04 -s WinDrop: RunDrop cannot be used as a command | return }
var %r
var %f = $noqt($1)
var %f2 = $nofile($noqt($1)) $+ $2
if (!$isfile(%f)) { var %r = -1 | goto error }
if (!$isfile(%f2)) { var %r = -2 | goto error }
if ($com(RunA)) { .comclose $v1 }
if ($com(RunB)) { .comclose $v1 }
.comopen RunA WbemScripting.SWbemLocator
if ($comerr || !$com(RunA)) { %r = -3 | goto error }
.comclose RunA $com(RunA,ConnectServer,3,dispatch* RunB)
if ($comerr || !$com(RunB)) { %r = -3 | goto error }
.comclose RunB $com(RunB,ExecQuery,3,string,SELECT * FROM Win32_Process WHERE ExecutablePath = $qt($replace($1,\,\\)),dispatch* RunA)
if ($comerr || !$com(RunA)) { %r = -3 | goto error }
var %a = $iif($comval(RunA,1,ExecutablePath),1,0)
.comclose RunA
if (%a == 1) { echo 03 -s WinDrop: Your windrop is already running. }
else {
var %r = -4
write -c rundrop.bat
write rundrop.bat $gettok(%f,1,58) $+ :
write rundrop.bat cd $regsubex($gettok($nofile($1),2-,58),/(?:^\\+)|(?:\\+$)/g,)
write rundrop.bat eggdrop $nopath(%f2)
var %r = -5
run rundrop.bat
echo 12 -s WinDrop: Your windrop should be starting now.
}
return
:error
if (%r == -1) { echo 04 -s WinDrop: Unable to locate: $qt(%f) }
elseif (%r == -2) { echo 04 -s WinDrop: Unable to locate: $nopath(%f2) in $nofile(%f) $+ . }
elseif (%r == -3) { echo 04 -s WinDrop: Unable to check to see if your windrop is running. }
elseif (%r == -4) { echo 04 -s WinDrop: Unable to write rundrop.bat }
elseif (%r == -5) { echo 04 -s WinDrop: Unable to run rundrop.bat }
else { echo -s WinDrop: $error }
reseterror
}