mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2003
Posts: 27
Z
zorin Offline OP
Ameglian cow
OP Offline
Ameglian cow
Z
Joined: Mar 2003
Posts: 27
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 }

Joined: Mar 2003
Posts: 612
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
if $input(Prompt,y) var %1 yes


billythekid
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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


Invision Support
#Invision on irc.irchighway.net
Joined: Mar 2003
Posts: 27
Z
zorin Offline OP
Ameglian cow
OP Offline
Ameglian cow
Z
Joined: Mar 2003
Posts: 27
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

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
/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.


Invision Support
#Invision on irc.irchighway.net
Joined: Mar 2003
Posts: 612
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
(four characters shorter to use $?!="Prompt" rather than $input(Prompt,y) wink :

LMAO!


billythekid
Joined: Mar 2003
Posts: 612
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
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


billythekid
Joined: Mar 2003
Posts: 27
Z
zorin Offline OP
Ameglian cow
OP Offline
Ameglian cow
Z
Joined: Mar 2003
Posts: 27
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

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard