mIRC Homepage
Posted By: pauls74462 onjoin bartender script II - 04/12/09 01:01 AM
I have this script it works great:

Code:
on *:join:#MyChannel: {
  if ($nick != $me) { describe $chan offer $nick $+ ! a $read(Drinks.txt) & toasts #MyChannel IRC network! }
}



I like to make it also where a person can order a drink with:

!order or !Order

and it'll serve them a drink

Pauls74462
Posted By: Tomao Re: onjoin bartender script II - 04/12/09 01:45 AM
Code:
on !*:join:#MyChannel:describe # offers $nick $+ ! a $read(Drinks.txt) & toasts # IRC network!
on $1:text:/!order/iS:#MyChannel:describe # serves $nick $+ ! a $read(Drinks.txt) & toasts # IRC network!
Posted By: Riamus2 Re: onjoin bartender script II - 04/12/09 02:42 AM
I'm curious why you'd use a regular expression, Tomao. I don't see any reason why that would be more efficient or useful. Maybe it is? Just wondering.

And, pauls... why do you want a ! after the nick?

bot offers nick! a mai tai... and so on. Probably would be better without it, but that's up to you of course. smile
Posted By: pauls74462 Re: onjoin bartender script II - 04/12/09 02:58 AM
Originally Posted By: Riamus2
I'm curious why you'd use a regular expression, Tomao. I don't see any reason why that would be more efficient or useful. Maybe it is? Just wondering.

And, pauls... why do you want a ! after the nick?

bot offers nick! a mai tai... and so on. Probably would be better without it, but that's up to you of course. smile


If you see the scuipt with topic of "onjoin bartender script" you'll see why the "!" is used, thought it was apart of the command.

Posted By: Riamus2 Re: onjoin bartender script II - 04/12/09 03:28 AM
$nick $+ ! just adds the ! to the $nick. You can remove $+ ! and you'll have the sentence without the ! in the middle. I put it there in my original script to you because of how I worded it. Since you changed the wording, you can change the punctuation as well.
Posted By: Tomao Re: onjoin bartender script II - 04/12/09 05:16 AM
Originally Posted By: Riamus2
I'm curious why you'd use a regular expression, Tomao. I don't see any reason why that would be more efficient or useful. Maybe it is? Just wondering.
Well, I used for stripping the control codes, hence the /S flag. Yes, I could've used the simple text event, but that'd mean an additional if statement with the $strip() identifier. I simply found it convenient is all.

Actually it just hit me that I could have done it like this:
Code:
on 1:TEXT:$( $+ $strip(!order) $+ ):#:
Posted By: Riamus2 Re: onjoin bartender script II - 04/12/09 11:14 AM
Ah, ok. Makes sense. I tend to make people type without control codes if they want to use my scripts. I'm mean that way. Lol!
Posted By: pauls74462 Re: onjoin bartender script II - 07/12/09 02:31 AM
Thanks all for the help on my bartender script! smile
Posted By: gooshie Re: onjoin bartender script II - 22/12/09 08:01 PM
Code:
on 1:TEXT:$( $+ $strip(!order) $+ ):#:

will do the same as:

on 1:TEXT:!order:#:


The $strip would only be applied to the word !order
since you didnt put any control codes there is
nothing to strip..

Your original regex is the best way to filter
out the control codes but to be the same you need
to do:

Code:
on $1:text:/^!order$/iS:#:
© mIRC Discussion Forums