mIRC Home    About    Download    Register    News    Help

Print Thread
elseif with variables #253526 18/06/15 10:22 PM
Joined: Mar 2015
Posts: 26
A
Anti Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Mar 2015
Posts: 26
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 ?

Re: elseif with variables [Re: Anti] #253528 18/06/15 10:40 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
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 }
}

Re: elseif with variables [Re: westor] #253529 18/06/15 10:56 PM
Joined: Mar 2015
Posts: 26
A
Anti Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Mar 2015
Posts: 26
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 ?

Re: elseif with variables [Re: Anti] #253531 18/06/15 10:57 PM
Joined: Mar 2015
Posts: 26
A
Anti Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Mar 2015
Posts: 26

I mean as numerated aswer as base, eventually with others
if nested

Re: elseif with variables [Re: Anti] #253532 18/06/15 10:59 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
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 }
}