Well, since Kerm said on IRC he would help me by providing some examples for doing file/folder manipulation, I decided to take a quick 3-4 day break from PrizmCity to make my first DCS related program Smile

What I'm essentially aiming for is an alternative way for uber-haxers who hate GUIs or just the DCS GUI in general to go about using doors effectively. I'm thinking for most efficiency, to have a somewhat-condensed system of scripting, with maybe 20-30 commands, all of which with short calling names and simple/rememberable parameter intakes. Some ideas for what I'll try to implement ASAP:

.(Program Name) // runs program
REN (Old Name) (New Name) // renames
MOV (Path) (New Path) // moves file/directory
CPY (Path) (New Path) // copies file/directory
DEL (Path) // deletes
LCK (Program Name) // locks program
HID (Program Name) // hides program
TYP (Program Name) // gets type(s) of fil(s)e in cur directory with name
CD (New Dir) // changes to new directory
CD // shows current directory
NEW (name) [size] [type] // creates new file of name, type, and size. If no type, creates directory and size is ignored
X/Q/QUIT // quits
INF (name) // gives info of given file, including size, locked, hidden, long desc., etc.
CHK // get a program's checksum and display it

Possible candy features later on once the bare bones is finished:

- Possibility of making a new system to pass parameters to a program on running statement
- .DSL (Doors Scripting Language) files which contain pre-written DSL commands, like the bare bones ones above
- Simple variables
- Useful system commands (TIOS)
- Block/control statements (for .DSL files)
- Internal file manipulation


Any ideas, or the such? I should get something working tomorrow.
Ooh sounds very cool. Can't wait to see what becomes of this. Smile
Can we use Unix naming conventions instead of DOS naming conventions?

mv and rename should have the same functionality, cp, rm, chmod (to change permissions/visibility), cd [dir] to change directory, cd to change to the home directory, pwd to print the current working directory, and stat to get the file info.

Also, ls

[edit]

and, given the keypad we're working with, tab complete. please please please tab-complete.
elfprince13 wrote:
Can we use Unix naming conventions instead of DOS naming conventions?

mv and rename should have the same functionality, cp, rm, chmod (to change permissions/visibility), cd [dir] to change directory, cd to change to the home directory, pwd to print the current working directory, and stat to get the file info.

Also, ls

This would be so awesome, I definitely second this. Very Happy Also, what would the Doors Scripting Language be like? Would it be like Bash, having support for stuff like functions and arrays?
souvik1997 wrote:
elfprince13 wrote:
Can we use Unix naming conventions instead of DOS naming conventions?

mv and rename should have the same functionality, cp, rm, chmod (to change permissions/visibility), cd [dir] to change directory, cd to change to the home directory, pwd to print the current working directory, and stat to get the file info.

Also, ls

This would be so awesome, I definitely second this. Very Happy Also, what would the Doors Scripting Language be like? Would it be like Bash, having support for stuff like functions and arrays?


Well, I'm not familiar with the Unix commands, could someone list them? If someone would do it, I could implement both the DOS and Unix commands, simply by doing pretty much the same thing for different tokens.

And as for the Doors Scripting Language, I was thinking just an extended version of the command list, but I'm open to ideas; first however will be the bare bones, to actually make it functional Razz the DSL I just thought might be a cool addition over time (though, I'll likely get this all functional with the basics at latest by Sunday)
I definitely second the Unix naming conventions, rather than the awkward DOS ones. Google would help you find a bunch of the naming conventions (like "Rename file linux", "Change directory linux", etc), but a quick output of the `help' command is:
Code:
azunyan@localhost:~$ help
GNU bash, version 4.1.7(1)-release (i386-redhat-linux-gnu)
These shell commands are defined internally.  Type `help' to see this list.
Type `help name' to find out more about the function `name'.
Use `info bash' to find out more about the shell in general.
Use `man -k' or `info' to find out more about commands not in this list.

