mIRC Home    About    Download    Register    News    Help

Print Thread
#149246 15/05/06 04:33 PM
Joined: Apr 2003
Posts: 24
S
Ameglian cow
OP Offline
Ameglian cow
S
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.

#149247 15/05/06 05:16 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
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
}

#149248 15/05/06 11:03 PM
Joined: Apr 2003
Posts: 24
S
Ameglian cow
OP Offline
Ameglian cow
S
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.

#149249 16/05/06 04:13 AM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Quote:
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
}

#149250 16/05/06 04:23 AM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
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

#149251 16/05/06 05:37 AM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
thanks

#149252 16/05/06 06:50 AM
Joined: Apr 2003
Posts: 24
S
Ameglian cow
OP Offline
Ameglian cow
S
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 smile

Last edited by ShavedApe; 16/05/06 06:51 AM.
#149253 16/05/06 06:58 AM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Here's an example:

Code:
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

#149254 16/05/06 08:07 AM
Joined: Apr 2003
Posts: 24
S
Ameglian cow
OP Offline
Ameglian cow
S
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.

#149255 16/05/06 08:08 AM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Code:
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)

#149256 16/05/06 01:02 PM
Joined: Apr 2003
Posts: 24
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Apr 2003
Posts: 24
Yep thanks that works great smile
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.
#149257 16/05/06 01:36 PM
Joined: Apr 2003
Posts: 24
S
Ameglian cow
OP Offline
Ameglian cow
S
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.
#149258 16/05/06 03:42 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Quote:
Code:
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

#149259 16/05/06 04:32 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
-c closes the dialog and still triggers the close event, which is what we want...


Link Copied to Clipboard