public Script(PluginBus bus, final String id) {
        super(bus, id);

        bus.registerPluginListener(new OnlineStatusListener() {
            public void online() {
                setup(savedScript);
            }

            public void offline() {
                // ignore disconnection
            }
        });

        bus.registerPluginListener(new ConfigurationListener() {
            public void setConfiguration(PluginConfig config) {
                savedScript = new Vector();
                String s = config.getProperty("Script", id, "script");
                if (s != null) {
                    // check if the script is stored in a file
                    if (s.charAt(0) == '@') {
                        Script.this.error("@file not implemented yet");
                    }
                    // parse the script and set up
                    if (debug > 0) {
                        Script.this.error(s);
                    }
                    String[] pair = null;
                    int old = -1, idx = s.indexOf('|');
                    while (idx >= 0) {
                        if (pair == null) {
                            pair = new String[2];
                            pair[0] = s.substring(old + 1, idx);
                            if (debug > 0) {
                                System.out.print("match(" + pair[0] + ") -> ");
                            }
                        } else {
                            pair[1] = s.substring(old + 1, idx) + "\n";
                            if (debug > 0) {
                                System.out.print(pair[1]);
                            }
                            savedScript.addElement(pair);
                            pair = null;
                        }
                        old = idx;
                        idx = s.indexOf('|', old + 1);
                    }
                    if (pair != null) {
                        pair[1] = s.substring(old + 1) + "\n";
                        savedScript.addElement(pair);
                        if (debug > 0) {
                            System.out.print(pair[1]);
                        }
                    } else {
                        Script.this.error("unmatched pairs of script elements");
                    }
                    // set up the script
                    //  setup(savedScript);
                }
            }
        });
    }