Format description

Posted by Hadar on Sun 22 Jan 2017 06:19 AM — 5 posts, 18,475 views.

#0
I have been all over the place

Not exactly sure if possible without making a function then calling the function, but I was wondering if there was a way to "format" a description, i basically don't want my "help file" to be one color.

I am pretty sure ill have to do a function, just wanted to check before i set it up though
USA Global Moderator #1
More information needed. What description?
Amended on Sun 22 Jan 2017 12:34 PM by Fiendish
Australia Forum Administrator #2
Are you coding a MUD server? And you want the help files to be shown in various colours? Then embed colour codes inside the help. What is usually done in this case is to use easy-to-use sequences (eg. @R for bold red, and @r for dim red, @G for bold green, etc.) and then have the server do a find-and-replace to change them to ANSI colour sequences.
#3
was talking about this part in the code:


<description trim="y">
<![CDATA[
Just use the command predict to take a guess at the next hour of double
]]>
</description>


that way i can just call the function to display it, i ended up making a function:


function HadarHelp()
	ColourNote("#159FE5","","+---------------------------------","Green","","[","Cyan","","D","Teal","","ouble ","Cyan","","P","Teal","","redictor","Green","","]","#159FE5","","---------------------------------+")
	ColourNote("#159FE5","","|"..string.format("%84s"," ").."|")
	ColourNote("#159FE5","","|","#E55B15","",string.format("%-19s"," Predict <Channel>"),"#159FE5","","-","#F1D566","",string.format("%-64s"," Outputs an estimate to a channel when double might happen"),"#159FE5","","|")
	ColourNote("#159FE5","","|"..string.format("%84s"," ").."|")
	ColourNote("#159FE5","","+"..string.rep("-",84).."+")
end



I mean if there is an easier way, then ill do it, if not ill just add the function to all my scripts
Australia Forum Administrator #4
OK, that description is shown if you click on "Show Info" in the plugins list.

It is also echoed by the default alias made by the plugin wizard (for your "help" action).

For example:

function OnHelp ()
Note (GetPluginInfo (GetPluginID (), 3))
end

Plugin info 3 is the contents of that description box.


However you can of course make your own help action (like you have already) which shows lots of colours. I think some plugin writers do that already.