mIRC Homepage
Posted By: raZOR short dialog ? - 07/06/05 07:36 PM
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?
Posted By: Mentality Re: short dialog ? - 07/06/05 08:37 PM
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,
Posted By: raZOR Re: short dialog ? - 07/06/05 08:53 PM
but i cant make it execute a command if YES is clicked...
or can i?
Posted By: Mpdreamz Re: short dialog ? - 07/06/05 10:06 PM
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.
Posted By: raZOR Re: short dialog ? - 07/06/05 11:32 PM
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 ?
Posted By: DaveC Re: short dialog ? - 07/06/05 11:45 PM
$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.
Posted By: raZOR Re: short dialog ? - 07/06/05 11:51 PM
lol
okay, thanks =)
Posted By: raZOR Re: short dialog ? - 08/06/05 12:38 AM
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
Posted By: DaveC Re: short dialog ? - 08/06/05 02:17 AM
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]
Posted By: raZOR Re: short dialog ? - 08/06/05 10:39 AM
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 ?
Posted By: DaveC Re: short dialog ? - 09/06/05 01:24 AM
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"
Posted By: raZOR Re: short dialog ? - 09/06/05 12:35 PM
nope, it doesnt echo nor i get uncheked chekbox.

maybe it dont work coz itz working on mirc 6.03 ?
Posted By: DaveC Re: short dialog ? - 09/06/05 01:51 PM
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.
Posted By: raZOR Re: short dialog ? - 09/06/05 03:26 PM
that other solution with %anwer works laugh

thanks alot !

laugh:D:D:D:D

*me happy now*
© mIRC Discussion Forums