BBS Scripting engine working

1 view
Skip to first unread message

Don Brown

unread,
Aug 26, 2008, 10:42:57 AM8/26/08
to twxp...@googlegroups.com
I completed a first cut at the scripting engine for the bbs proxy.
This allows a sysop to write scripts that can basically do anything to
the game. The language I'm going with for now is JavaScript as it is
built into Java 6, and scripts are installed by dropping them in the
"scripts" directory of the application. Here is a simple script I
used to test that logs the user on and prevents them from attacking
anyone (the first time, anyway):

game.setTextTrigger("login","ENTER");
game.pause();
game.send("don\r\n");
game.setTextTrigger("menu", "menu):");
game.pause();
game.send("a");
game.setTextTrigger("attack", "<Attack>");
game.killTextTrigger("menu");
game.killTextTrigger("login");
game.pause();
game.send("n");
player.send("\r\n\u001b[30mDon't be a dick\r\n");

Now, there is a lot to be cleaned up here, but it works and is quite
fast. Notice you have the ability to script player and game text.
Thinking about it, it wouldn't be too hard to write a simple DSL that
mimics TWX Proxy scripts, although without the access to the parsed TW
data.

Anyway, I hope to clean this up, write some docs, and get something
ready for a weekend release. The web client bit will probably be
turned off, leaving the server-side proxy and its scripting engine.

Anyone have any ideas for good scripts to include?

Don

Reply all
Reply to author
Forward
0 new messages