This text contains some thoughts on the current state of the client, I've included (hopefully) everything from Era's document that I'd want to see done. Problems: --------- - I was unable to make calls to client interfaces from scripts, the client always complained about not finding the methods, e.g. Sourced file: inline evaluation of: ``run(). '' : Error in method invocation: Method doCommand( java.lang.String ) not found in class'com.mythicscape.batclient.b' : at Line: 4 : in file: inline evaluation of: ``SCRIPT_NAME = "test" void run(){ clientGUI.doCommand("look") } '' : clientGUI .doCommand ( "look" ) Called from method: run : at Line: 1 : in file: inline evaluation of: ``run() '' : run ( ) - Not all interfaces are shown in the current javadoc; it would be nice to at least see what is available. Most of the methods are quite self-explanatory anyways. - Catching the input affects internal commands sent by the batclient, all commands should be prepended with @@, e.g. '@@ping' to ensure they don't get sent to whatever is catching your input right now (mail, news, plan, rep, etc). - The www page references in the client's help won't open on Mac OS X Battle plan for us on the bat side: ----------------------------------- #1 - Implement the starter set as beanshell scripts. #2 - Make the user-visible commands available via macros. That is, we use macros and such only to bind functionality for the user. For instance, when we want to do a tracker for different prots, we make a bat-prots.bcs which - Defines methods for commands that the player can use (e.g. protreport, protup, protdown) - Sets up triggers for the tracker in bootup() method - Sets up macros in bootup() that call these methods, e.g. /macro protreport = $protTracker.reportProts Additionally we want to create a set of "easy" helpers for scripting using beanshell. We make the functionality as separate methods and then bind them as macros during bootup(). List of easy-mode stuff that we on the bat side can implement in bsh: /set, /list - variable manipulation / listing /lite - highlight whole lines, a substituting trigger /partial - highlight partial lines, a substituting trigger /echo - echo text locally /substitute - substitute the matched line with something /at - execute a command somewhere in the future, uses some scheduler thread that runs once in a second or so Macros currently have some functionality from regexp substitutions, but I'd complement that with global variables, i.e. %foo and %{foo} would expand to the value of variable 'foo' in the global variable table. This and the easy-mode stuff above should suffice for basic needs. More advanced users would then need to dive into the beanshell code. Critical improvements: ---------------------- - When multiple triggers match the incoming line, they all get called; we need to be able to define priorities to adjust the order on which triggers are handled. For instance, if we want to totally reformat the output of 'party status short' we want the reformatting to happen last, so that other triggers can still use the information in pss. - Make a difference between echoing and substituting text. Echoing displays the text locally in the client, it doesn't get sent to logs or parsed further. Substituted text continues to be handled and matched with the remaining trigger chain. - Some way to output color, (partial) lites can then be implemented in beanshell as substituting triggers. We definitely want to highlight things :) Other important stuff: ---------------------- - Defining a new trigger/macro with the same name should overwrite the previous one. A major usability issue when testing things. - We need to access the left and right sides of the matching regexp. For instance we have an incoming line: Dazzt utters the magic words 'gtzt zur fehh' which we would like to substitute with the line Dazzt utters the magic words 'gtzt zur fehh' (magic missile) In this case we'd want to make a regexp 'gtzt zur fehh', and then substitute the matched line with '%L%0 (magic missile)' where %L is everything to the left of the match. This could be handled with non-greedy matching, but it would be a bit tedious to do ^(.*?)(.*) each time we need to substitute something in the middle of the string. - Surround the /trig regexps with quotes for clarity, /trig "Dazzt says '([^']+)'" parrot = say %0 - Prompt, BatMUD has prompt, which should appear as the prompt :) Nice to have: ------------- - Line numbers to script editor - Trigger/Macro/Variable/Script management windows, enable/disable/remove things. - ';' is the default command delimiter of the MUD, and also the command delimiter for macros. We want to be able send multiple commands at once from scripts. The delimiter could be changed to something else, for instance tf uses %; Addressed issues: ----------------- (From Era's text:) - Trigger body delimiters, ';' is the delimiter, though could be e.g. '%;' - BeanShell samples -> received - /macro foo = $script.fooMethod - Javadoc available (partially) - Echo text to self -> clientGUI.printText() - Redirect matching lines to windows -> make gagging trigger that calls clientGUI.printTextToWindow("window", "foo\n");