mIRC Homepage
Posted By: UpcomingChris Help with tracking messages? - 21/01/14 06:28 PM
basically i want a bot that keeps track of how many messages each person in the chat has sent. So that i can pull them back with something like !Messages (username) and it will give me the ammount of messages that person has sent since the script has been active, also a !resetMessages (username) would be good, But i'm not sure how to go about doing this.. Any help would be appreciated
Posted By: Nillen Re: Help with tracking messages? - 21/01/14 10:49 PM
This is untested, but should be what you're looking for.



Code:
alias -l add.msg {
writeini -n Messages.ini $1 Messages $calc($readini(Messages.ini,$1,Messages) + 1)
}

on $:text:!messages*:#: { 
if ($2 == $null) { msg $chan $nick has sent $readini(Messages.ini,$+(#,.,$nick),Messages) messages. | return }
else { msg $chan $2 has sent $readini(Messages.ini,$+(#,.,$2),Messages) messages. }
}

on *:text:*:#: { add.msg $+(#,.,$nick) }



Posted By: UpcomingChris Re: Help with tracking messages? - 23/01/14 11:07 AM
Thanks!
© mIRC Discussion Forums