mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2004
Posts: 4
Self-satisified door
OP Offline
Self-satisified door
Joined: Jul 2004
Posts: 4
I'm trying to revamp this join count script because I don't like how it sets a variable for everyone %thenick.thechan.joins X
It also keeps track of parts, letters used, words used and smilies used. So I have a fuuload of variables for just that.

I followed how to write an .ini but I can't get the join count to increase the number when someone else joins. I don't know if that makes any sense or is enough information. If not let me know.

Edit: Maybe if I could get it to read the ini and set a temp %var then increase that and finally write over the old number then unset the temp var or maybe when I disconnect from mIRC it clears the vars, that should do it. I'm getting closer lol

Last edited by xenokite; 04/07/05 08:20 PM.

If I'm wrong I'm willing to learn. We all start from somewhere.
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Code:
on *:JOIN:#mychan:{
var %oldcount = $readini(joincount.ini,joins,count)
writeini joincount.ini joins count $calc(%oldcount + 1)
}

alias chancount { echo -a Count of Joins  $readini(joincount.ini,joins,count) }

try that out

Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
It would be best to use a hash table if you're doing a stats script.

/help hash tables

This would be better than INIs or txt files.


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
Joined: Jul 2004
Posts: 4
Self-satisified door
OP Offline
Self-satisified door
Joined: Jul 2004
Posts: 4
MikeChat- Awesome! That's exactly what I was looking for! So easy, but I bet I overlooked it a hundred times. Thanks laugh

xDaeMoN - I'm still new at this and I just want a some simple stats for our smaller channel. hash tables seem really complex for me right now.


If I'm wrong I'm willing to learn. We all start from somewhere.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Hash tables aren't really much more complicated than INI files.

1) Make the table (best with ON START... alternatively, use /hload with ON START)
/hmake Stats 10

2) Add your data
/hadd Stats <Nick> <Joins> <Parts> <Quits> <Other data>

3) Read your data
//echo -a $hget(Stats,Nick).data

4) Separate your data as needed (necessary if you are using more than just joins in the stats)
//echo -a $gettok($hget(Stats,Nick).data,x,32)
[Replace "x" with whatever item of data you're trying to get information on... in #2 above, 1 would be Joins, 2 would be Parts, 3 would be Quits, etc]

Note that you probably also want to look into saving/loading the hash table:

/hsave
/hload

Example way to increment joins:

Code:
on *:join:#: {
  if ($hget(Stats,$nick) != $null) {
    hadd Stats $nick $calc($gettok($hget(Stats,$nick).data,1,32) + 1) $gettok($hget(Stats,$nick).data,2-,32)
  }
  else {
    hadd Stats $nick 1
  }
}


This would just increment your joins (if joins is the first item in the table).

Last edited by Riamus2; 05/07/05 01:50 PM.

Invision Support
#Invision on irc.irchighway.net
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
errr ummmm, dont you mean....

3) Read your data
//echo -a $hget(Stats,Nick)

4) Separate your data as needed (necessary if you are using more than just joins in the stats)
//echo -a $gettok($hget(Stats,Nick),x,32)

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Ugh... sorry. smile

Fixing...


Invision Support
#Invision on irc.irchighway.net
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
lol now my reply looks stupid and i cant edit it frown

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
lol laugh


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard