; IRC-CPU-mon v1.4, coded by _ack/Deelkar
; send comments and/or bug reports to ack@brownyflob.com
;
; You need Motherboard Monitor(with logging to .txt enabled) to be able to use this script. 
; Get it from http://members.brabant.chello.nl/~a.vankaam/mbm/
;
; put the following code in the REMOTES section. and edit the pathname to MBM to fit your
; setup
;
alias cputemp {
  if ($1 == e) set %flagcpu 1
  if ($1 == $null) set %flagcpu 0
  set %x $lines(e:\Programme\MotherBoard Monitor 4\MBMIlog.txt)
  :loop
  set %currentline $read -l %x "e:\Programme\MotherBoard Monitor 4\MBMIlog.txt"
  if (MHz isin %currentline) {
    tokenize 124 %currentline
    set %currenttemp1 $left($4,2)
    set %currenttemp2 $left($5,2)
    set %currenttemp3 $left($6,2)
    set %fanrpm1 $left($14,5)
    goto end
  }
  dec %x
  goto loop
  :end
  if (%flagcpu == 0) {
    if ($chan == $null) /msg $nick Athlon 600 %currenttemp2 $+ .0°C  CPUFan: %fanrpm1 RPM  Sys Temp: %currenttemp1 $+ .0°C  
    if ($chan != $null) /msg $chan Athlon 600 %currenttemp2 $+ .0°C  CPUFan: %fanrpm1 RPM  Sys Temp: %currenttemp1 $+ .0°C 
    halt
  }
  if (%flagcpu == 1) { 
    echo temp1 is %currenttemp1 $+ °C
    echo temp2 is %currenttemp2 $+ °C
    ;    echo temp3 is %currenttemp3 $+ °C
    echo FanRPM is %fanrpm1
    unset %flagcpu
  }
}