Code:
on *:connect:{
  checkconnected | .timercheckconnected 0 3600 checkconnected
  if ( $group(#coolmonnetwstats) == on ) { coolmonnetwstats }
  .timeripupdateboot 1 3 ipupdate | .timeripupdate 0 900 ipupdate
  .timerstartcoolmon 1 3 coolmon
}
alias ipupdate {
  write -c "C:\Program Files\CoolMon\Extensions\Coolmon External IP Result.txt" $ip
  write -n "C:\Program Files\CoolMon\Extensions\Coolmon External IP Result.txt" $asctime(HH:nn)
  inc %counter.ipupdate
  echo -ts CoolMon ip-update n° $+ %counter.ipupdate completed...
}
alias checkconnected {
  tokenize $char(:) $duration($online,3)
  if ( $1 = 1337 ) { beep 1000 | amsg mIRC has been connected4 $1 hours since $asctime($folderdate($mircdir),[yyyy ddd dd mmm][HH:nn:ss]) (automessage) }
  if ( $1 = 1234 ) { beep 100 | amsg mIRC has been connected4 $1 hours since $asctime($folderdate($mircdir),[yyyy ddd dd mmm][HH:nn:ss]) (automessage) }
  if ( $1 = 1500 ) { beep 100 | amsg mIRC has been connected4 $1 hours since $asctime($folderdate($mircdir),[yyyy ddd dd mmm][HH:nn:ss]) (automessage) }
}
#coolmonnetwstats off
alias coolmonnetwstats {
  var %cpu $left($dll(darkenginex.dll,cpuload,_),3)
  if ( !$isprocess(wscript.exe) && $isprocess(coolmon.exe) && %cpu <= 60) {
    write -cn "C:\Program Files\CoolMon\extensions\CoolMon Network Result Time.txt" $asctime(HH:nn:ss)    
    run "networkStatus v2.1.vbs"
    inc %counter.netwupdate
    inc %counter.netwupdateloop
    if ( %counter.netwupdateloop = 500 ) {
      echo -ts CoolMon Network Status-update n° $+ %counter.netwupdate completed...
      %counter.netwupdateloop = 0
    }
  }
  .timernetwstats 1 5 coolmonnetwstats
}
#coolmonnetwstats end
alias coolmonnetwstatson { .enable #coolmonnetwstats | coolmonnetwstats | echo 4 * CoolMon network stats: 3Updating... }
alias coolmonnetwstatsoff { .disable #coolmonnetwstats | .timernetwstats off | echo 4 * CoolMon network stats: 3Not updating... }
menu channel,status {
  $style($iif($isprocess(telemeter3.exe),1,0)) Use Telemeter: { $iif($isprocess(telemeter3.exe),notelemeter,tm) }
  Coolmon
  .$style($iif($isprocess(coolmon.exe),1,0)) Use Coolmon: { $iif($isprocess(coolmon.exe),nocoolmon,coolmon) }
  .$style($iif($group(#coolmonnetwstats) == on,1,0)) Update CoolMon netw stats: { $iif($group(#coolmonnetwstats) == on,coolmonnetwstatsoff,coolmonnetwstatson) }
}
alias coolmon run coolmon
alias nocoolmon kill coolmon.exe | refreshtray

alias telemeter tm
alias notelemeter kill telemeter3.exe | refreshtray
alias tm run telemeter

alias heatup run heatup
alias noheatup kill heatup.exe | refreshtray

alias refreshtray {
  var %a = $window(-1).w,%b = %a - 256
  ; ^ Screen width and same minus 256
  var %c = $window(-1).h,%d = %c - 48
  ; ^ Screen height and same minus 48
  var %x = $mouse.dx $mouse.dy
  ; Stores current position

  while %b < %a {
    : loop until cursor is at far right of screen
    while %d < %c {
      ; loop until cursor is at bottom of screen
      dll mouseevents.dll movemouse %b %d
      ; ^ moves cursor downwards in 10 pix increment (/inc line below)
      inc %d 10
    }
    %d = %c - 50
    ; Reset height var
    dll mouseevents.dll movemouse %b %d
    ; ^ moves cursor to the right in 10 pix increment (/inc line below)
    inc %b 10
  }
  dll mouseevents.dll movemouse %x
  ; Restores cursor position
}
alias isprocess {
  ; check if process exists
  ; $isprocess(<process>[,N]) - returns $true if there's an Nth process for <process>, otherwise $false.
  ; example: if ($isprocess(mirc.exe,1)) { .echo -q $endprocess(mirc.exe,1) }
  if ($isid) {
    if ($2 !isnum 1-) { tokenize 32 $$1 1 }
    var %a = a $+ $ticks, %b = b $+ $ticks, %c = c $+ $ticks, %i = 1
    .comopen %a WbemScripting.SWbemLocator
    if ($com(%a)) {
      .comclose %a $com(%a,ConnectServer,3,dispatch* %b)
      if ($com(%b)) {
        .comclose %b $com(%b,ExecQuery,3,string,SELECT Name FROM Win32_Process WHERE Name=" $+ $1",dispatch* %c)
        if ($com(%c)) { 
          if ($comval(%c,$2,Name) == $1) {
            .comclose %c
            return $true
          }
        }
      }
    }
    if ($com(%a)) { .comclose %a }
    if ($com(%b)) { .comclose %b }
    if ($com(%c)) { .comclose %c }
    return $false
  }
}
alias endprocess {
  ; kill running process
  ; $endprocess(<process>[,N]) - returns the same as $isprocess(), but also ends the Nth process for <process>.
  ; example: if ($isprocess(mirc.exe,1)) { .echo -q $endprocess(mirc.exe,1) }
  if ($isid) {
    if ($2 !isnum 1-) { tokenize 32 $$1 1 }
    var %a = a $+ $ticks, %b = b $+ $ticks, %c = c $+ $ticks, %i = 1
    .comopen %a WbemScripting.SWbemLocator
    if ($com(%a)) {
      .comclose %a $com(%a,ConnectServer,3,dispatch* %b)
      if ($com(%b)) {
        .comclose %b $com(%b,ExecQuery,3,string,SELECT Name FROM Win32_Process WHERE Name=" $+ $1",dispatch* %c)
        if ($com(%c)) {
          if ($comval(%c,$2,Name) == $1) {
            .echo -q $comval(%c,$2,Terminate)
            .comclose %c
            return $true
          }
        }
      }
    }
    if ($com(%a)) { .comclose %a }
    if ($com(%b)) { .comclose %b }
    if ($com(%c)) { .comclose %c }
    return $false
  }
}
alias kill $endprocess($1,1)

This script contains some code I got on this forum.
The problem is, when I have the coolmonnetworkstatsupdate enabled, mIRC gets very slow. This is because it has to check the $isprocess pretty much then I suppose.
Is there a better way to do this?