mIRC Home    About    Download    Register    News    Help

Print Thread
onjoin bartender script II #216829 04/12/09 01:01 AM
Joined: Dec 2009
Posts: 7
P
pauls74462 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
P
Joined: Dec 2009
Posts: 7
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

Re: onjoin bartender script II [Re: pauls74462] #216830 04/12/09 01:45 AM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
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!

Re: onjoin bartender script II [Re: Tomao] #216831 04/12/09 02:42 AM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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


Invision Support
#Invision on irc.irchighway.net
Re: onjoin bartender script II [Re: Riamus2] #216832 04/12/09 02:58 AM
Joined: Dec 2009
Posts: 7
P
pauls74462 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
P
Joined: Dec 2009
Posts: 7
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.


Re: onjoin bartender script II [Re: pauls74462] #216834 04/12/09 03:28 AM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
$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.


Invision Support
#Invision on irc.irchighway.net
Re: onjoin bartender script II [Re: Riamus2] #216836 04/12/09 05:16 AM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
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) $+ ):#:

Re: onjoin bartender script II [Re: Tomao] #216845 04/12/09 11:14 AM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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!


Invision Support
#Invision on irc.irchighway.net
Re: onjoin bartender script II [Re: Riamus2] #216916 07/12/09 02:31 AM
Joined: Dec 2009
Posts: 7
P
pauls74462 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
P
Joined: Dec 2009
Posts: 7
Thanks all for the help on my bartender script! smile

Re: onjoin bartender script II [Re: Tomao] #216921 22/12/09 08:01 PM
Joined: Nov 2009
Posts: 117
gooshie Offline
Vogon poet
Offline
Vogon poet
Joined: Nov 2009
Posts: 117
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:#: