mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2014
Posts: 6
R
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.

Joined: Dec 2013
Posts: 779
N
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
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
You need a space after the "if". You probably have lots of errors in your status window.

Joined: Jul 2014
Posts: 6
R
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
Joined: Jul 2014
Posts: 6
As simple as that?!

Thanks

Joined: Jul 2014
Posts: 6
R
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?

Joined: Dec 2013
Posts: 779
N
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
Joined: Jul 2014
Posts: 6
R
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
Joined: Jul 2014
Posts: 6
Speedy answers!

Thanks again


Link Copied to Clipboard