A star (*) next to a name means that the command is disabled.

 job_spec [&]                                      history [-c] [-d offset] [n] or history -anrw >
 (( expression ))                                  if COMMANDS; then COMMANDS; [ elif COMMANDS; t>
 . filename [arguments]                            jobs [-lnprs] [jobspec ...] or jobs -x command>
 :                                                 kill [-s sigspec | -n signum | -sigspec] pid |>
 [ arg... ]                                        let arg [arg ...]
 [[ expression ]]                                  local [option] name[=value] ...
 alias [-p] [name[=value] ... ]                    logout [n]
 bg [job_spec ...]                                 mapfile [-n count] [-O origin] [-s count] [-t]>
 bind [-lpvsPVS] [-m keymap] [-f filename] [-q n>  popd [-n] [+N | -N]
 break [n]                                         printf [-v var] format [arguments]
 builtin [shell-builtin [arg ...]]                 pushd [-n] [+N | -N | dir]
 caller [expr]                                     pwd [-LP]
 case WORD in [PATTERN [| PATTERN]...) COMMANDS >  read [-ers] [-a array] [-d delim] [-i text] [->
 cd [-L|-P] [dir]                                  readarray [-n count] [-O origin] [-s count] [->
 command [-pVv] command [arg ...]                  readonly [-af] [name[=value] ...] or readonly >
 compgen [-abcdefgjksuv] [-o option]  [-A action>  return [n]
 complete [-abcdefgjksuv] [-pr] [-DE] [-o option>  select NAME [in WORDS ... ;] do COMMANDS; done>
 compopt [-o|+o option] [-DE] [name ...]           set [--abefhkmnptuvxBCHP] [-o option-name] [ar>
 continue [n]                                      shift [n]
 coproc [NAME] command [redirections]              shopt [-pqsu] [-o] [optname ...]
 declare [-aAfFilrtux] [-p] [name[=value] ...]     source filename [arguments]
 dirs [-clpv] [+N] [-N]                            suspend [-f]
 disown [-h] [-ar] [jobspec ...]                   test [expr]
 echo [-neE] [arg ...]                             time [-p] pipeline
 enable [-a] [-dnps] [-f filename] [name ...]      times
 eval [arg ...]                                    trap [-lp] [[arg] signal_spec ...]
 exec [-cl] [-a name] [command [arguments ...]] >  true
 exit [n]                                          type [-afptP] name [name ...]
 export [-fn] [name[=value] ...] or export -p      typeset [-aAfFilrtux] [-p] name[=value] ...
 false                                             ulimit [-SHacdefilmnpqrstuvx] [limit]
 fc [-e ename] [-lnr] [first] [last] or fc -s [p>  umask [-p] [-S] [mode]
 fg [job_spec]                                     unalias [-a] name [name ...]
 for NAME [in WORDS ... ] ; do COMMANDS; done      unset [-f] [-v] [name ...]
 for (( exp1; exp2; exp3 )); do COMMANDS; done     until COMMANDS; do COMMANDS; done
 function name { COMMANDS ; } or name () { COMMA>  variables - Names and meanings of some shell v>
 getopts optstring name [arg]                      wait [id]
 hash [-lr] [-p pathname] [-dt] [name ...]         while COMMANDS; do COMMANDS; done
 help [-dms] [pattern ...]                         { COMMANDS ; }
Meh, didn't even think of google :/ must be too tired. Plus, that output help thing is rather messy looking Razz anyways, yeah, I'll make the Unix ones the standard ones, since they do seem cool; however, me and a few others might be included in the "batch" script kiddies group, so I'll have those as an option too Smile
Ashbad wrote:

Well, I'm not familiar with the Unix commands, could someone list them?


I did. But also Google.
elfprince13 wrote:
Ashbad wrote:

Well, I'm not familiar with the Unix commands, could someone list them?


I did. But also Google.


ORLY including exact side effects and parameters? Wink

But yeah and google too.

With that being said, I can't really work on it tonight; so I'll ask for some suggestions so that the process of development will go quick. Black text on white, or white text on black? DCS7 3x5 font, or custom? DCS7 key mappings, or closer to home screen? SE or program (I'm thinking program from what Kerm said, but I'd be interested to see what other people think)?
Another thing you could add would be piping, so I could do something like ls | grep to search for programs.
_player1537 wrote:
I definitely second the Unix naming conventions, rather than the awkward DOS ones.

I'd say the DOS/Windows ones are quite a bit less awkward than the Unix ones as they are generally user-friendly English words or obvious abbreviations thereof rather than the txtspk-like Unix ones (copy/cp, del/rm, help/man etc). I'd personally suggest supporting both.
This is a really cool idea! Very Happy BASH-like DCS scripts could make distribution and installation of programs a bit more fun... Wink Plus, you might even be able to weave in bits of the DCS API too! Very Happy

Ashbad wrote:
With that being said, I can't really work on it tonight; so I'll ask for some suggestions so that the process of development will go quick. Black text on white, or white text on black?

Both, selectable as an option. Default, however, should probably be black text against white.

Ashbad wrote:
DCS7 3x5 font, or custom?
Not sure which font you are referring to... as long as it's readable, I guess. The regular TI graphscreen (tiny font) wouldn't be a bad idea either.

Ashbad wrote:
DCS7 key mappings, or closer to home screen?
Huh...? I thought this was a CLI based program... Razz Unless, of course, you're thinking about a terminal-shell hybrid, but that itself might be tricky to figure out...

If you are going with CLI only, make it so that the up key recalls the previous commands (maybe 2.53MP style? Razz), and of course the usual keys for entering in commands.
Ashbad wrote:
SE or program (I'm thinking program from what Kerm said, but I'd be interested to see what other people think)?
As I've said here, a SE may be impossible or simply just not feasible. (This is deduced from the SDK docs.) A program would be best, since I can simply run it from the homescreen, and it would launch the CLI interface immediately. At the same time, I could still use the regular desktop interface without having to delete the program.
How about using both unix and windows style commands? Offer both LS and DIR, for example.
For what it's worth, Ashbad, the DCS 3x5 font that DCS exposes with it's super-fast font function calls are almost identical to the TI small (graphscreen) font. SirCmpwn, I believe that Benryves made the exact same point two posts above yours. Ashbad, as Alberthro points out, I think you misunderstand the point of an SE. SEs are mainly to wrap specific small functionality around DCS's own GUI. For example, you could use an SE that would automagically launch your GUI once Doors CS started. In fact, if you were really clever, ....but let's not get into that, that's a discussion for a later date. Bottom line, this sounds awesome. Your first step should just be to make typeable, tab-completable commands. Don't even worry about the commands doing anything. Don't worry about editing inside words, just have typing at the end and backspace.
benryves wrote:
_player1537 wrote:
I definitely second the Unix naming conventions, rather than the awkward DOS ones.

I'd say the DOS/Windows ones are quite a bit less awkward than the Unix ones as they are generally user-friendly English words or obvious abbreviations thereof rather than the txtspk-like Unix ones (copy/cp, del/rm, help/man etc). I'd personally suggest supporting both.


I fin the unix commands to be more useful and powerful than dos commands. Also, you have the associations wrong. rm= remove, man=manual.
Well, either way I'm having both; I'm used to Batch commands, so ha. A few things:

Souvik: maybe I'll add some sort of piping later, for now would be getting these commands working. I'll hold onto that idea though Smile

Kerm: sounds good, I'll take it slow Smile unfortunately, first FIRST meeting tonight, so that means I wont be able to work on it today like I planned :/ however this weekend shall be excellent.

RE: tab completion, I'm assuming you mean as in typing in one letter, and pressing a button to type the rest for you? If so, I really doubt it'd be hard.
Ashbad, indeed, better than trying to add all the fancy features first, getting frustrated, and ending up with a half-finished project. Tab completion means you type N letters, tab, and the shell tries to figure out the M>N letter commands that start with those N letters. It then fills in the rest of the command if only ONE such command exists, and adds a space.
Ah, okay, that's what I thought you meant by tab completion Smile

Anyways, I've set this all up with the DCS7 SDK (which I haven't used before this -- I must say it is rather organized and excellent, with brilliant documentation and ease of use) and I'm working on just making my own word wrapping routines, key typing and detection, and the whole gallery of basics I'm going to need; I have a feeling I'll be done with them by tomorrow morning, maybe post a rudimentary screenshot tonight.

EDIT: well I'm done until tomorrow, g'night all. In the last hour or so I mangles up the compile.bat script to about 20% of it's original size so I can do things quick, and got about 200 lines of code in, so basically some key routines and all text routines. Sorry Kerm, not using your BinPac8x python thingy Sad can't get python to install without an admin password, and good luck for me getting that from a cranky dad who didn't even want me programming tonight. Instead, I'm using some other similar thing, so it's all good. Of course, I'm still using brass Smile awesome compiler.
No offense taken, although you should have Python on there anyway. I look forward to following your swift progress on the project. Wink
Ashbad wrote:
Sorry Kerm, not using your BinPac8x python thingy Sad can't get python to install without an admin password, and good luck for me getting that from a cranky dad who didn't even want me programming tonight. Instead, I'm using some other similar thing, so it's all good. Of course, I'm still using brass Smile awesome compiler.


You don't have to be an admin to install python. Just don't add it to the path at install, and set it as a local variable (specific to your user)
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement