| Off Topic > Off Topic |
| Programming Megathread |
| << < (47/241) > >> |
| Goth77:
Torque This small section of code returns a message using /replyTopic You can use /setReplyColor, /setReplyFont, and /setReplySize to change how your message looks --- Code: ---//Font Color function serverCMDsetReplyColor(%writer,%hex) { if(strLen(%hex) != 6) return; %writer.replyHex = %hex; } //Font Face function serverCMDsetReplyFont(%writer,%font) { %writer.replyFont = %font; } //Font Size function serverCMDsetReplySize(%writer,%size) { if(%size > 32 || %size < 4) return; %writer.replySize = %size; } //Reply function serverCMDreplyTopic(%writer,%msg) { %final = "<color:"@%writer.replyHex@"<font:"@%writer.replyFont@":"@%writer.replySize@">"@ %msg @" "; messageAll("<color:fff000>" @ %writer.name @ " : " @ %final @ " "); } --- End code --- Of course there are some checks missing that should be in place such making sure the size is an integer, and setting a "default" size/color/face if %writer.customReply is false. |
| Foxscotch:
--- Quote from: otto-san on December 16, 2015, 06:42:38 PM ---i definitely prefer camelcase, probs cus that's just what i learned. it's really unintuitive for me to reach for that part of the keyboard and separate_words_out_like_this or-like-this. i personally find it a lot easier to just pressShift which one of my fingers usually rest on --- End quote --- I learned camelcase first too, but that didn't make it any easier to read |
| portify:
--- Quote from: Goth77 on December 16, 2015, 08:38:09 PM ---Torque This small section of code returns a message using /replyTopic You can use /setReplyColor, /setReplyFont, and /setReplySize to change how your message looks --- Code: ---//Font Color function serverCMDsetReplyColor(%writer,%hex) { if(strLen(%hex) != 6) return; %writer.replyHex = %hex; } //Font Face function serverCMDsetReplyFont(%writer,%font) { %writer.replyFont = %font; } //Font Size function serverCMDsetReplySize(%writer,%size) { if(%size > 32 || %size < 4) return; %writer.replySize = %size; } //Reply function serverCMDreplyTopic(%writer,%msg) { %final = "<color:"@%writer.replyHex@"<font:"@%writer.replyFont@":"@%writer.replySize@">"@ %msg @" "; messageAll("<color:fff000>" @ %writer.name @ " : " @ %final @ " "); } --- End code --- Of course there are some checks missing that should be in place such making sure the size is an integer, and setting a "default" size/color/face if %writer.customReply is false. --- End quote --- /setReplyFont Impact:128><div:1><shadow:0:32> |
| Steve5451²:
--- Quote from: Kochieboy on December 16, 2015, 06:47:37 PM ---* Kochieboy cringes --- End quote --- whyCringe? |
| pefu19:
--- Quote from: Kochieboy on December 16, 2015, 07:47:16 PM ---printf("Please stop"); --- End quote --- just_loving_stop |
| Navigation |
| Message Index |
| Next page |
| Previous page |