mIRC Home    About    Download    Register    News    Help

Print Thread
yes / no dialog #133320 18/10/05 11:52 PM
Joined: Oct 2005
Posts: 18
L
latumus Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Oct 2005
Posts: 18
previous post

in the post above is my code i'm looking for the way to make my action wait for a yes / no dialog input

so what i want to happen is, if the script is triggered
it has to open a dialog box asking me if i want to act upon $9 or whatever with 2 options yes/no where no == halt

--edit--

oh and it has to remove the yes/no dialog box after like 30 seconds of no reaction so i dont wake up to 3843743 dialog boxes wink

Last edited by latumus; 18/10/05 11:53 PM.
Re: yes / no dialog #133321 19/10/05 06:57 AM
Joined: Feb 2005
Posts: 342
R
Rand Offline
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
Well, I'm not sure what your /action, thing does.

But here is a semi-work around,

instead of doing whatever you do, in the alias action { }

Try using a /signal instead.

else { signal action # $nick %text }

....

Then you can use something like:

Code:
on *:signal:action: {
  var %input = $$input(Perform action?,y) , %chan = $1 , %nick = $2 , %text = $3-
  if (%input) { 
  ; do action here
  }
}


This doesn't solve how to make the box disappear. I'm not *entirely* sure if there's a builtin way to make the input box choose "no" after 30 seconds.

So you might actually have to make your own dialog, and use a timer to close it.

Re: yes / no dialog #133322 19/10/05 09:10 AM
Joined: Apr 2003
Posts: 701
K
Kelder Offline
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
To close the box after 10 seconds. Best is ofcourse to include some check to verify the user hasn't clicked yet. Probably set a %variable after the $input and check for it's presence, since $active doesn't work...
//timer 1 10 sendkeys n | echo -s $input(Perform action?,y)


I didn't write this piece of magic, qwerty did apparently http://www.mircscripts.org/comments.php?cid=1581

Code:
alias sendkeys {
  var %a = sendkeys $+ $ticks 
  .comopen %a WScript.Shell 
  if !$comerr { .comclose %a $com(%a,SendKeys,3,bstr,$1-) }
}


ps: this older thread asks for something similar

Re: yes / no dialog #133323 19/10/05 09:47 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Good move good move.

however rather than setting a var, would this work

//timer.autoinput 1 10 sendkeys n | echo -s $input(Perform action?,y) | timer.autoinput off

Re: yes / no dialog #133324 21/10/05 09:14 AM
Joined: Apr 2003
Posts: 701
K
Kelder Offline
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
Seems the better option indeed, let's say I like to overlook obvious solutions smile

For the production version I'd also advise some dots do silence the timer output...