ENET
|
  |
| Joined: 01 Jan 2010 |
| Total Posts: 4820 |
|
|
| 12 Aug 2012 01:37 PM |
How come none of us have really used luas text manipulation to its fullest with roblox's text items?
function parseButton(btn, text) text = text or btn.Text; local color1, color2, color3 = text:gsub(" ", ""):match("%[c%](%d*%.?%d*),(%d*%.?%d*),(%d*%.?%d*)%[/c%]"); if(not color1 or not color2 or not color3)then return; end btn.TextColor3 = Color3.new(tonumber(color1),tonumber(color2),tonumber(color3)); btn.Text = text:gsub("%[c%](%d*%.?%d*),(%d*%.?%d*),(%d*%.?%d*)%[/c%]", ""); end
We could make a really good text type manipulator for inputs as shown above....
|
|
|
| Report Abuse |
|
|
booing
|
  |
| Joined: 04 May 2009 |
| Total Posts: 6594 |
|
|
| 12 Aug 2012 01:47 PM |
| stop hurting my eyes or ill have to buy new ones |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
| |
|
ENET
|
  |
| Joined: 01 Jan 2010 |
| Total Posts: 4820 |
|
|
| 12 Aug 2012 02:13 PM |
| Haha u no lyke the string manipulation patterns? |
|
|
| Report Abuse |
|
|
pwnedu46
|
  |
| Joined: 23 May 2009 |
| Total Posts: 7534 |
|
|
| 12 Aug 2012 02:15 PM |
"Haha u no lyke the string manipulation patterns?"
No. |
|
|
| Report Abuse |
|
|
ENET
|
  |
| Joined: 01 Jan 2010 |
| Total Posts: 4820 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
Tarabukka
|
  |
| Joined: 18 Jan 2011 |
| Total Posts: 394 |
|
|
| 12 Aug 2012 06:33 PM |
| I imagine they also take as much time as it takes for a star to be born and then die to run... |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2012 06:36 PM |
I personally hate string manipulation, but it'd be cool to make your own encrypted language or something.
Maybe jumble up the letters of the alphabet in such a way that only a script can decrypt it. Heh, cool dream bro.
☜▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☜☆☞▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☞ - Candymaniac, a highly reactive substance. |
|
|
| Report Abuse |
|
|
Tarabukka
|
  |
| Joined: 18 Jan 2011 |
| Total Posts: 394 |
|
|
| 12 Aug 2012 06:38 PM |
| Maybe you could perform multiple rounds of rotating the block to encrypt, xor'ing it with a matrix derived from the key and performing substitutions... aka Rijndael (which I will not claim to understand) |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2012 06:39 PM |
I was actually thinking something more simple such as moving the alphabet 2 letters forward.
So if you were to say ABC, it would say CDE. If it was XYZ, it would be ABC...
☜▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☜☆☞▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☞ - Candymaniac, a highly reactive substance. |
|
|
| Report Abuse |
|
|
Tarabukka
|
  |
| Joined: 18 Jan 2011 |
| Total Posts: 394 |
|
|
| 12 Aug 2012 06:54 PM |
| That's a Caesar cipher. They're cool, but very simple, and cryptographically useless. |
|
|
| Report Abuse |
|
|
Tarabukka
|
  |
| Joined: 18 Jan 2011 |
| Total Posts: 394 |
|
|
| 12 Aug 2012 06:55 PM |
| Simple doesn't mean cryptographically useless, by the way - RSA's encryption/decryption functions are rawly expressed as something like A = X^y % z |
|
|
| Report Abuse |
|
|
ENET
|
  |
| Joined: 01 Jan 2010 |
| Total Posts: 4820 |
|
|
| 12 Aug 2012 07:14 PM |
Or you could do distance....
IE A = Z B = X C = Y D = W
More like inverse but basically you swap them around. |
|
|
| Report Abuse |
|
|
ENET
|
  |
| Joined: 01 Jan 2010 |
| Total Posts: 4820 |
|
|
| 12 Aug 2012 07:15 PM |
[[I imagine they also take as much time as it takes for a star to be born and then die to run...]]
Its ran on c-side they aren't that slow. Maybe if you ran a thousand of them, but they aren't significantly slow. |
|
|
| Report Abuse |
|
|
NXTBoy
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 4533 |
|
|
| 12 Aug 2012 07:28 PM |
| Why are you looking for a control character at the start of the text? |
|
|
| Report Abuse |
|
|
ENET
|
  |
| Joined: 01 Jan 2010 |
| Total Posts: 4820 |
|
|
| 12 Aug 2012 07:45 PM |
| I'm not its match.... it can be anywhere in the text. |
|
|
| Report Abuse |
|
|
NXTBoy
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 4533 |
|
|
| 12 Aug 2012 08:41 PM |
| Ok, why are you looking for a control character? |
|
|
| Report Abuse |
|
|
ENET
|
  |
| Joined: 01 Jan 2010 |
| Total Posts: 4820 |
|
|
| 12 Aug 2012 08:43 PM |
What do you mean a control character? I ain't?
I am simply searching for a number but to do this I must also search for decimals.
%d = 1-9 not .
%d* %.? %d*
0 or more multiple numbers 1-9 1/0 .'s and 0 or more more 1-9s |
|
|
| Report Abuse |
|
|
3543
|
  |
| Joined: 03 Dec 2011 |
| Total Posts: 121 |
|
| |
|
ENET
|
  |
| Joined: 01 Jan 2010 |
| Total Posts: 4820 |
|
|
| 12 Aug 2012 08:45 PM |
No where does it say %c it says c%] and I do that because to check for a ] you have to use %] as the ] character is used for sets and must there for be used along side a % to check for the actual character.
|
|
|
| Report Abuse |
|
|
3543
|
  |
| Joined: 03 Dec 2011 |
| Total Posts: 121 |
|
|
| 12 Aug 2012 08:49 PM |
text:gsub(" ", ""):match("%c%,(%d*%.?%d*),(%d*%.?%d*)%[/c%]");
:match("%c%,(%d*%.?%d*),(%d*%.?%d*)%[/c%]");
:match("%c%
%c %,
You're looking for a control character. |
|
|
| Report Abuse |
|
|
ENET
|
  |
| Joined: 01 Jan 2010 |
| Total Posts: 4820 |
|
|
| 12 Aug 2012 08:53 PM |
text:gsub(" ", ""):match("%[c%](%d*%.?%d*),(%d*%.?%d*),(%d*%.?%d*)%[/c%]"); :match("%[c%](%d*%.?%d*),(%d*%.?%d*),(%d*%.?%d*)%[/c%]"); "%[c%](%d*%.?%d*),(%d*%.?%d*),(%d*%.?%d*)%[/c%]"); %[/c%]");
%[/c%]
It is decoded like this
%[ look for a [ /c look for a / followed by a c %] look for a ] |
|
|
| Report Abuse |
|
|
3543
|
  |
| Joined: 03 Dec 2011 |
| Total Posts: 121 |
|
|
| 12 Aug 2012 08:59 PM |
| At the start. You have "%c" Not the end. |
|
|
| Report Abuse |
|
|
NXTBoy
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 4533 |
|
|
| 12 Aug 2012 09:10 PM |
Sorry guys, this is entirely my fault. ENET originally posted:
text:gsub(" ", ""):match("%[c%](%d*%.?%d*),(%d*%.?%d*),(%d*%.?%d*)%[/c%]")
But the forum enhancer was parsing `[c%](%d*%.?%d*)` as a link, resulting in `%c`. |
|
|
| Report Abuse |
|
|