mIRC Homepage
Posted By: RichardC So simple, why doesn't it work? - 20/07/14 04:25 PM
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.
Posted By: Nillen Re: So simple, why doesn't it work? - 20/07/14 04:34 PM
Add a space after the if.
Code:
if (%r == 5) { do stuff }
Posted By: Loki12583 Re: So simple, why doesn't it work? - 20/07/14 04:35 PM
You need a space after the "if". You probably have lots of errors in your status window.
Posted By: RichardC Re: So simple, why doesn't it work? - 20/07/14 04:51 PM
As simple as that?!

Thanks
Posted By: RichardC Re: So simple, why doesn't it work? - 20/07/14 05:31 PM
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?
Posted By: Nillen Re: So simple, why doesn't it work? - 20/07/14 05:49 PM
/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

Posted By: RichardC Re: So simple, why doesn't it work? - 20/07/14 06:13 PM
Speedy answers!

Thanks again
© mIRC Discussion Forums