mIRC Home    About    Download    Register    News    Help

Print Thread
#240339 23/01/13 02:49 PM
Joined: Jan 2013
Posts: 5
K
King Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
K
Joined: Jan 2013
Posts: 5
i made this simpls code but i got 1 problem

Code:
on *:join:#: {  msg $chan Welcome $nick to Crazy Channel.
}


but when my bot join #Crazy Channel he will Welcome Himself smirk

i want like when Bot join Any Channel this Message Come "Hyper is Back"

And when Any user join Channel then this message Come "Welcome $nick to Crazy Channel"

Can Anyone help me to make this?? And there is Any limit in mIRC Remote Section? cuz i put a big script in it but that script won't work. i put total 1000 line in Remote Section. how to solve this problem?

King #240340 23/01/13 03:46 PM
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Code:
on *:join:#: {
 if ($nick != $me) { 
 msg $chan Welcome $nick to Crazy Channel.
 }
}

And i have 1500+ lines in one file of remote, so your problem are somwhere else, not in a limit of remote.

Last edited by sparta; 23/01/13 03:47 PM.

if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
King #240341 23/01/13 05:11 PM
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Code:
on me:*:JOIN:#:msg $chan Hyper is Back
on !*:JOIN:#Crazy:msg $chan Welcome $nick to Crazy Channel.

or...
Code:
on *:JOIN:#:{
  if ($nick == $me) msg $chan Hyper is Back
  elseif ($chan == #Crazy) msg $chan Welcome $nick to Crazy Channel.
}

5618 #240344 23/01/13 06:24 PM
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
You should use { }.
Code:
on me:*:JOIN:#:{ msg $chan Hyper is Back }
on !*:JOIN:#Crazy:{ msg $chan Welcome $nick to Crazy Channel. }

on *:JOIN:#:{
  if ($nick == $me) { msg $chan Hyper is Back }
  elseif ($chan == #Crazy) { msg $chan Welcome $nick to Crazy Channel. }
}


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
sparta #240346 23/01/13 06:27 PM
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
No you should not. They are completely unnecessary the way you use them. They are only necessary for multi-line scripts.

5618 #240347 23/01/13 07:11 PM
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
People told me when i started that i should use them. So i use them. =)


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
sparta #240349 23/01/13 10:53 PM
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Whoever told you so was a wise one. It's a good habit to use the curly brackets. They help to minimize potential errors from happening.

Tomao #240356 24/01/13 11:14 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Yeah, there are things that are sometimes necessary and sometimes not, like {}'s. It saves headaches if you are just in the habit of always using them even when they aren't needed. Otherwise, you have a greater chance of writing a large script and forgetting them when they are needed and then wasting a lot of time debugging the script.

In the end, that's a personal preference and is up to the individual. Personally, I make things multiline most of the time anyhow. It means more lines, but I just think it's easier to read that way. About the only time I do anything that uses {}'s on a single line are error message/validations. Again, it's just a preference and can be done either way.


Invision Support
#Invision on irc.irchighway.net
Riamus2 #240357 24/01/13 01:06 PM
Joined: Jan 2013
Posts: 5
K
King Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
K
Joined: Jan 2013
Posts: 5
thx for ur reply guys


Link Copied to Clipboard