YesNoOk
avatar

DisplayToClipboard and AppendToClipboard (SCTRL) (Read 9673 times)

Started by JustNoPoint, October 22, 2015, 11:50:41 pm
Share this topic:
DisplayToClipboard and AppendToClipboard (SCTRL)
New #1  October 22, 2015, 11:50:41 pm
  • ******
    • www.justnopoint.com/
DisplayToClipboard
This controller is only useful for debugging. DisplayToClipboard clears the player clipboard and prints a specified message to it. Display of the player clipboards is enabled in debug mode (press Ctrl+D).

AppendToClipboard
This is the same as DisplayToClipboard, except that message text is added on a new line, instead of overwriting whatever text is already on the clipboard.

Format:
1.) DisplayToClipboard
2.) AppendToClipboard

Required parameters:
text = "format_string"
format_string must be encased in double-quotes. It is a printf format string, so if you know about printf, you can skip this description. The format string contains any text you wish to display. You can also use \n to generate a line break, and \t to generate a tab character (tab width is equivalent to 4 characters). To display the value of an arithmetic expression, you can put a %d (for ints) or a %f (for floats) in the format string, then specify the expression in the params list. To display a % character, you must put %% in the format string.

Only signed integer and floating-point format specifiers are accepted: %d, %i, %f, %F, %e, %E, %g, or %G. Length-modified format specifiers (e.g., %lld) are not supported. Recognized escape sequences are \n, \t, \\, and \".

Optional parameters:
params = exp_1, exp_2, exp_3, exp_4, exp_5, exp_6
Up to 6 numeric arguments can be specified in the format string. These should be listed under the params item, in order. The type of each parameter must match its format specifier. You cannot specify more or less parameters than are called for in the format string.

If there is a type mismatch between the format specifier and the parameter actually provided, then the actual value of the parameter will be shown in an appropriate form for that type, using default formatting options.

Example:

Code:
type = DisplayToClipboard
text="The value of var(17) is %d, which is %f%% of 23.\n\t--Kiwi."
params = var(17):=1,var(17)/.230

displays the following to the player clipboard:

The value of var(17) is 1, which is 4.347826% of 23.
    --Kiwi.
Last Edit: October 26, 2018, 10:37:52 pm by Odb718
Re: DisplayToClipboard and AppendToClipboard (SCTRL)
#2  October 23, 2015, 02:28:25 pm
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
Mugen 1.0 accepts up to 6 arguments, where as winmugen and earlier builds will only accept 5, giving a compatibility error if 6 arguments are passed
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!