mIRC Home    About    Download    Register    News    Help

Print Thread
how to say hello if that is not me #67408 11/01/04 10:29 AM
Joined: Jan 2004
Posts: 14
N
no_brain Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: Jan 2004
Posts: 14
Code:
 on 1:JOIN:#channel: if (-mynick = nick-) {/msg #channel Hi!} else{/msg #channel Hi $nick !}


Is there a variable for my nick?

Last edited by no_brain; 11/01/04 11:50 AM.
Re: how to say hello if that is not me #67409 11/01/04 12:27 PM
Joined: Sep 2003
Posts: 584
B
bunar Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Sep 2003
Posts: 584
$me

Re: how to say hello if that is not me #67410 11/01/04 01:35 PM
Joined: Jan 2004
Posts: 14
N
no_brain Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: Jan 2004
Posts: 14
Thanx

Code:
 on 1:JOIN:#mangapix:if (!$nick==$me){/msg #mangapix Hi $nick !}else{else{/msg #mangapix Hi!}}
 


Whats wrong?
Quote:
#MANGAPIX Unknown command

Last edited by no_brain; 11/01/04 01:37 PM.
Re: how to say hello if that is not me #67411 11/01/04 01:46 PM
Joined: Jan 2004
Posts: 26
M
module Offline
Ameglian cow
Offline
Ameglian cow
M
Joined: Jan 2004
Posts: 26
ON *:JOIN:#mangapix:{
if ($nick != $me) { msg # Hi }
}

OR

ON !me:JOIN:#mangpix:msg # Hi

Not sure if the second one will work. Been away from scripting for a while, heh.


It's not in the GUI, it's in the source.
Re: how to say hello if that is not me #67412 11/01/04 01:49 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Pretty close:
Code:
ON !*:JOIN:#mangpix:msg # Hi
The ! event prefix prevents yourself from triggering the event.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: how to say hello if that is not me #67413 11/01/04 02:32 PM
Joined: Jan 2004
Posts: 14
N
no_brain Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: Jan 2004
Posts: 14
Both does not working.

I think its because the if is in that thing and the other thing is when the thing was not activated...

Is there no way for else function?

This is my way, but...

Code:
   ELSE { msg # Hi! } 



EDIT:
All O.K.
I made this:
Code:
 ON *:JOIN:#mangapix:{
  if ($nick != $me) { msg # Hi $nick ! }
  if ($nick = $me) { msg # Hi! }
} 

Last edited by no_brain; 11/01/04 02:38 PM.
Re: how to say hello if that is not me #67414 11/01/04 06:49 PM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Might try:

Code:
on *:JOIN:#mangapix: {
  if ($nick == $me) /msg $chan Have no fear, $me is here!
  else /msg $chan Hello, $nick $+ !
}


EDIT:
p.s. to correct the flaws in your script, an if statement uses two ='s for a condition. example:

if (one == one)
if (a == b)

and so on. Additionally, if you are testing for one thing, and want the exact opposite, its both less typing, and faster to just use "else". example:

if (a == a) /echo -a It was the letter a!
else /echo -a It's not an a!

Last edited by KingTomato; 11/01/04 06:51 PM.

-KingTomato