Guest User

Untitled

a guest
Oct 22nd, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1.  
  2. import java.awt.Color;
  3. import java.awt.Graphics;
  4. import java.awt.Point;
  5. import net.sharpf2.api.Script;
  6. import net.sharpf2.sfcore.bot.model.Manifest;
  7.  
  8.  
  9. /**
  10. *
  11. * @author Sam Smekens, Toktzza
  12. */
  13. @Manifest(name = "Player location", author = "Toktzza", description = "Show current player location", category = "Debug")
  14. public class PlayerLocation extends Script{
  15. Point p = new Point(-1, -1);
  16.  
  17. @Override
  18. public void onStart(){ }
  19.  
  20. @Override
  21. public void onStop(){ }
  22.  
  23. @Override
  24. public int loop(){
  25. if(getClient().getGamestate() == 11){
  26. p = getMyPlayer().getContent().getWorldPosition();
  27. }
  28. return 400;
  29. }
  30.  
  31. @Override
  32. public void paint(Graphics g){
  33. g.setColor(Color.YELLOW);
  34. g.drawString(p.x+", "+p.y, 10, 10);
  35. }
  36. }
Add Comment
Please, Sign In to add comment