mIRC Home    About    Download    Register    News    Help

Print Thread
#122213 07/06/05 07:36 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
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
#122214 07/06/05 08:37 PM
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
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
#122215 07/06/05 08:53 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
but i cant make it execute a command if YES is clicked...
or can i?


IceCapped
#122216 07/06/05 10:06 PM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
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.

Last edited by Mpdreamz; 07/06/05 11:08 PM.

$maybe
#122217 07/06/05 11:32 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
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 ?

Last edited by raZOR; 07/06/05 11:33 PM.

IceCapped
#122218 07/06/05 11:45 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
$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.

#122219 07/06/05 11:51 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
lol
okay, thanks =)


IceCapped
#122220 08/06/05 12:38 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
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
#122221 08/06/05 02:17 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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]

#122222 08/06/05 10:39 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
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
#122223 09/06/05 01:24 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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"

#122224 09/06/05 12:35 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
nope, it doesnt echo nor i get uncheked chekbox.

maybe it dont work coz itz working on mirc 6.03 ?


IceCapped
#122225 09/06/05 01:51 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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.

#122226 09/06/05 03:26 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
that other solution with %anwer works laugh

thanks alot !

laugh:D:D:D:D

*me happy now*


IceCapped

Link Copied to Clipboard