#Scripting plugin
1 messages · Page 1 of 1 (latest)
.
It would look something like this
Coords coords = arg1
Bool cobblestone = arg2
//pos1 coords
coords.x = coords.x - 10
//pos2 coords
if cobblestone
//set cobblestone
else
//set stone
In a more complex form
yeah for that you would need an environment, a lexer, parser and a syntax tree
just to make exactly that possible
that doesnt matter
you would also have much fun with the memory management
what about security, what is the user allowed to do? what can he do what you didnt noticed
In other cases you could also just have things like
//replacenear 50 "dirt <air" grass_block
//replacenear 50 "dirt <grass" grass_block
//pos1 ~-10 ~ ~-10
//pos2 ~10 ~ ~10
//set stone
This would be an admin-only permission basically
This is how I would start out with developing it
It wouldn't be a language at first, it would just be saved command bundles
Wdym by modular in this context?
being able to use whatever you like, or what do you mean by saved
You would do /script create my_script, which would bring up a book GUI. You write the commands in the book. When you close the book, the plugin saves the script to a file called my_script.someextension. Then, you call /script run my_script and it runs the script. You can also do /script edit my_script which will load it back into the book for editing.
Alternatively, you can make a script by directly adding a file with the desired name
As you can tell I am using the term "script" pretty loosely here - the functionality would start out simple and then be expanded upon over time
so not a script but just a batch of commands
Yeah in that case yes
then you dont need any of this
you can just get the lines of the book and loop over them
and execute the command as the player via #chat
and only would need to do some post correction like "hey, this command is not possible"
Yeah I know
I guess I should've said "batch file" rather than "script" but I'd like it to eventually evolve into a scripting language
i would do it step by step
Should I call it BiblioScript or BatchBook lol