Get started with you own program
First
Create a empty template like this:
package youPack; import bukkish.*; public class MyProg extends BukkishTask { public MyProg(LinkQueue lq, Session caller, String cmd) { super(lq, caller, cmd); } @Override public void run() { finish(); } }
The simplest program
Make a simple program first using methods like
void writeOut(String)
or
String readIn()
The second simplest way
The super constructor already parses the cmd line into command and arguments. The arguments are stored in args[]. So lets extend our little code.
package youPack; import bukkish.*; public class MyProg extends BukkishTask { public MyProg(LinkQueue lq, Session caller, String cmd) { super(lq, caller, cmd); } @Override public void run() { if (args == null || args.length == 0) writeOut("You don't have any arguments given"); else writeOut("You gave " + args.length + " arguments"); writeOut("Wanna say something?"); String line = readIn(); writeOut("You wrote:") writeOut(line); finish(); } }
Else
You can also use the filesystem with the
BukkishFileSystemHandler
class. Which automaticly places files in the right directory.
It is not recommended to use
new File("filename");
Manual entry
If you want to have a manual entry simply override the
public String getMan()
method. For example like this:
@Override public String getMan() { return "To do some funny things"; }
The manual entry should explain all features of you program.
Comments