mIRC Homepage
Posted By: sCHuTt counting :p - 04/07/05 09:32 AM
I've got this m8 of mine, an he ':p' alot. And I do mean ALOT lol.
Up to the point where it annoys me, now to annoy him back, I'd like some kind of a counter for every time he types ':p'

This possible? cuz the on:TEXT::p thingy kinda whistles up with the :: :S

- sChutt
Posted By: Sleepyfreak Re: counting :p - 04/07/05 09:46 AM
i got a starter

Code:
 
on *:TEXT:;p:*:{
  if ($nick == yourmate'snick) {
  and i don't know how to do a counter so ask someone else
  }
}
 
Posted By: Mentality Re: counting :p - 04/07/05 09:47 AM
Type /set %tongue 0.

You could then use something like this:

on *:text:*:#:{
if ($nick == YourFriend) && (:p isin $1-) {
inc %tongue
}
}


Regards,
Posted By: Mpdreamz Re: counting :p - 04/07/05 02:28 PM
inc creates the variable if it doesnt excist so you dont have to set it before hand
Posted By: Mentality Re: counting :p - 04/07/05 02:43 PM
o0o, haven't tried before!

* Mentality hands out cookies when Para isn't looking

Regards,
Posted By: IR_n00b Re: counting :p - 04/07/05 04:24 PM
this should work:
on *:text:*:#: {
if ($nick == nickname) && ($regex($1-,/:P/gi)) {
var %s = $v1
if (%s) set %smiles $iif(%s == 0,%smiles,$calc(%smiles $+ %s))
}
}

im not sure if u used braclets corectly as i made this on the fly smile
Posted By: FiberOPtics Re: counting :p - 04/07/05 04:43 PM
In theory, that variable could already exist, which in turn would give a wrong representation of the value of %tongue.

If %tongue had a non-numerical value, then the inc would do nothing, and if it had, it would increase, whilst we'd want it to be 0 when the script is first started.

Yes, the odds are slim, however, I thought it was justified to tell him to type /set %tongue 0 first for that reason.

Greets
Posted By: tidy_trax Re: counting :p - 04/07/05 05:43 PM
Code:
on $*:text:/\72p/i:#:{ 
  if ($nick == nickname) {
    if (%tongue !isnum 1-) { set %tongue 0 }
    inc %tongue $count($1-,:p)
  }
}
Posted By: Riamus2 Re: counting :p - 05/07/05 01:33 PM
Just as a side note .... I made a stats script awhile back which allowed you to use a dialog and enter all the types of characters you want to use for smiles, frowns, and laughs, and then it tracks those (along with lines and various other things). That was a long time ago, so it could probably be improved, but just commenting that if you want to track multiple types of smiles as well as tracking frowns and laughs and whatever else, you might consider creating a dialog for entering the types you want to track.
© mIRC Discussion Forums