Scripting or something like it.

Started by SleepKiller, June 29, 2013, 09:07:44 PM

Previous topic - Next topic
Disclaimer: I could be way off the mark with anything in this post, if I am forgive me.

So scripting then... Tirpider mentioned scripting was something that he would like to include in the program (Among other things, not sure why this one stood out.) I will now commence rambling off my theory.

Well I am thinking a simple scripting language needs a few things. Firstly you need to read the file. Then you need to phrase the file into something usable by the program. And finally translate the scripting functions into real functions with in the program.

Now I figure I'll take a crack at making one. It seems like a fun little project. Now things I think would be in a first version of some kind of scripting language.


  • The ability to define variables.
  • The ability to perform basic math operations on variables.
  • The ability to perform if checks.
  • The ability to define and call functions.

And slowly add stuff like loops to it. Please tell me if there is some hole in my logic or if you have something to contribute.

You are going down the right path.

I'll add to it.

The part to read the script would be called a parser.  It would be responsible for loading a script, and gathering directions from it and feeding those instructions to a handler in the program.

The handler would replace SchMEe's _ProcessFile() function, and would apply the various commands as directed by the parser.

The Parser would probably the hardest to develop as it would need to know the syntax of the if and loop structures.


Immediately I can see where the flow of Schmee would need to change to accommodate it.

Schmee currently sets global flags (according to the commandline or GUI options selected) then handles those flags in a pre-defined order.

A Parse/handler would not need flags to start a function, but would start the functions as it encounters them.
(the flags could still be used for conditional things like "don't do this if this flag is = 1" type stuff.)

I think we could use AutoIT's syntax for this.
I've read about the Lua development and they have jumped though all kinds of hoops to develop their syntax.
AutoIT's is built in, and even though it compiles to binaries, I believe it still runs as an interpreted language, feeding the program through an optimized interpreter that's embedded in the exe.


Parser that's the word. I had a feeling it started with a "p".

I wasn't really thinking of using LUA syntax. It would have to be something simple and also probably something in which white space was just for the user and not actually part of the scripting. (It possibly isn't as bad to deal with as I am thinking... I don't know. Need to learn AutoIT first anyway.) I'll post an update when I pull myself away from other projects and sit down to learn AutoIT. Then'll I see about just getting some form of basic syntax being read and handled by the program, I'll go from there. Start small and build from there is the way I am approaching this.