| Blockland Forums > Modification Help |
| Converting chat to URL efficiently. |
| (1/4) > >> |
| MegaScientifical:
I was trying to make a script that would convert text from chat to URL, but I've hit snags. One snag is that characters such as ":" "<" and ">" break the URL and make it look uglier. Another is that I must account for the fact each message can only contain two URLs. I find it hard to figure out a simple method to achieve this and am hoping someone here may help. Here's what I've tried to compose, but I became lost: --- Code: ---function urlChat(%t) { %output = "http://"; for(%i = 0; %i <= getWordCount(%t); %i++) { %w = getWord(%t, %i); if(strStr(%w, ":") > -1) %output = %output @ " " @ %w @ " http://"; else %output = %output @ "_" @ %w @ " "; } } --- End code --- |
| Chrono:
Why not just chat normally? |
| Ephialtes:
Wow. You have the most convoluted thought process I've ever seen. |
| MegaScientifical:
--- Quote from: Ephialtes on October 20, 2010, 03:44:12 PM ---Wow. You have the most convoluted thought process I've ever seen. --- End quote --- I know, that's why I came here. I don't get what the forget I'm doing. The only reason I'd even bring up such a useless script here is because the process to make it is somehow confusing me so much. |
| Chrono:
Whatever you learn from this will very unlikely be used for anything useful. |
| Navigation |
| Message Index |
| Next page |