mIRC Home    About    Download    Register    News    Help

Print Thread
Help With Script #224115 05/08/10 02:14 PM
Joined: Oct 2006
Posts: 68
B
BuTLeR Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2006
Posts: 68
Why won't this work?

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


At Your Service.
Re: Help With Script [Re: BuTLeR] #224116 05/08/10 02:18 PM
Joined: Feb 2009
Posts: 133
C
chacha Offline
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2009
Posts: 133
try this
Code:
on *:text:*cookie*:#:


WorldDMT
Re: Help With Script [Re: chacha] #224117 05/08/10 02:25 PM
Joined: Oct 2006
Posts: 68
B
BuTLeR Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2006
Posts: 68
Did not work =/


At Your Service.
Re: Help With Script [Re: BuTLeR] #224118 05/08/10 02:28 PM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
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.
Re: Help With Script [Re: 5618] #224119 05/08/10 02:36 PM
Joined: Oct 2006
Posts: 68
B
BuTLeR Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2006
Posts: 68
Ta!


At Your Service.
Re: Help With Script [Re: 5618] #224151 05/08/10 07:36 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
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 }

Re: Help With Script [Re: Tomao] #224154 05/08/10 07:54 PM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
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

Re: Help With Script [Re: 5618] #224160 05/08/10 08:57 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
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.

Re: Help With Script [Re: Tomao] #224168 05/08/10 10:43 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net