mIRC Home    About    Download    Register    News    Help

Print Thread
#35100 09/07/03 02:41 AM
Joined: Jan 2003
Posts: 108
H
Vogon poet
OP Offline
Vogon poet
H
Joined: Jan 2003
Posts: 108
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
  }
}

#35101 09/07/03 02:15 PM
Joined: Jan 2003
Posts: 108
H
Vogon poet
OP Offline
Vogon poet
H
Joined: Jan 2003
Posts: 108
heh does anyone know wink

#35102 09/07/03 03:05 PM
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
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...

Last edited by theRat; 09/07/03 03:06 PM.

Code:
//if ( khaled isgod ) echo yes | else echo no
#35103 09/07/03 09:34 PM
Joined: Mar 2003
Posts: 54
J
Babel fish
Offline
Babel fish
J
Joined: Mar 2003
Posts: 54
Yea, as theRat said, hash tables would do the job a lot better. They're more efficient, and you can make use of /hinc.


Link Copied to Clipboard