GaugeMonitor
From ScapeFX Wiki
The GaugeMonitor plugin is a simple plugin showing how to display a monitor with three bars for health, mana and endurance points.
The plugin receives data from the server using SFXP. To update the plugin the server should send:
ESC#plugin:GaugeMonitorESC#h3904/3904e3900/3900m3900/3900ESC#plugin>
Which means the monitor will update with the info:
- health=3904 maxhealth=3904
- endurance=3900 maxendurance=3900
- mana=3900 maxmana=3900
How to use the plugin:
- Make sure your server sends the right updates like explained above.
- Copy the GaugeMonitor.java file above and add it into your project. In your plugin pack simply add the new plugin as "new GaugeMonitor()".
Example from the SampleSFX project SamplePack.java:
@Override
public ArrayList<ScapeFXPlugin> getPlugins() {
ArrayList<ScapeFXPlugin> plugins = new ArrayList<ScapeFXPlugin>();
plugins.add(new SampleSkin());
plugins.add(new SpecialCommands());
plugins.add(new SampleHost());
plugins.add(new TelnetNegotiator());
plugins.add(new GaugeMonitor());
return plugins;
}
