I want this code to put it in my script
[14:00] <~TG007_Bot> Room Stats generation for #TG007 has begun
[14:01] <~TG007_Bot> QuickStats by mIRCStats - Today's top talkers: IP__`: 2 lines
A TG007 community discussion started by Bloodyboss.
I want this code to put it in my script
[14:00] <~TG007_Bot> Room Stats generation for #TG007 has begun
[14:01] <~TG007_Bot> QuickStats by mIRCStats - Today's top talkers: IP__`: 2 lines
hey there mate,
Thought I'd post something here to help you on the way... I wouldn't know the exact code they use... but I have an idea on what you could use to get you started...
Basically its an on TEXT event, which would record and store data of each nickname which posts a message to the channel..
You could use variables or an .ini file, or even better still hash tables which I'm a bit of a fan of.. However for this purpose I'll just use .ini to show an example, you can edit however you like..
on !:TEXT:*:#:{
var %n = $nick, %c = $chan, %x = $readini(chanlog.ini,%c,%n), %v = $gettok(%log. [ $+ %c],1,32)
inc %x
writeini -n chanlog.ini %c %n %x
if (%x < %v) return
else { set %log. [ $+ %c ] $iif(%x == %v,%log. [ $+ %c ],$iif(%x > %v,%x)) %n }
}
/*
Note: "on !:TEXT" means, whoever writes something to the channel except for you!
Note: The "-n" flag in /writeini, means it will attempt to write to the .ini file if it is bigger than 64k
*/
Thats a simple code to log the data...
Then to show the data could be something like...
on *:TEXT:@stat:#:{
if (!%log. [ $+ [ $chan ] ]) msg # No data is stored for this Channel.
else msg # Top Talker in this Channel $gettok(%log. [ $+ [ # ] ],2,32) with $gettok(%log. [ $+ [ # ] ],1,32) Lines!
}
/*
Note: With this on TEXT event, anyone could use this command by typing @stat, so either add a user level or something along the lines of that...
*/
Just an idea of the code... I'm sure there's plenty of ways to do this, and you can add, edit this to suit your needs now =)
Kind Regards,
Daniel
Thank you danial it is very helpful and simple , ty for ur effort
hope for many ccomplicated ideas ![]()
where are your ideas err0r !! :$
It's impossible to trigger your own text, thus the ! prefix by the text event is not necessary.Note: "on !:TEXT" means, whoever writes something to the channel except for you!
Hahah, thanks fanfare =)
Didnt realise it until you mentioned it, the ! prefix would be be4tter for like on JOIN events and others haha
Cheers buddy ![]()
Kind Regards,
Daniel
ooo, Also realised there were a few bugs in this code... Heres the new code which straightens out some of the bugs...
/*
Bug Fixes Include:
- If local variable = $null, set it as 0...
- Added evaluation tags in the logging process, as it will evaluate the local variable %c now!
- Added support for multiple people to be the top talkers.. So if Daniel and James have both the highest lines, will now say " Daniel & James"
NOTE: @stat command is available to anyone, I'd strongly recommend you changing this to only allow a user level nickname...
*/
on *:TEXT:*:#:{
if ($1 == @stat) {
if (!%log. [ $+ [ # ] ]) msg # No data is stored for this Channel.
else msg # Top Talker in this Channel $replace($gettok(%log. [ $+ [ # ] ],2-,32),$chr(32),$+($chr(32),$chr(38),$chr(32))) with $gettok(%log. [ $+ [ # ] ],1,32) Lines!
}
else {
var %n = $nick, %c = $chan, %x = $readini(chanlog.ini,%c,%n), %v = $iif(%log. [ $+ [ %c ] ],$gettok(%log. [ $+ [ %c ] ],1,32),0)
inc %x
writeini -n chanlog.ini %c %n %x
if (%x < %v) return
set %log. [ $+ [ %c ] ] $iif(%x == %v,%log. [ $+ [ %c ] ],$iif(%x > %v,%x)) %n
}
}
Hope this helps...
Kind Regards,
Daniel
Has the Chevy Vortec looking heads, and Ford style exhaust manifolds
Very nice setup though lol
Thanks Chain for the link.
Thanks chain for the handy link ![]()
Kind Regards,
Daniel
yes what chain posted is what we use.. sorry i'm working on a project that has all my attention atm.. follow the instructions on that page and it will work fine. If u decide to use it on a ircx network you are going to have to jump through a few hoops.. as long as u stick to ircd you won't have any trouble with the default setup
Get information about ircWx here
Sign in to reply or start a new topic where your account has permission.