Bloodyboss Posted January 8, 2010 Report Share Posted January 8, 2010 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 Link to comment Share on other sites More sharing options...
Dan* Posted January 12, 2010 Report Share Posted January 12, 2010 (edited) 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 Edited January 12, 2010 by Dan* Link to comment Share on other sites More sharing options...
Bloodyboss Posted January 12, 2010 Author Report Share Posted January 12, 2010 Thank you danial it is very helpful and simple , ty for ur effort hope for many ccomplicated ideas where are your ideas err0r !! :$ Link to comment Share on other sites More sharing options...
Fanfare Posted January 12, 2010 Report Share Posted January 12, 2010 (edited) Note: "on !:TEXT" means, whoever writes something to the channel except for you!It's impossible to trigger your own text, thus the ! prefix by the text event is not necessary. Edited January 12, 2010 by Fanfare Link to comment Share on other sites More sharing options...
Dan* Posted January 13, 2010 Report Share Posted January 13, 2010 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 Link to comment Share on other sites More sharing options...
Dan* Posted January 13, 2010 Report Share Posted January 13, 2010 (edited) 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 Edited January 13, 2010 by Dan* Link to comment Share on other sites More sharing options...
Site Moderator chain Posted January 13, 2010 Site Moderator Report Share Posted January 13, 2010 What you see there Bloodyboss is from here http://www.nic.fi/~mauvinen/mircstats/ Link to comment Share on other sites More sharing options...
Kronicdreamer Posted January 13, 2010 Report Share Posted January 13, 2010 Has the Chevy Vortec looking heads, and Ford style exhaust manifolds Very nice setup though lol Link to comment Share on other sites More sharing options...
Fanfare Posted January 13, 2010 Report Share Posted January 13, 2010 Thanks Chain for the link. Link to comment Share on other sites More sharing options...
Dan* Posted January 14, 2010 Report Share Posted January 14, 2010 Thanks chain for the handy link Kind Regards, Daniel Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now