mIRC Homepage
Posted By: Anti elseif with variables - 18/06/15 10:22 PM
on *:text:*:?: {
if (!$($+(%,private,$nick),2)) {
set $+(%,private,$nick) 1
timer 1 5 msg $nick hello
}
elseif (($($+(%,private,$nick),2)) == 1) {
set $+(%,private,$nick) 2
timer 1 15 msg $nick I'm busy, sorry
}
}


Why if the pvt msg continue this code repeat the last
elseif ?
Posted By: westor Re: elseif with variables - 18/06/15 10:40 PM
Try use this code:

Code:
ON *:TEXT:*:?: {
  if (!$($+(%,private,_,$nick),2)) { set $+(%,private,_,$nick) 1 | timer 1 5 msg $nick hello }
  else { set $+(%,private,_,$nick) 2 | timer 1 15 msg $nick I'm busy, sorry }
}
Posted By: Anti Re: elseif with variables - 18/06/15 10:56 PM
Originally Posted By: westor
Try use this code:

Code:
ON *:TEXT:*:?: {
  if (!$($+(%,private,_,$nick),2)) { set $+(%,private,_,$nick) 1 | timer 1 5 msg $nick hello }
  else { set $+(%,private,_,$nick) 2 | timer 1 15 msg $nick I'm busy, sorry }
}



Ok , but with else all finish , it's impossible insert
others answers.

If I could insert many choose with many elseif ?
Posted By: Anti Re: elseif with variables - 18/06/15 10:57 PM

I mean as numerated aswer as base, eventually with others
if nested
Posted By: westor Re: elseif with variables - 18/06/15 10:59 PM
Try this code:

Code:
ON *:TEXT:*:?: {
  if (!$($+(%,private,_,$nick),2)) { set $+(%,private,_,$nick) 1 | timer 1 5 msg $nick hello }
  elseif ($($+(%,private,_,$nick),2) == 1) { set $+(%,private,_,$nick) 2 | timer 1 15 msg $nick I'm busy, sorry }
  elseif ($($+(%,private,_,$nick),2) == 2) { set $+(%,private,_,$nick) 3 | timer 1 15 msg $nick I cannot contact you now, sorry }
  elseif ($($+(%,private,_,$nick),2) == 3) { set $+(%,private,_,$nick) 4 | timer 1 15 msg $nick I am on the sex mode now, sorry }
}
© mIRC Discussion Forums