mIRC Home    About    Download    Register    News    Help

Print Thread
#224115 05/08/10 02:14 PM
B
BuTLeR
BuTLeR
B
Why won't this work?

Code:
on *:text:cookie:#:if (!$($+(%,f),2)) { 
  inc -u5 %f | 
  .describe $chan gives $nick a cookie
}

#224116 05/08/10 02:18 PM
Joined: Feb 2009
Posts: 133
C
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2009
Posts: 133
try this
Code:
on *:text:*cookie*:#:

chacha #224117 05/08/10 02:25 PM
B
BuTLeR
BuTLeR
B
Did not work =/

#224118 05/08/10 02:28 PM
5
5618
5618
5
Your syntax is a bit messed up. I assume %f is just a numeric value? Then why all the $+() and $(,2)?
Code:
on *:TEXT:cookie:#: if (!%f) { inc -u5 %f | .describe $chan gives $nick a cookie }

Also, do you want the . in front of describe? That makes it silent so you do not see your describe/action.

Last edited by 5618; 05/08/10 02:28 PM.
#224119 05/08/10 02:36 PM
B
BuTLeR
BuTLeR
B
Ta!

#224151 05/08/10 07:36 PM
Joined: Jul 2007
Posts: 1,124
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,124
You don't have to write the word cookie again, just use $1 to return it from the match text of the event:
Quote:
on *:text:cookie:#: if (!%f) { inc -u5 %f | .describe $chan gives $nick a $1 }

Tomao #224154 05/08/10 07:54 PM
5
5618
5618
5
Originally Posted By: Tomao
You don't have to write the word cookie again, just use $1 to return it from the match text of the event:
Quote:
on *:text:cookie:#: if (!%f) { inc -u5 %f | .describe $chan gives $nick a $1 }

And what, pray tell, is the gain in that? It serves no purpose here.
On the contrary, it requires $1 to be evaluated first. You may as well use $matchkey

#224160 05/08/10 08:57 PM
Joined: Jul 2007
Posts: 1,124
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,124
I'm not trying to argue with you to hurt your pride or anything. There's no gain in using $1, but it doesn't require reiteration of the word cookie. Again, if you think you're right, you're right.

Tomao #224168 05/08/10 10:43 PM
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Let's not start another argument in a thread like some other recent threads. smile

Anyhow, if you know the response already, putting it in as plain text is going to be faster than putting it in as a variable or an identifier, which is what he was saying. $1 is great if the value changes, but isn't any use except to save a few characters if it's a constant value. That said, you might lost 1ms or so with using $1, so it's not like it's going to matter.


Link Copied to Clipboard