mIRC Home    About    Download    Register    News    Help

Print Thread
#134639 03/11/05 10:09 AM
Joined: Aug 2005
Posts: 14
Eddy2k5 Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Aug 2005
Posts: 14
hi ya, i have been thinking of a script but i dont know how to start or even create it! so now i go online and i prolly get some help.

so if i do @stats it will msg a channel like this.

Most Lines Was Added By $NICK : 88 lines
second NICK was $NICK with 87 lines
third Nick was $nick with 77 lines

second request.. if its able todo it?!

my mirc client auto msg $chan the stats hourly to.
if anyone is nice and wanna help me out with this. damn i will be very happy!!

Regards: Andreas

#134640 03/11/05 12:40 PM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
You want those exact 3 lines to be sent to the challen every hour? What would be the use of that?
Why don't you type "/msg Most Lines Was Added By $NICK : 88 lines" instead of @stats? Is it a separate bot using mIRC, or do you need this on the same client you're using for chatting?
Lines added to where or to what? Do you have those stats already? How are they stored? Are hey stored in the first place? Are they sorted? How many people have 'added lines'?

I cannot read people's minds. I'd love to, but I can't...

Here's what I can give you now:

Code:
alias linesstats {
  msg $$1 Most Lines Was Added By $!NICK : 88 lines
  msg $1 second NICK was $!NICK with 87 lines
  msg $1 third Nick was $!nick with 77 lines
}
on *:INPUT:#channelname:{
  if ($1- === @stats) linesstats $chan
}
on me:*:JOIN:#channelname:.timer.linesstats 0 3600 linesstats $chan
on me:*:PART:#channelname:.timer.linesstats off

#134641 03/11/05 03:11 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Sounds like he wants it to count the number of lines people type and then output the top3 every hour.


Invision Support
#Invision on irc.irchighway.net
#134642 03/11/05 03:27 PM
A
Anonymous
Unregistered
Anonymous
Unregistered
A
yep... actually i'd be interrested in something like that myself.. sounds nice.
does someone have any ideas how i can efficiently record the no of lines each person on irc writes (not just the top 3) ? i'd also be interrested how you can do this with as few file accesses as possible (like write the results on hdd every 1min or so, not immediately)...
i don't need code (although it would be nice:) ) but just some general ideas..
thanks

#134643 03/11/05 03:36 PM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
Probably, but is it really that hard to say so too? If people don't go through the trouble to think about what they want and explain it clearly, why should anyone feel compelled to do an effort in helping them? Maybe use Search too, but that might be stretching it already...

#134644 03/11/05 03:45 PM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
I'd go for a hash table, each item is a $nick or $address mask with the number of lines as data. Needed improvements: limit monitored channels, append channelname to hash table name or item name so counts aren't mixed. I put in a timer to save the hash file every 5 minutes.

Some quick code (untested)
Code:
on *:START:{
  hmake linecount 50
  hload linecount .linecount.hash
  .timerlinecount 0 300 .hsave linecount linecount.hash
}
on *:EXIT:.hsave linecount linecount.hash
on *:TEXT:*:#:hinc linecount $fulladdress
on *:ACTION:*:#:hinc linecount $fulladdress

#134645 03/11/05 04:16 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
My channel (not the one in my sig) uses a script I wrote long ago for tracking stats like that. It's rather inefficient in that it uses INI instead of Hash for storing data, but it works. I did it a long time ago when I didn't know about hash tables and since it works, I've never changed it. It tracks the following:

Per User:
Total lines
Total number of days since the first line was recorded
Lines per day (just total lines divided by number of days)
Rank overall for total number of lines
Number of smiles (with a couple dozen ways to smile)
Number of frowns (with a dozen or so ways to frown)
Number of laughs (with a dozen or so ways to laugh)
Random quote (just changes the quote if the person types a line at the right time)

Everyone:
Tracks what position everyone is in with regard to total number of lines. From first down to 200+ position. It prunes the data based on number of lines and lines per day settings that I have set up. That tends to keep it hovering around only 200 people in the ranking.

Commands:
!stats (see your stats other than lines/day & number of days)
!stats nick (same as above, but for someone else)
!linestat (see your stats for lines/day & number of days & rank)
!linestat nick (same as above, but for someone else)
!lines # (see !linestat info the the person ranked with the number entered... let's you see how many more lines to go up a rank)
!linerace (see the top10 "big mouths")

Oh, and the total lines typed doesn't count lines like !stats (how you see your stats), or other triggers that are used. It also won't count any advertisements.

Anyhow, it can easily be done. I won't bother sharing this stats scripting as it isn't well-written as I mentioned. It was one of the first scripts I wrote. Still works well, but really poor coding style.

The most interesting part of it is to see the trivia bot's lines... 5500+ per day for a total of over 2 million. laugh

*The bot isn't ranked for total lines (it's actually rank 0), so it's not in the top 10. It also doesn't track the smiles/frowns/laughs/quote because it's just trivia and doesn't need to.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard