mIRC Homepage
Posted By: BuTLeR Help With Script - 05/08/10 02:14 PM
Why won't this work?

Code:
on *:text:cookie:#:if (!$($+(%,f),2)) { 
  inc -u5 %f | 
  .describe $chan gives $nick a cookie
}
Posted By: chacha Re: Help With Script - 05/08/10 02:18 PM
try this
Code:
on *:text:*cookie*:#:
Posted By: BuTLeR Re: Help With Script - 05/08/10 02:25 PM
Did not work =/
Posted By: 5618 Re: Help With Script - 05/08/10 02:28 PM
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.
Posted By: BuTLeR Re: Help With Script - 05/08/10 02:36 PM
Ta!
Posted By: Tomao Re: Help With Script - 05/08/10 07:36 PM
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 }
Posted By: 5618 Re: Help With Script - 05/08/10 07:54 PM
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
Posted By: Tomao Re: Help With Script - 05/08/10 08:57 PM
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.
Posted By: Riamus2 Re: Help With Script - 05/08/10 10:43 PM
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.
© mIRC Discussion Forums