mIRC Home    About    Download    Register    News    Help

Print Thread
#260642 29/05/17 04:54 PM
Joined: Dec 2015
Posts: 14
S
shaf12 Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Dec 2015
Posts: 14
Code:
on *:TEXT:rdm:#: {
  if ($nick == bbb || $nick == aaa){
  msg # Your random number is $rand(70,100)
}
else{
msg # Your random number is $rand(1,100)
}
}




thx smile

Last edited by shaf12; 29/05/17 04:54 PM.
Joined: Feb 2011
Posts: 450
K
Pan-dimensional mouse
Offline
Pan-dimensional mouse
K
Joined: Feb 2011
Posts: 450
Code:
on *:TEXT:rdm:#: {
  if ($nick == bbb || $nick == aaa) {
    msg # Your random number is $rand(70,100)
  }
  else {
    msg # Your random number is $rand(1,100)
  }
}


The { } cannot touch anything.

https://en.wikichip.org/wiki/mirc/introduction#Wrong_Examples

In the scripting editor, you will see a little check mark at the top right side, click it and it will show { } mismatches.

You can also use mSLDev, http://www.msldev.com/ for helping with syntax issues.

Joined: Dec 2015
Posts: 14
S
shaf12 Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Dec 2015
Posts: 14
Fixed it but still not working...
Code:
on *:TEXT:!rdm:#: {
  if ($nick == bbb || $nick == aaa){
  msg # Your random number is $rand(70,100)
}
else{
msg # Your random number is $rand(1,100)}}


Last edited by shaf12; 30/05/17 06:13 AM.
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
He told you to not let the curly braces touch anything, but they're still touching. You're letting the pair of end-braces on the last line not only touch each other, but also touch the parenthesis in front of them. You're also letting a brace touch the "else" and the parenthesis next to the aaa.

In fact, the 1 case where it's permitted to touch something is the colon on the 1st line, and that's the only case where you don't have the braces improperly touching something else on that line.


Link Copied to Clipboard