|
Joined: Apr 2005
Posts: 1,008
Hoopy frood
|
OP
Hoopy frood
Joined: Apr 2005
Posts: 1,008 |
i have this:
ON *:JOIN:#channel: {
if ($me isop #channel) && (nick1 isin $nick) || (nick2i isin $nick) || (nick3 isin $nick) { .op #channel $nick }
elseif ($me !isop #channel) { halt }
}
basically i want to IF i am OP in #channel and someone joins it and is not op and matches $nick that i op him, but if i am not op that i dont do anything. will this code suffice or has errors?
|
|
|
|
Joined: Apr 2005
Posts: 1,008
Hoopy frood
|
OP
Hoopy frood
Joined: Apr 2005
Posts: 1,008 |
+ 1 sub question
i have this code:
ON 1:TEXT:$(* $+ $me $+ *):#: { .echo -a $timestamps User $nick has mentioned you in $chan }
problem is that my nickname is in this type:
|nickname|
so when someone does _nickname or nickname_ or |nickname| i get notified BUT if they say just nickname i get nothing... why?
|
|
|
|
Joined: Jun 2005
Posts: 127
Vogon poet
|
Vogon poet
Joined: Jun 2005
Posts: 127 |
Op on join: on @*:join:#: {
if ($nick == NICK) {
mode # +o $nick
}
} Nick Mentioned alert: on *:text:*:#: {
if ($me isin $1-) {
echo -at ยป $nick has mentioned you in $chan
}
} EDIT: I added the -t switch to the echo so that if your away, you will know when they said it, and be able to find it in the window where it was said.
Last edited by HAMM3R; 16/06/05 07:02 PM.
|
|
|
|
Joined: Apr 2005
Posts: 1,008
Hoopy frood
|
OP
Hoopy frood
Joined: Apr 2005
Posts: 1,008 |
|
|
|
|
Joined: Jun 2005
Posts: 127
Vogon poet
|
Vogon poet
Joined: Jun 2005
Posts: 127 |
 Same thing??
|
|
|
|
Joined: Apr 2005
Posts: 1,008
Hoopy frood
|
OP
Hoopy frood
Joined: Apr 2005
Posts: 1,008 |
now you changed it :P but your is precise coz in ur code if EXACT nick isin $nick OP what if nick has alternative nick like _nick1 or nick1_away then it wouldnt op :tongue: and for 2nd code i'll try 
|
|
|
|
Joined: Nov 2003
Posts: 2,321
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,321 |
on @*:join:#:{
if ($istok(nick1 nick2 nick3 nick4 nick5 etc, $nick, 32)) { mode $chan +o $nick }
}
|
|
|
|
Joined: Apr 2005
Posts: 1,008
Hoopy frood
|
OP
Hoopy frood
Joined: Apr 2005
Posts: 1,008 |
short  for HAMMER: 2nd script doesnt work nothing better 
|
|
|
|
Joined: Jun 2005
Posts: 127
Vogon poet
|
Vogon poet
Joined: Jun 2005
Posts: 127 |
works for me. i gotta go, so no time to troubleshoot. ill be back later
|
|
|
|
Joined: Oct 2004
Posts: 8,061
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,061 |
First note: If you want a script to do something only when you're opped, you can use @ in the event. It will only trigger if you are an op. Example: on @*:text:*:#: { } Second:
on *:text:*:#: {
if ($mid($me,2,$calc($len($me)-2))) isin $1-) {
.echo -a $timestamps User $nick has mentioned you in $chan saying $1-
}
}
NOTE: This is for only if you use a symbol on both sides of your nick and you want to be notified when your nick is used with or without those symbols. It will work when someone types: |raZOR| -raZOR- _raZOR_ raZOR |raZOR raZOR| etc. I added "saying $1-" because you usually want to know what someone said if they used your nick.
|
|
|
|
Joined: Nov 2003
Posts: 2,321
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,321 |
Just a note; $mid() has that $calc() functionality built in, for example: //echo -a $mid(hello world, 2, -2)
|
|
|
|
Joined: Oct 2004
Posts: 8,061
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,061 |
Ah, right. 
|
|
|
|
Joined: Apr 2005
Posts: 1,008
Hoopy frood
|
OP
Hoopy frood
Joined: Apr 2005
Posts: 1,008 |
altho that code seemed sweet in begining  but problem is next: since my real nick is not razor :tongue: and i really dont want to say what is it... enough to say is that my nick contains number+name so if someone says just PART of number i got notified if person just says 1 letter or 1 number that is inside my nick i get spammed with notifications :P
|
|
|
|
DaveC
|
DaveC
|
As Hamm3r has showed u can use @ in the on TEXT, i just thought it worth mentioning that the IF yoy had was incorrect if ($me isop #channel) && (nick1 isin $nick) || (nick2i isin $nick) || (nick3 isin $nick) { .op #channel $nick } change to if ($me isop #channel) && ( (nick1 isin $nick) || (nick2i isin $nick) || (nick3 isin $nick) ) { .op #channel $nick } reason The original if would have been true if (1) ($me isop #channel) AND (nick1 isin $nick) OR (2) (nick2i isin $nick) OR (3) (nick3 isin $nick) you needed to group the OR's into one lot ON 1:TEXT:$(* $+ $me $+ *):#: { .echo -a $timestamps User $nick has mentioned you in $chan } if your nick was "|nickname|" that wont work on _nickname or nickname_ or nickname it well only work on |nickname| or x|nickname| or |nickname|x or x|nickname|x ie: if my nick is DaveC you wont get a match if someone says ave
|
|
|
|
Joined: Apr 2005
Posts: 1,008
Hoopy frood
|
OP
Hoopy frood
Joined: Apr 2005
Posts: 1,008 |
if ($me isop #channel) && ( (nick1 isin $nick) || (nick2i isin $nick) || (nick3 isin $nick) ) { .op #channel $nick }
is that ( ( omething ) ) or (( something )) ? for 2nd part i havent understood a thing :tongue: sorry im bad in english 
|
|
|
|
DaveC
|
DaveC
|
is that ( ( omething ) ) or (( something )) What? Part2 : if your nick is |blah| then using $(* $+ $me $+ *) the person must say |blah| . It well NOT match using blah _blah blah_ |blah_ _blah| etc etc, it must have |blah|
|
|
|
|
Joined: Apr 2005
Posts: 1,008
Hoopy frood
|
OP
Hoopy frood
Joined: Apr 2005
Posts: 1,008 |
1st part
if ($me isop #channel) && ( (nick1 isin $nick) || (nick2i isin $nick) || (nick3 isin $nick) ) { .op #channel $nick }
are does this have to be seprataed by 1 space ( (something) ) or no space ((something)) in code 2nd part any other way to make it better ? coze that code i got up up well i already replied with spam echoing 
Last edited by raZOR; 17/06/05 01:37 PM.
|
|
|
|
DaveC
|
DaveC
|
1st part
The spaces are NOT needed. I put them in so it was a bit easier to spot, sorry.
2nd part
on *:text:$($+(*,$gettok($replace($me,|,?,_,?,~,?,[,?,],?,$({,),?,$(},),?),1-,63),*)):#:{
add or remove what ones you dont need.
|
|
|
|
Joined: Apr 2005
Posts: 1,008
Hoopy frood
|
OP
Hoopy frood
Joined: Apr 2005
Posts: 1,008 |
thanks much  ) PM btw 
Last edited by raZOR; 17/06/05 02:07 PM.
|
|
|
|
|