mIRC Home    About    Download    Register    News    Help

Topic Options
#122213 - 07/06/05 08:36 PM short dialog ?
raZOR Offline
Hoopy frood

Registered: 06/04/05
Posts: 1009
Loc: Green Hill Zone
can mirc display and use some sort of short dialog
SIMMILIAR to $$?

but so i have some text written on it and it dont need
input but just has YES/OK and NO/CANCEL

so if OK is clicked: proceed with operation...

dunno if you understand...

or i need to use dedit to make this?
_________________________
IceCapped

Top
#122214 - 07/06/05 09:37 PM Re: short dialog ?
Mentality Offline
Planetary brain

Registered: 01/06/03
Posts: 5024
Loc: London, England
Use $input.

You need to put this in a /timer if you use it in a script. You can type the following from the editbox to see an example: /timer 1 0 echo -a $input(example,y,blah,blah,whatever)

See /help $input for other options you can choose by choosing different letters than 'y'.

Regards,
_________________________
Mentality/Chris

Top
#122215 - 07/06/05 09:53 PM Re: short dialog ?
raZOR Offline
Hoopy frood

Registered: 06/04/05
Posts: 1009
Loc: Green Hill Zone
but i cant make it execute a command if YES is clicked...
or can i?
_________________________
IceCapped

Top
#122216 - 07/06/05 11:06 PM Re: short dialog ?
Mpdreamz Offline
Hoopy frood

Registered: 27/04/04
Posts: 759
Loc: Arnhem, The Netherlands
v - return $ok, $yes, $no, $cancel for buttons.

By default, buttons return $true or $null, same as $?. If there is an input editbox, the ok/yes buttons always return the contents of the editbox.
/timer 1 0 echo -a $input(example,y,blah,blah,whatever)
so add v after where Mentality put y and make an iff statement
Code:
..
if ($input(example,vy,blah,blah,whatever) == $yes) {
 command
 }
 ..

if you asking for $input in an ON event use the timer
/timer 1 0 /askforinput
and make an alias of the above code name /askforinput, if you want it in an alias you dont need to do a timer.


Edited by Mpdreamz (08/06/05 12:08 AM)
_________________________
$maybe

Top
#122217 - 08/06/05 12:32 AM Re: short dialog ?
raZOR Offline
Hoopy frood

Registered: 06/04/05
Posts: 1009
Loc: Green Hill Zone
thanks alot smile
it works laugh

just 1 question

here
f ($input(example,vy,blah,blah,whatever) == $yes) {

what does last "blah" and "whatever" do if they have no function ?


Edited by raZOR (08/06/05 12:33 AM)
_________________________
IceCapped

Top
#122218 - 08/06/05 12:45 AM Re: short dialog ?
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
$input(window text,e,window topbar text,input field text,unknown field)

this differes from what the help file says, I dont think the last field does anything actually.

Top
#122219 - 08/06/05 12:51 AM Re: short dialog ?
raZOR Offline
Hoopy frood

Registered: 06/04/05
Posts: 1009
Loc: Green Hill Zone
lol
okay, thanks =)
_________________________
IceCapped

Top
#122220 - 08/06/05 01:38 AM Re: short dialog ?
raZOR Offline
Hoopy frood

Registered: 06/04/05
Posts: 1009
Loc: Green Hill Zone
yay, im sorry for bothering...

but here is stated
"code" = $yes { do things }

but how to make if pressed thing is NO to do things ?

is it possible ?

coz i have this:
Code:
 
alias something {
  if ($input (blabla,vy,Title,nothing,nothing_again) == $yes) {
    //set %Yes Yes
  }
  elseif ($input(blabla,vy,Title,nothing,nothing_again) == $no) {
    //set %No No
  }
}

 


but itz messy and when i call alias and answer NO i get this called again
_________________________
IceCapped

Top
#122221 - 08/06/05 03:17 AM Re: short dialog ?
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
multiple possable ways

Code:
 
alias something {
  var %answer = $input(blabla,vy,Title,nothing,nothing_again)
  if (%answer == $yes) {
    //set %Yes Yes
  }
  elseif (%answer == $no) {
    //set %No No
  }
}


or

Code:
 
alias something {
  if ($input(blabla,vy,Title,nothing,nothing_again) == $yes) {
    //set %Yes Yes
  }
  elseif ($v1 == $no) {
    //set %No No
  }
}


$v1 & $v2
Returns the first and second parameters of "THE LAST" if-then-else comparison. Also functional in $iif and /while conditions
Older versions of mirc have $ifmatch which is $v1



but itz messy and when i call alias and answer NO i get this called again [/quote]

Top
#122222 - 08/06/05 11:39 AM Re: short dialog ?
raZOR Offline
Hoopy frood

Registered: 06/04/05
Posts: 1009
Loc: Green Hill Zone
this works perfect laugh

but 1 more problem LOL

for this part:

elseif ($ifmatch == $no) {
//set %No No
.did -u chekbox 105
}

this with uncheking chekbox when pressed NO doesnt work... altho it should !

any ideas why it behaves like this ?
_________________________
IceCapped

Top
#122223 - 09/06/05 02:24 AM Re: short dialog ?
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
try this

elseif ($ifmatch == $no) {
echo -st ENTERED THE NO CODE
//set %No No
.did -u chekbox 105
}


does it display that message in status window when you do NO?
if so does .did -u chekbox 105 do what its ment to?


PS: "//set %No No" this doesnt need the // there obnly needed when typing commands from the mirc prompt "set %No No"

Top
#122224 - 09/06/05 01:35 PM Re: short dialog ?
raZOR Offline
Hoopy frood

Registered: 06/04/05
Posts: 1009
Loc: Green Hill Zone
nope, it doesnt echo nor i get uncheked chekbox.

maybe it dont work coz itz working on mirc 6.03 ?
_________________________
IceCapped

Top
#122225 - 09/06/05 02:51 PM Re: short dialog ?
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
might be a version problem, i doubt it tho. Check to see the ELSEIF is aligned {{{ }}} correctly to the IF. If that doesnt work try the var %answer = $input option i gave.

Top
#122226 - 09/06/05 04:26 PM Re: short dialog ?
raZOR Offline
Hoopy frood

Registered: 06/04/05
Posts: 1009
Loc: Green Hill Zone
that other solution with %anwer works laugh

thanks alot !

laugh:D:D:D:D

*me happy now*
_________________________
IceCapped

Top