customstuff4 icon indicating copy to clipboard operation
customstuff4 copied to clipboard

[Feature Request]: Scripts (like CS2)

Open MorKazim opened this issue 7 years ago • 2 comments

hello, can you give us the ability to use scripts like we had in CS2 example: "for(var i=0; i<height; i++) { for(var j=0; j<width; j++) { for(var k=0; k<width; k++) { world.setBlockIdAndMetadata(position, block, blockmeta); z++; } z -= width; x++; } x -= width; y++; } y -= height;" thank you.

MorKazim avatar Jan 22 '18 09:01 MorKazim

No promises, but I might look into this. I know a secure javascript sandbox which could serve it really well. Performance should be able to compete with java code as well. It really looks like that this feature would also be able to solve #59 #46 #45 #39 #18 #55 #61.

The reason why I think scripts should be preferred over injecting actual java code (as far as I can tell, it would be possible), because that way we can edit scripts at runtime, plus we can handle restrictions and other security stuff in a more sane way.

Frontrider avatar Mar 27 '18 08:03 Frontrider

I think now I'm onto something-. No promises, I'll try to get the pr for the first iteration this week. It will be limited and incomplete, but good enough for trials. Bugs guaranteed (Have to figure how to test it reliably, and the error margin is high), but not supposed to crash your game.

Will be disabled by default, there will be a config option to turn it on.

Frontrider avatar Apr 02 '18 22:04 Frontrider