mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2010
Posts: 5
S
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Aug 2010
Posts: 5
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

Joined: Jul 2006
Posts: 4,186
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,186
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


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Aug 2010
Posts: 5
S
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Aug 2010
Posts: 5
ahh! thanks a lot! that's perfect!

Joined: Dec 2002
Posts: 87
Babel fish
Offline
Babel fish
Joined: Dec 2002
Posts: 87
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

Last edited by Zmodem; 06/01/12 09:40 PM.

-Zmodem
Joined: Oct 2009
Posts: 24
Ameglian cow
Offline
Ameglian cow
Joined: Oct 2009
Posts: 24
I myself use $crlf in some $input 's and have never had to use the $+ to make it work.

Joined: Jul 2006
Posts: 4,186
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,186
You don't need $+ to make it working, but not using $+ will add spaces to the text and will make the window bigger


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard