mIRC Homepage
Posted By: zorin Need some help with menu channel - 02/11/06 09:57 PM
Hi smile

I want a window to popup with the option to choose between a few options, like yes or no. And the result should be able to be saved in a var

Something like this :P

menu channel {
TESTING
.Make a test : {
if ( yes is pressed ) { var %1 yes }
Posted By: billythekid Re: Need some help with menu channel - 02/11/06 10:00 PM
if $input(Prompt,y) var %1 yes
Posted By: Riamus2 Re: Need some help with menu channel - 02/11/06 10:46 PM
If it's just a Yes/No thing, then this would also work (four characters shorter to use $?!="Prompt" rather than $input(Prompt,y) wink :
Code:
var %continue = $?!="Do you want to continue?"


Feel free to change the question and the variable name.

NOTE: The variable will be filled with $true or $false based on the answer.

Or, to format it like btk did, so that you have a "yes" instead of $true (though nothing if it's false):

Code:
if $?!="Prompt" var %1 yes


Granted, I usually put ()'s on there and usually include = with /var. laugh
Posted By: zorin Re: Need some help with menu channel - 03/11/06 08:38 AM
Nice, tnx smile

And if I want to have other options to choose from instead of just yes or no. Like.. a button with the options to click on, let's say: "Monday" or "Tuesday" or "Wednesday" and when one of them is clicked a variable is set. Guess I have to use a dialog some way, if someone can point me in the right direction smile
Posted By: Riamus2 Re: Need some help with menu channel - 03/11/06 02:11 PM
/help dialogs

Start there and see what you come up with. Once you have it started and run into trouble, paste what you've come up with and we'll help you get it sorted out. Dialogs aren't too difficult... they are just time consuming if you need them to do a lot of things.
Posted By: billythekid Re: Need some help with menu channel - 03/11/06 04:20 PM
(four characters shorter to use $?!="Prompt" rather than $input(Prompt,y) wink :

LMAO!
Posted By: billythekid Re: Need some help with menu channel - 03/11/06 04:23 PM
here's a quick starter I made up to give you a flavour of a simple dialog

Code:
dialog dotw {
  title "Days"
  size -1 -1 61 125
  option dbu
  button "Sunday", 1, 10 10 37 12
  button "Monday", 2, 10 25 37 12
  button "Tuesday", 3, 10 40 37 12 
  button "Wednesday", 4, 10 55 37 12
  button "Thursday", 5, 10 70 37 12
  button "Friday", 6, 10 85 37 12
  button "Saturday", 7, 10 100 37 12
}

menu status { 
  days of the week:$dialog(dotw,dotw,-3)
}

on *:dialog:dotw:sclick:*:{
; fill your variable
  var %i $did($did)
; Do stuff with the variable
  echo %i
; close the dialog
  dialog -x dotw
}


btk
Posted By: zorin Re: Need some help with menu channel - 03/11/06 07:50 PM
Tnx again smile Basicly learned it by reading the help file blush (And use some of ur examples btk smile )

Also.. if anyone is very bored smile Looking for a script that will cut a string of words into fewer lines, with fewer words on each line. With no more then 62 letters pr. line
I was playing around with $gettok(%text,1-12,32) then count the numbers in that string and if its too much, do the same again with one fewer word. But its a nightmare :P
Posted By: Riamus2 Re: Need some help with menu channel - 03/11/06 08:24 PM
I wrote a Cut Script for someone that would do what you need. Here is the thread from this forum. At the end, there is a link to my script page that includes the full version of it. The script displayed on the forum here isn't the final version.
© mIRC Discussion Forums