mIRC Homepage
Posted By: Hindsight Line count - 09/07/03 02:41 AM
Ive been trying to get an accurate line counter to work. For some reason however, it only works for the active channel. Any problems you see... Im completely stumped.
Code:
on 1:INPUT:#: { 
  if ($readini(hindsettings.ini,Sett. $+ $gettok($server, 2, 46),$chan $+ . $+ lcount) != $null) {
    writeini -n hindsettings.ini Sett. $+ $gettok($server, 2, 46) $chan $+ . $+ lcount $calc($readini(hindsettings.ini,Sett. $+ $gettok($server, 2, 46),$chan $+ . $+ lcount) + 1)
  }
  else {
    writeini -n hindsettings.ini Sett. $+ $gettok($server, 2, 46) $chan $+ . $+ lcount  1
  }
}
on 1:Text:*:#: {
  if ($readini(hindsettings.ini,Sett. $+ $gettok($server, 2, 46),$chan $+ . $+ tcount) != $null) {
    writeini -n hindsettings.ini Sett. $+ $gettok($server, 2, 46) $chan $+ . $+ tcount $calc($readini(hindsettings.ini,Sett. $+ $gettok($server, 2, 46),$chan $+ . $+ lcount) + 1)
  }
  else {
    writeini -n hindsettings.ini Sett. $+ $gettok($server, 2, 46) $chan $+ . $+ tcount  1
  }
}
Posted By: Hindsight Re: Line count - 09/07/03 02:15 PM
heh does anyone know wink
Posted By: theRat Re: Line count - 09/07/03 03:05 PM
Code:
on 1:INPUT:#: { 
  incini hindsettings.ini $+(Sett.,$gettok($server, 2, 46)) $+($chan,.lcount)
}

on 1:Text:*:#: {
  incini hindsettings.ini $+(Sett.,$gettok($server, 2, 46)) $+($chan,.lcount)
}

alias incini {
  var %file = $+(",$deltok($deltok($1-,-1,32),-1,32),")
  var %section = $gettok($1-,-2,32)
  var %item = $gettok($1,-1,32)
  if ( $ini(%file,%section,%item) ) { 
    writeini -n %file %section %item $calc($readini(%file,%section,%item) + 1)
  }
  else {
    writeini -n %file %section %item 1
  }
}


But I'd still prefer hashtables over the .ini solution...
Posted By: Jagfire Re: Line count - 09/07/03 09:34 PM
Yea, as theRat said, hash tables would do the job a lot better. They're more efficient, and you can make use of /hinc.
© mIRC Discussion Forums