mIRC Home    About    Download    Register    News    Help

Print Thread
#193650 23/01/08 09:03 AM
Joined: Jan 2008
Posts: 8
A
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Jan 2008
Posts: 8
Back in the 2.x and 3.x days, I used to be able to write awesome scripts, chaining extra remote files, etc, now that I've started re-using mIRC, I can't remember how to do some of the most simple things. Here's today's examples:

Firstly, Say I wanted to write a remote that would trigger anytime someone used the word 'why' and a question mark in the same line. For example:
'Why would someone do that?' would trigger it, but 'why isn't as important so much as what the hell they were thinking' would not.

on *:text:*why*:#:/msg $chan Because I said so.

That would trigger on both, I can't seem to remember to save my life how to set multiple requirement triggers like I need, not to mention whether or not I can even make a question mark a remote trigger. smirk

Secondly, * is the universal access level for a remote script, but as in the example above, I cannot trigger my own scripts. Isn't there an access level setting that would allow me to trigger a script?

Last edited by AlphaMaelstrom; 23/01/08 10:10 AM.
Joined: Jul 2006
Posts: 4,185
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,185
Code:
On $*:text:/why.*\?$/:#:msg $chan Because i said so

On text is for other users, and On input is for you
the prefix $ mean that the text match is a regex


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Considering he is just getting back into scripting, maybe a regex statement is a bit much. How bout something simple.

Quote:
on *:text:why *:#:{
if ($chr(63) isin $2-) { msg $chan Why Not? }
}

Joined: Jul 2006
Posts: 4,185
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,185
You're right, but he wants something more precise than what you said and regex is really useful in this case smile


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jan 2004
Posts: 509
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Jan 2004
Posts: 509
Originally Posted By: AlphaMaelstrom
on *:text:*why*:#:/msg $chan Because I said so.


Pfft.

Here's what I got (and your output would trigger mine).

Code:
on *:text:because i can*:#: {
  if (!%Can) && ($4 == $null) /msg $chan "Because I can" is another illogical argument. To say 1 will do something because 1 can do something, does not distinguish between what 1 wants to do and what 1 doesn't want to do when 1 can do. | inc -u300 %Can
}

on *:text:because i said so*:#: {
  if (!%So) /msg $chan "Because I said so" is another illogical argument, because it does not distinguish between what 1 does when 1 said so and what 1 does when 1 doesn't say so. | inc -u300 %So
}

The next 1 is exactly the same thing.

on *:text:cuz i said so*:#: {
  if (!%So) /msg $chan "Because I said so" is another illogical argument, because it does not distinguish between what 1 does when 1 said so and what 1 does when 1 doesn't say so. | inc -u300 %So
}

;i changed my mind
;Let's hope the new one works out better for you than the old one did. 

on *:text:either *:#: {
  if (or !isin $1-) && (*way* !iswm $2) { 
    if (!%Either) { /msg $chan Or. | inc -u75 %Either }
  }
}


Anyways, add floor protection to yours like I do to mine, cuz no doubt users will abuse 'em.

-Neal.


Link Copied to Clipboard