mIRC Home    About    Download    Register    News    Help

Print Thread
#122850 16/06/05 04:28 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
i have this:

Code:
 
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?


IceCapped
#122851 16/06/05 04:36 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
+ 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?


IceCapped
#122852 16/06/05 06:43 PM
Joined: Jun 2005
Posts: 127
H
Vogon poet
Offline
Vogon poet
H
Joined: Jun 2005
Posts: 127
Op on join:
Code:
on @*:join:#: {
  if ($nick == NICK) {
    mode # +o $nick
  }
}

Nick Mentioned alert:
Code:
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.
#122853 16/06/05 06:46 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
same thing as mine :P


IceCapped
#122854 16/06/05 06:48 PM
Joined: Jun 2005
Posts: 127
H
Vogon poet
Offline
Vogon poet
H
Joined: Jun 2005
Posts: 127
shocked Same thing??


-- HAMM3R (aka: alhammer)
http://www.HAMM3R.net
#122855 16/06/05 06:53 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
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 laugh


IceCapped
#122856 16/06/05 06:54 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
on @*:join:#:{
  if ($istok(nick1 nick2 nick3 nick4 nick5 etc, $nick, 32)) { mode $chan +o $nick }
}


New username: hixxy
#122857 16/06/05 06:58 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
short smile

for HAMMER: 2nd script doesnt work nothing better smirk


IceCapped
#122858 16/06/05 07:09 PM
Joined: Jun 2005
Posts: 127
H
Vogon poet
Offline
Vogon poet
H
Joined: Jun 2005
Posts: 127
works for me. i gotta go, so no time to troubleshoot. ill be back later


-- HAMM3R (aka: alhammer)
http://www.HAMM3R.net
#122859 16/06/05 07:39 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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:

Code:
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.


Invision Support
#Invision on irc.irchighway.net
#122860 16/06/05 08:51 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Just a note; $mid() has that $calc() functionality built in, for example:

Code:
//echo -a $mid(hello world, 2, -2)


New username: hixxy
#122861 16/06/05 08:54 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Ah, right. smile


Invision Support
#Invision on irc.irchighway.net
#122862 16/06/05 10:05 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
altho that code seemed sweet in begining laugh

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


IceCapped
#122863 17/06/05 05:57 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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


Quote:
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

#122864 17/06/05 01:28 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
Quote:

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 smirk


IceCapped
#122865 17/06/05 01:33 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
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|

#122866 17/06/05 01:37 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
1st part
Code:
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 smirk

Last edited by raZOR; 17/06/05 01:37 PM.

IceCapped
#122867 17/06/05 01:56 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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.

#122868 17/06/05 02:01 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
thanks much smile)

PM btw laugh

Last edited by raZOR; 17/06/05 02:07 PM.

IceCapped

Link Copied to Clipboard