mIRC Home    About    Download    Register    News    Help

Print Thread
#182534 10/08/07 09:54 PM
Joined: Jun 2007
Posts: 157
W
Vogon poet
OP Offline
Vogon poet
W
Joined: Jun 2007
Posts: 157
i need someone to bit help me with this command since it is
poorely described in help...

id like to know (since i work with dialogs)
how to invoke input dialog that gives YES and NO button
and if i click YES that script goes in one subroutine and if i click NO that script goes to another subroutine (and not just to halt the operation)


The harder I chase my dreams the more I experience the time for smiles and tears...
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Code:
//echo -a $iif($$input(...,y,...) == $true,Yes,No)

SladeKraven #182539 10/08/07 10:17 PM
Joined: Jun 2007
Posts: 157
W
Vogon poet
OP Offline
Vogon poet
W
Joined: Jun 2007
Posts: 157
so if i am to do dialog operations then i would do like this?

Code:
//echo -a $iif($$input(...,y,...) == $true,did -a $dname ID Yes, did -a $dname ID No)


The harder I chase my dreams the more I experience the time for smiles and tears...
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Well, it makes no sense having two /did commands, just have one and use $iif to return Yes or No.

Code:
did -a $dname ID $iif($$input(...,y,...) == $true,Yes,No)

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Code:
did -a $dname ID $iif($input(...,y,...) == $true,Yes,No)
Note that there is always the "close box" returning $false

Horstl #182544 10/08/07 10:42 PM
Joined: Jun 2007
Posts: 157
W
Vogon poet
OP Offline
Vogon poet
W
Joined: Jun 2007
Posts: 157
now i dont understand nothing :P

i wanted to know if $input can do this:

if pressed YES go some shit
if pressed NO do another shit

:P

but not that it only works for YES and stops for NO


The harder I chase my dreams the more I experience the time for smiles and tears...
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Code:
var %input = $$input(...,y,...)
if (%input == $true) { do yes stuff }
else { do no/cancel stuff }

or
Code:
$iif(($$input(...,y,...) == $true),do yes stuff,do no/cancel stuff)


If your subroutines are comprehensive, use for example
- the %var thing (store the decision for later reference)
- use goto
- trigger separate aliases (like the $iif thing)

Last edited by Horstl; 10/08/07 10:56 PM.
Horstl #182547 10/08/07 11:07 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Or $!. smile

Code:
  noop $$input(...,y,...)
  if ($!) { echo -a Yes }
  else { echo -a No }

Horstl #182550 11/08/07 12:00 AM
Joined: Jun 2007
Posts: 157
W
Vogon poet
OP Offline
Vogon poet
W
Joined: Jun 2007
Posts: 157
sweet, thanks all smile


The harder I chase my dreams the more I experience the time for smiles and tears...
SladeKraven #182578 11/08/07 12:10 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Originally Posted By: SladeKraven
Code:
//echo -a $iif($$input(...,y,...) == $true,Yes,No)


In case you're interested, another way of doing this would be to use the 'v' flag and $mid:

Code:
//echo -a $mid($input(...,yv,...),2)


'v' makes the input dialog return $yes or $no

hixxy #182605 11/08/07 06:35 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
True, I forgot about that.


Link Copied to Clipboard