A way to show all CMD: lines
#1

Alright, I am trying to make /allcommands, but since I have over 45k lines in my gamemode already, adding all command manually will be a disaster.

Is there a way to find all lines that include CMD:blablabla or something?
And show those?

Milan
Reply
#2

Quote:
Originally Posted by milanosie
Посмотреть сообщение
Alright, I am trying to make /allcommands, but since I have over 45k lines in my gamemode already, adding all command manually will be a disaster.

Is there a way to find all lines that include CMD:blablabla or something?
And show those?

Milan
CTRL + F and find your commands this way.

-FalconX
Reply
#3

Quote:
Originally Posted by FalconX
Посмотреть сообщение
CTRL + F and find your commands this way.

-FalconX
I know,
but I mean in game.

Like a command that automaticly shows all lines with CMD:
Reply
#4

ok, take all your code, put it in pastebin.com (do not forget to select "private" and "unlisted" in the pastebin options), then, in the your code's pastebin page, if you are using Firefox, type ctrl + shift + K and in the command line execute it;

Код:
r = document.getElementsByTagName("textarea")[0].innerHTML.match(/CMD\:.*?\(/gi);
o = "";
for(x in r)
     o += r[x].match(/CMD\:(.*?)\(/i)[1]+"\n";
alert(o);
- edit -
I've changed the code, it was capturing the commands twice.
Reply
#5

thanks

Had to do it in 5 times to not exceed the limit:P
Reply
#6

Milan I aint a pro But when i Wish To add someting into My script i just Search for a Created Command And paste it between It , My server got over 94k lines lol but u made yourself so u better haha :P
Reply
#7

Quote:
Originally Posted by miley1
Посмотреть сообщение
Milan I aint a pro But when i Wish To add someting into My script i just Search for a Created Command And paste it between It , My server got over 94k lines lol but u made yourself so u better haha :P
Okay...

Your point is?
Reply
#8

to avoid executing the code several times to not exceed alert text size, you can use that;

Код:
r = document.getElementsByTagName("textarea")[0].innerHTML.match(/CMD\:.*?\(/gi);
o = "";
for(x in r)
     o += r[x].match(/CMD\:(.*?)\(/i)[1]+"\n";
document.body.innerHTML = o+document.body.innerHTML;
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)