|
Joined: Apr 2003
Posts: 24
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2003
Posts: 24 |
I have a pop up box that id like to have auto close after x ammount of time. Basically it waits for a response from me a yes or no option and id like it to take the no option after x ammount of time if no response from me. I am not very good with dialog boxes and am amazed i got this far so would be gratefull if anyone could point me in the right direction.
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
depending what you want exactly this will time out in 5 seconds click yes it will echo $true click no it will echo $false let it time out it will echo $false alias testinput { var %input = $input(This is a test,yk5) echo -a %input }
This works the same but true and false are changed to yes no alias testinput2 { var %input = $input(This is a test,yk5) if (%input == $true) { %input = yes } if (%input == $false) { %input = no } echo -a %input }
|
|
|
|
Joined: Apr 2003
Posts: 24
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2003
Posts: 24 |
im not entirely sure how to use the above
I have a dialog box open waiting for me to respond to it and I want ti to auto close if i dont click yes or no myself after a set ammount of time.
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
im not entirely sure how to use the above
I have a dialog box open waiting for me to respond to it and I want ti to auto close if i dont click yes or no myself after a set ammount of time. put this into a remote file, it is a sample only alias testinput { var %input = $input(This is a test,yk5) echo -a %input } type /testinput if you do not click on yes or no, it will close in five seconds $input( This is a test, yk5) the red is text you type in the blue is a button option (in this case yes or no) the green part forces it to close after 5 seconds (you set the time yourself) this will echo the value $true if you click yes it will echo $false if you do not click anything and it times out it will echo $false if you click no type /help $input for more information This works the same but true and false are changed to yes no alias testinput2 { var %input = $input(This is a test,yk5) if (%input == $true) { %input = yes } if (%input == $false) { %input = no } echo -a %input }
|
|
|
|
Joined: Oct 2005
Posts: 1,741
Hoopy frood
|
Hoopy frood
Joined: Oct 2005
Posts: 1,741 |
Note that the 'kn' switch in the $input identifier was added in mIRC version 6.17, so it won't work in earlier versions.
-genius_at_work
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
|
|
|
|
Joined: Apr 2003
Posts: 24
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2003
Posts: 24 |
Ok thank you for the explanation on how it works but im still not sure its what im looking to do. I have a dialog box ive created using certain parameters the dialog box is editable but already contains text there are is more than one editable box it then asks me a yes or no and i want it to auto close if i dont repond. From what I can see $input is fine if all i want is yes or no or a single inout text but my dialog box has more information that i want to use. Im using dialog -tmdov %diname secure There is editable information in it and i want to be able to use on *:dialog:*:edit:*:{ etc I appreciate your answers btw and thank you for taking the time to answer just unfortunatly not what im looking for though i have learned something anyway 
Last edited by ShavedApe; 16/05/06 06:51 AM.
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
Here's an example: dialog input {
title "Test"
size -1 -1 116 39
option dbu
edit "", 1, 0 0 116 10, result
button "Yes", 2, 1 26 37 12, ok
button "No", 3, 40 26 37 12, cancel
button "Maybe", 4, 79 26 37 12
}
on *:dialog:input:init:*: .timer 1 5 if ($dialog($dname)) dialog -c $dname
on *:dialog:input:sclick:4: noop $input(Maybe what?!,doq,Eh?!)
alias test echo -a $dialog(input,input) /test
|
|
|
|
Joined: Apr 2003
Posts: 24
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2003
Posts: 24 |
The above doesnt work unfortunately though it is more along the lines of what i want.
It doesnt auto close though for some reason that bit doesnt work.
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
dialog input {
title "Test"
size -1 -1 116 39
option dbu
edit "", 1, 0 0 116 10, result
button "Yes", 2, 1 26 37 12, ok
button "No", 3, 40 26 37 12, cancel
button "Maybe", 4, 79 26 37 12
}
on *:dialog:input:close:*: .timerinput off
on *:dialog:input:init:*: .timerinput 1 2 dialog -c $dname
on *:dialog:input:sclick:4: noop $input(Maybe what?!,doq,Eh?!)
alias test echo -a $dialog(input,input)
|
|
|
|
Joined: Apr 2003
Posts: 24
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2003
Posts: 24 |
Yep thanks that works great  Or at least it does in the above script still cant get it to work with mine though atm.
Last edited by ShavedApe; 16/05/06 01:28 PM.
|
|
|
|
Joined: Apr 2003
Posts: 24
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2003
Posts: 24 |
Ok now I think I got it to work many thanks for your patience and help
Last edited by ShavedApe; 16/05/06 01:53 PM.
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
dialog input {
title "Test"
size -1 -1 116 39
option dbu
edit "", 1, 0 0 116 10, result
button "Yes", 2, 1 26 37 12, ok
button "No", 3, 40 26 37 12, cancel
button "Maybe", 4, 79 26 37 12
}
on *:dialog:input:close:*: .timerinput off
on *:dialog:input:init:*: .timerinput 1 2 dialog [color:red]-x[/color] $dname
on *:dialog:input:sclick:4: noop $input(Maybe what?!,doq,Eh?!)
alias test echo -a $dialog(input,input) -x close a dialog without triggering any events I think -c is for @windows
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
-c closes the dialog and still triggers the close event, which is what we want...
|
|
|
|
|