mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2006
Posts: 2
S
SimonB Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
S
Joined: Jan 2006
Posts: 2
It's broke, I'm hoping you tell why. Thank you.


Code:
 on *:action:slaps*:#: {
var %ugs = $rand(1,3)
  if ($2 == $me) && (%ugs == 1){
    /describe $chan slaps $nick with 1111111s
  }
  
    elseif ($2 == $me) && (%ugs == 2){
      /describe $chan slaps $nick with 22222222s
  }
    elseif ($2 == $me) && (%ugs == 3){
      /describe $chan slaps $nick with 333333333s
  }
  else return
} 

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
on *:action:slaps*:#: {
var %ugs = $rand(1,3)
if ($2 == $me) {
if (%ugs == 1) { describe $chan slaps $nick with 1111111s }
if (%ugs == 2) { describe $chan slaps $nick with 22222222s }
if (%ugs == 3) { describe $chan slaps $nick with 333333333s }
}
}

Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
From your original code, you need a space between the ) and { . It would also help to include parenthesis around both conditions.

Joined: Jan 2006
Posts: 2
S
SimonB Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
S
Joined: Jan 2006
Posts: 2
Thank you for help Mike Chat, your modifications worked beautifully. If it's not much trouble I still do not understand why my original code broke, could someone explain to me.

Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
It's already been explained. See my previous post.

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Code:
on *:action:slaps*:#:{
  if ($2 != $me) return
  var %ugs = $rand(1,3)
  describe $chan slaps $nick with $str(%ugs,$calc(6 + %ugs)) $+ s
}


Link Copied to Clipboard