Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package scripts;
- import java.awt.Color;
- import java.awt.Graphics;
- import com.kbotpro.scriptsystem.events.PaintEventListener;
- import com.kbotpro.scriptsystem.interfaces.Looped;
- import com.kbotpro.scriptsystem.runnable.Script;
- public class TestScript extends Script implements PaintEventListener
- {
- public boolean canStart()
- {
- return true;
- }
- public void pause()
- {
- log.log("We have aids");
- }
- public String getName()
- {
- return "Test Script";
- }
- public void onStart()
- {
- log.logIrrelevant("Started");
- }
- public void registerWorkers()
- {
- createWorker(new Looped()
- {
- private int counter = 0;
- public int loop()
- {
- ++counter;
- if (counter < 15)
- {
- log.log("Looped around " + counter + " times");
- return 1000;
- }
- else
- {
- return -1;
- }
- }
- } );
- }
- public void stop()
- {
- // TODO Auto-generated method stub
- }
- public void onRepaint(Graphics graphics)
- {
- graphics.setColor(Color.red);
- graphics.drawString("This is the paint", 20, 20);
- }
- }
Add Comment
Please, Sign In to add comment