AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Console Explorer v2.4 6/25/07 (https://forums.alliedmods.net/showthread.php?t=56209)

stupok 06-08-2007 21:42

Console Explorer v2.4 6/25/07
 
1 Attachment(s)

Console Explorer v2.4
Last updated 6/25/07

Description
This plugin allows the admin to edit files and folders on the server through the console.

Commands
ce_help
Use this to list all commands and their usages.


ce_open <full path>

Use this to open folders or files. To open the base directory, type "te_open ."
When you open text files the line numbers will be appended to the beginning
of each line.

* Correct usage: ce_open ".\maps\some folder\a file.txt"

Also note:
In order to open the parent directory, you may use:
ce_open "directory\.."


ce_new <full path>

Use this to create a new file or folder.


ce_delete <full path>

Use this to delete a file or folder. Please note that you cannot delete a directory
that contains a directory with files or folders. You may only delete a directory
that contains no directory with files or folders.
For example, we are given: ".\folder1\"

folder1 contains:
folder2
file.txt
Now, if folder2 has no files or folders inside, then you can delete folder1
with one command:
ce_delete ".\folder1"
However, if folder2 contains any files or folders, then you must delete it
seperately:
ce_delete ".\folder1\folder2"
ce_delete ".\folder1"


ce_replace_line <line number> <new line text>

First you must open a text file with "ce_open file". Then, use this to replace a
line in the text file with your own line.

* Correct usage: ce_replace_line 51 "This is the text that will go on line 51."


ce_replace_string <replace this text> <with this text>

First you must open a text file with "ce_open file". Then, use this to replace all
phrases in the text file that match the first argument.

* Correct usage: ce_replace_string "admin" "lolzor"


ce_cmd <yes|no>

This commands only works after you use the command te_delete. You must confirm
that you want to delete a file or directory before it is actually deleted.
Plans for the future
Clean up and optimize the code.

Changelog
Code:

06/24/07 - v2.4 - More optimization, better recognition of files/dirs. te -> ce
06/23/07 - v2.3 - Optimization, te_cmd instead of two commands. More than
                  one person can use it at one time.
06/09/07 - v2.1 - Added te_help.
06/08/07 - v2.0 - Initial release.

Warning
Code:

*********************************** WARNING ***********************************
*********************************** WARNING ***********************************
*********************************** WARNING ***********************************

This plugin can potentially make your server COMPLETELY vulnerable. It may also
violate your terms of service with your server provider. Use at your own risk.
       
*********************************** WARNING ***********************************
*********************************** WARNING ***********************************
*********************************** WARNING ***********************************


datwinkle 06-08-2007 21:52

Re: Console Explorer v2.0 6/8/07
 
neat. trying it now!

regalis 06-08-2007 22:03

Re: Console Explorer v2.0 6/8/07
 
Nice, waited just for this to check it out ;)

greetz regalis

bmann_420 06-08-2007 23:53

Re: Console Explorer v2.0 6/8/07
 
Very Usefull and origional. :up:

Alka 06-09-2007 01:13

Re: Console Explorer v2.0 6/8/07
 
Heh,atleast is out! Gj stupok :wink:

Simon Logic 06-09-2007 05:39

Re: Console Explorer v2.0 6/8/07
 
Original, but how can i use te_replace_line/te_replace_string without viewing the source for already existing file? te_view command would be helpful.

Ryu2877 06-09-2007 08:09

Re: Console Explorer v2.0 6/8/07
 
Good idea! +k

An instance: you may add an command ( "te_help" etc. ) for show all the commands & manual. Thanks.

stupok 06-09-2007 12:11

Re: Console Explorer v2.0 6/8/07
 
@Simon Logic
The way I have it set up, you must open the text file first with te_open and then you can use te_replace_line or te_replace_string to edit the file. I don't know what you mean by te_view, sorry.

@Ryu2877
I think adding a help command is a great idea.

Simon Logic 06-09-2007 12:20

Re: Console Explorer v2.0 6/8/07
 
Just looked into the source code. I did't know that you print contents on ts_open. Now, it's ok =)

Emp` 06-10-2007 13:38

Re: Console Explorer v2.1 6/9/07
 
Nicely done. I suggest however, that with te_open, when displaying files, display like 10 files at a time. Because if for some reason, someone were to go into "the wrong place" (such as the maps or models dir. which contains many many files), it will completely flood their console (not to the point of crashing, but it would be annoying).

Otherwise looks good.


All times are GMT -4. The time now is 09:56.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.