mIRC Homepage
Posted By: Szantovitch Looking for a little help with $?="" - 24/12/11 02:22 AM
hey guys, been using this forum for a long time to find quick answers to basic scripting, so to you regulars, thanks!

i'm not exactly sure what i should be asking here, so i'll try to describe the simple desired effect if possible.

i'd like to know if there's the possibility for a very simple linebreak in the dialog boxes created by doing something like this:
Code:
Submenu
.Submenu Option:{
  /set %thingy $?="This is a definition within this box with a lot of different things notated to choose from. Option 1 blahblahblah blah, type +1, Option 2 blahblahblahblah, type -2, Option 3 blahblahblah, type -3."
}

obviously i left out the important parts there, but it shows the problem with a lot of text in $?=.

mostly I've been looking for a long time if there was a way to output the text shown in the ?$= created box with linebreaks if necessary which would show a lot more closer to this when it pops up to request user input:
Quote:
This is a definition within this box with a lot of different things notated to choose from.
- Option 1 blahblahblah blah, type +1.
- Option 2 blahblahblahblah, type -2.
- Option 3 blahblahblah, type -3.


preemptively thanks for the replies, enjoy your holidays!

-christine
Posted By: Wims Re: Looking for a little help with $?="" - 24/12/11 02:30 AM
You have to use $crlf to indicate a newline, you should also use $input which is safer:
Code:
Submenu
.Submenu Option:{
  set %thingy $input($+(This is a definition within this box with a lot of different things notated to choose from.,$crlf,Option 1 blahblahblah $+ $chr(44) blah type +1,$crlf,Option 2 blahblahblahblah type -2,$crlf,Option 3 blahblahblah type -3.),e)
}
Note that commas seperate parameters so you cannot use them as text, you need to use $chr(44) with $+ like I showed for the first option
Posted By: Szantovitch Re: Looking for a little help with $?="" - 24/12/11 02:56 AM
ahh! thanks a lot! that's perfect!
Posted By: Zmodem Re: Looking for a little help with $?="" - 06/01/12 09:38 PM
A little late in the game to answer this, but thought I'd toss in my suggestion as well:

Quote:
Submenu
.Submenu Option: {
var %c = $crlf $+ $crlf | set %thingy $input(This is a definition within this box with a lot of different things notated to choose from. Here are your options: $+ %c $+ Option 1 (Blah blah) type +1 $+ %c $+ Option 2 (blahblah) type -2 $+ %c $+ Option 3 (blahblah) type -3,ieo,Select Option)
}


The "%c" variable is not really important, all I did was make a local (temporary) variable using the 'var' command and it contained the $crlf command. It isn't really a necessary step, but it makes the parsing of a script execute quicker and there is less repetitiveness in the code.

Next up, as was previously suggested, I used the '$input()' identifier to make a much more professional-feeling input box, rather than the $?="", which I'm not even sure why it still exists. $input() carries with it a whole load of options, including: having a title for your input prompt, a much more flexible description screen, options to change the alert icon (warning, info, critical warning and so on), and you can choose what you want included, such as ok/yes/no/cancel buttons and input/password-input edit boxes.

For more help on this command, go into mIRC and type: /help $input. Good luck! smile
Posted By: Scakk Re: Looking for a little help with $?="" - 07/01/12 06:30 AM
I myself use $crlf in some $input 's and have never had to use the $+ to make it work.
Posted By: Wims Re: Looking for a little help with $?="" - 07/01/12 05:14 PM
You don't need $+ to make it working, but not using $+ will add spaces to the text and will make the window bigger
© mIRC Discussion Forums