mIRC Home    About    Download    Register    News    Help

Print Thread
So simple, why doesn't it work? #247067 20/07/14 04:25 PM
Joined: Jul 2014
Posts: 6
R
RichardC Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
Joined: Jul 2014
Posts: 6
on 1:JOIN:#:{
/set %r $rand(1,5)
if(%r == 1) /speak Hi
if(%r == 2) /speak Hey
if(%r == 3) /speak Hello
if(%r == 4) /speak Howdy
if(%r == 5) /speak Suuup
}

The above code will not work even though the variable %r gets set correctly.

Re: So simple, why doesn't it work? [Re: RichardC] #247069 20/07/14 04:34 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Add a space after the if.
Code:
if (%r == 5) { do stuff }


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: So simple, why doesn't it work? [Re: RichardC] #247070 20/07/14 04:35 PM
Joined: Jan 2004
Posts: 1,282
L
Loki12583 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,282
You need a space after the "if". You probably have lots of errors in your status window.

Re: So simple, why doesn't it work? [Re: Nillen] #247072 20/07/14 04:51 PM
Joined: Jul 2014
Posts: 6
R
RichardC Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
Joined: Jul 2014
Posts: 6
As simple as that?!

Thanks

Re: So simple, why doesn't it work? [Re: Nillen] #247075 20/07/14 05:31 PM
Joined: Jul 2014
Posts: 6
R
RichardC Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
Joined: Jul 2014
Posts: 6
on 1:JOIN:#bruteforcetest:{
%n $nick
/set %r $rand(1,5)
if (%r == 1) { /speak Hi %n, }
if (%r == 2) { /speak Hey %n, }
if (%r == 3) { /speak Hello %n, }
if (%r == 4) { /speak Howdy %n, }
if (%r == 5) { /speak Sup %n, }
/speak , welcome to the channel
}

Any idea why this won't speak the nick?

Re: So simple, why doesn't it work? [Re: RichardC] #247076 20/07/14 05:49 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
/help variables
Code:
%n $nick
means nothing. Use one of the following, read the help files to know the difference.
Code:
%n = $nick
var %n $nick
set %n $nick



Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: So simple, why doesn't it work? [Re: Nillen] #247077 20/07/14 06:13 PM
Joined: Jul 2014
Posts: 6
R
RichardC Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
Joined: Jul 2014
Posts: 6
Speedy answers!

Thanks again