mIRC Home    About    Download    Register    News    Help

Print Thread
#196952 26/03/08 11:52 AM
Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
Quote:
.Remove User:if ($1 == $me) && ($?!="Remove yourself from # $+ ?") { .msg q removeuser # $1 }


How to get this to halt if I press NO, and continue if YES. And if not me, then also continue?

Thanks.

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Im a little confused here. But im sure I get it

!= means isnot

.Remove User:if ($input(Remove User From Channel?,y) == $true) && ($$1 != $me) { .msg q removeuser # $$1 }


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
this is a example:
if $nick == $me && (dialog yes) { delete }
if $nick != $me { delete }

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Why not simply
Code:
.Remove User:if ($1 == $me) && ($?!="Remove yourself from # $+ ?" == $true) { .msg q removeuser # $1 }

?
Since in that kind of dialog pressing Yes will return $true and pressing no returns $false.

Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
do I need do add else { delete } to get others than myself to be deletet without the dialog?

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
In response to your latest question:
Originally Posted By: Deep3D
this is a example:
if $nick == $me && (dialog yes) { delete }
if $nick != $me { delete }

Just add
Code:
else { .msg q removeuser # $$1 }

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Code:
.Remove User:if ($1 != $me) || ($?!="Remove yourself from # $+ ?") { .msg q removeuser # $1 }

Note that the order of checks matters, due to the short-circuiting behaviour of || (if the first condition is true, || skips the second, so it won't evaluate $?! and open the dialog).


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
That works nicely, but don't forget that the dialog will always return a value, so you still need to match it to $true. :P

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Not really.
if (something)
means
if (something != $false && something != $null && something != 0)


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
I stand corrected. xD


Link Copied to Clipboard