Page 1 of 1

{cprintf}Symbols also

Posted: Fri May 23, 2014 9:03 am
by Lamkefyned
Hello, I want to put this picture in one of my userfunctions and work me for the symbols... I can put it in another way?

Code: Select all

 		function LTU_Loading()
			LTU_clear()
			cprintf(cli.lightblue," * ,------------------------------------------,      .    _  .")
			cprintf(cli.lightblue," * |  Lamkefyned Tools Version 2  !!!         |      |\_|/__/|")
			cprintf(cli.lightblue," * |------------------------------------------|     / / \/ \  \")
			cprintf(cli.lightblue," *                                           \     /__|O||O|__ \")
			cprintf(cli.lightblue," *                                             \  |/_ \_/\_/ _\ |")
			cprintf(cli.lightblue," *                                                | | (____) | ||")
			cprintf(cli.lightblue," *                                                \/\___/\__/  //")
			cprintf(cli.lightblue," *                                                (_/         ||")
			cprintf(cli.lightblue," *                                                 |          ||")
			cprintf(cli.lightblue," *                                                 |          ||\")
			cprintf(cli.lightblue," *                                                  \        //_/")
			cprintf(cli.lightblue," *                                                   \______//")
			cprintf(cli.lightblue," *                                                 __ || __||")
			cprintf(cli.lightblue," *                                                (____(____)")
			yrest(2000) 
			LTU_clear()
		end

Re: {cprintf}Symbols also

Posted: Fri May 23, 2014 9:07 am
by BlubBlab
You could put it in a file and load the file as strings

Re: {cprintf}Symbols also

Posted: Fri May 23, 2014 9:11 am
by Lamkefyned
And how to load an external file? but it would not be the same?

Re: {cprintf}Symbols also

Posted: Fri May 23, 2014 4:56 pm
by lisa
there is a few ways to do it, the easiest way though is to use what you have done but you need to add a little extra here and there.

Any time you have a \ you need to add another \ before it, so \ becomes \\

Also you will want to add \n at the very end so it starts a new line before printing the next line.

example

Code: Select all

cprintf(cli.lightblue," * |  Lamkefyned Tools Version 2  !!!         |      |\\_|/__/|\n")
Also if you want to make a better looking box you can use other characters, such as 186,187,188,200,201,205
Just hold alt and then press those numbers on numberpad.
alt + 186 is ║
alt + 187 is ╗
and so on.

Code: Select all

╔═════╗
║     ║
╚═════╝


Command> cprintf(cli.lightblue,"╔═════╗\n║     ║\n╚═════╝\n")
╔═════╗
║     ║
╚═════╝


Re: {cprintf}Symbols also

Posted: Fri May 23, 2014 8:58 pm
by rock5
If you want to make it easier to draw without the double slashes you could use double square brackets, eg.

Code: Select all

str=[[
		 |\_/|
		 (o|o)
		  \W/
		   ~
]]
print(str)
Double square brackets means everything between the square brackets is taken as a literal string. Even new lines are part of the string. There is no converting of special code such as \n. What you see is what you get.

Re: {cprintf}Symbols also

Posted: Sat May 24, 2014 4:07 am
by Lamkefyned
Thanks to all the problem already this arranged