How to output (rainbow) colored text? - Printable Version +- Xonotic Forums (https://forums.xonotic.org) +-- Forum: Support (https://forums.xonotic.org/forumdisplay.php?fid=3) +--- Forum: Xonotic - Configuration Tips (https://forums.xonotic.org/forumdisplay.php?fid=19) +--- Thread: How to output (rainbow) colored text? (/showthread.php?tid=2438) Pages:
1
2
|
How to output (rainbow) colored text? - Lento - 12-15-2011 Hello, I wondered which category is better to post, general or here but I post here. I sometimes see the players who type rainbow colored text(chat). So I asked him how to do that, and told me he uses perl(or PHP? I don't remember exactly) script to do that. I searched about it on Google and found something which might be related: http://www.krazydad.com/makecolors.php http://hg.gewt.net/irssi-config/file/dc0ae3a6bf52/scripts/rainbow.pl but still I can't solve... Does anyone know how to output rainbow colored text(references or the way to do)? Thanks. RE: How to output (rainbow) colored text? - Lord Canistra - 12-15-2011 They be trollin. It's voodoo magic and custom engine builds. RE: How to output (rainbow) colored text? - rocknroll237 - 12-15-2011 Instructions are here. No no no. Nothing there to see... (I don't remember typing this) RE: How to output (rainbow) colored text? - Spaceman - 12-15-2011 Nexuiz used to have a client command that gave you either 'pirate' or rainbow text. I don't know if the same function still exists in Xonotic or if the function uses the same passphrase. Sadly I'm not at liberty to divulge the Nexuiz phrases. The basic command was PHP Code: cl_cmd FOO say Hello world PHP Code: alias rainbow "cl_cmd FOO say $*" PHP Code: rainbow Hello world You need to replace FOO and BAR with the correct codes. Peace my Brothers RE: How to output (rainbow) colored text? - divVerent - 12-15-2011 I am using this: Code: alias spam "menu_cmd curl --exec --key 0 http://rm.sudo.rm-f.org/~xonotic/spam/spam.php cmd \"$1\" text \"${2- q}\"" However, without having the right player ID, you won't have a chance to get a reply from that script. The rainbow coloring itself is: Code: function rainbow($s) The rest is for you to piece together on your own or, better, write your own text transform for even more fun. RE: How to output (rainbow) colored text? - PinkRobot - 12-16-2011 Hehe, kudos on posting that div. Mine does not work anymore by the way, but maybe I should write my own script for it. RE: How to output (rainbow) colored text? - Lento - 12-16-2011 >Lord Canistra Haha, btw i like 猫耳, too XD http://safebooru.org//samples/407/sample_c4a5d7bfe083fed62cd2315bedbf625fbc5dbf79.jpg?407097 >rocknroll237 Oh, you got the wrong PICTURE. I wanna write rainbow colored TEXT lol >Spaceman Unfortunately, I couldn't find command for what I wanna do instead of FOO and BAR. But I could learn more about commands and coud find some useful links by your help. Thank you >divVarent Thank you again for giving useful example! I'll try it(and try to fix a little)! I didn't know Xonotic(and Nexuiz) can load not only cfg file but PHP scripts. And I want to ask you is there any website for reference of these commands(explain options like --exec, --key or other commands)? I can see some of commands' explanation on OUNS website but not so many. I'd like to know more about these. >PinkRobot Tell me if you could write any useful code RE: How to output (rainbow) colored text? - divVerent - 12-16-2011 Well, Xonotic can't load PHP scripts, but it can use web servers. And you can put anything you want on a web server... RE: How to output (rainbow) colored text? - divVerent - 12-16-2011 (12-16-2011, 06:50 AM)PinkRobot Wrote: Hehe, kudos on posting that div. Mine does not work anymore by the way, but maybe I should write my own script for it. All I need is your player ID. If you use a current Xonotic build, just send me your key_0-public-fp.txt file that's in your xonotic configuration directory (one directory upwards from config.cfg). If you have an older build, just give me a qconsole.log, it contains it too. RE: How to output (rainbow) colored text? - Lento - 12-16-2011 I couldn't find key_0-public-fp.txt or qconsole.log anywhere. But if I run above PHP code on my local server, it is okay, right? However, I tried to run it and I got some troubles.(correct PHP scripts could run on my local machine)
This PHP script seems to work from my eyes. I guess arguments are not passed or received well in alias command. hmm, but I tried http://rm.sudo.rm-f.org/~xonotic/spam/spam.php without my ID, of course I couldn't get colored text but error message output as "say" command. Currently my environment doesn't output even as "say" command(I mean, displayed error message only in console)... I have no idea now... If possible, I could do this thing on my local server or local machine. Could you tell me a little more advices? Regards RE: How to output (rainbow) colored text? - divVerent - 12-17-2011 That code was just a PHP function - you still need to call it. The code is supposed to print the console commands to run. It gets input from $_POST['cmd'] and $_POST['text']. RE: How to output (rainbow) colored text? - Lento - 12-18-2011 Thank you for you advice again. I've not understood it completely, but I searched and learned about PHP, and I made it somehow... I will modify my coloring code then XD Thank you for helping! RE: How to output (rainbow) colored text? - Mepper - 12-18-2011 You are lucky to do that so easy, Lento. I knew a few guys in Nexuiz who rewrote the whole engine to be able to do this RE: How to output (rainbow) colored text? - Lento - 12-18-2011 (12-18-2011, 09:04 AM)Mepper Wrote: You are lucky to do that so easy, Lento. wow really? yeah I'm so lucky This method might be able to apply for other things! RE: How to output (rainbow) colored text? - Lento - 12-18-2011 OH YEAH!! RE: How to output (rainbow) colored text? - Mepper - 12-18-2011 I first was like: "OMFG I WANT THAT TOO!" But now it seams you have to code a lot of shit I have the slight feeling I'm never gonna talk in rainbow colors RE: How to output (rainbow) colored text? - nilyt - 12-19-2011 If I wanted this, I'd prefer doing an engine mod. It's contained, doesn't depend on some external webserver and doesn't send your potentially private conversations to some remote location. But that's just paranoid ol' me. (then there's always the irc spybot anyway) And I don't need it. Or maybe I should do it, just for fun? hmm RE: How to output (rainbow) colored text? - Mr. Bougo - 12-19-2011 (12-19-2011, 12:58 AM)nilyt Wrote: If I wanted this, I'd prefer doing an engine mod. It's contained, doesn't depend on some external webserver and doesn't send your potentially private conversations to some remote location. Chatting is by definition sending your potentially private conversations to some remote location, AFAIK RE: How to output (rainbow) colored text? - PinkRobot - 12-21-2011 Well done Lento RE: How to output (rainbow) colored text? - Minkovsky - 12-21-2011 @nilyt: you can set up a httpd and PHP on localhost if you don't want to use external servers. RE: How to output (rainbow) colored text? - Lento - 12-21-2011 (12-21-2011, 03:40 AM)PinkRobot Wrote: Well done Lento Thanks! and I also could do like this: xonotic20111222132034-00.jpg (Size: 46.71 KB / Downloads: 289) 僕と契約してXonoticプレイヤーになってよ! (send specified command and get value from the server.) Currently Xonotic doesn't support typing in Japanese but it can display RE: How to output (rainbow) colored text? - Soelen - 01-11-2012 hello, I do not understand quite how to put one sentence into one parameter, for example, this line alias spam "menu_cmd curl --exec --key 0 http://internet.org/test.php?myvarible=$1" does work, but it sends only one word out to the php file so by typing spam hello world in xonotic I get say hello what do I missing? D: RE: How to output (rainbow) colored text? - Mr. Bougo - 01-11-2012 menu_cmd curl --exec --key 0 http://example.org/meh.cgi foo "abc def" bar "ghi jkl" That's the same as querying meh.cgi?foo=abc%20def&bar=ghi%20jkl. So you want alias spam "menu_cmd curl --exec --key 0 http://example.org/test.php myvariable \"$1\"" RE: How to output (rainbow) colored text? - Soelen - 01-11-2012 How should the php look like? I try to catch this var with $_POST["foo"] or $_GET["foo"]. Oh my I guess I just dont get it how this is gonna work RE: How to output (rainbow) colored text? - Mr. Bougo - 01-11-2012 Hehe, I'd really love to see Lento helping you on this now. Now that would be awesome. I personally don't have a clue about PHP, but from reading this thread I see that div's function needs to be called by your code and it should access $_POST["myvariable"]. Actually maybe the syntax that I showed you above sends $1 as $_POST["myvariable"] data rather than GET, and div's posts suggest that it indeed works that way. Anyway, it should output a string that consists of "say " followed by whatever you want to say, I'm guessing. The menu_cmd executes as console command whatever the output of the web request is. |