Guest User

Untitled

a guest
Aug 3rd, 2015
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. import org.osbot.rs07.api.Interfaces;
  2. import org.osbot.rs07.api.Keyboard;
  3. import org.osbot.rs07.api.Mouse;
  4. import org.osbot.rs07.api.Trade;
  5. import org.osbot.rs07.api.Trade.OfferContainer;
  6. import org.osbot.rs07.api.ui.RS2InterfaceChild;
  7. import org.osbot.rs07.input.mouse.InterfaceDestination;
  8. import org.osbot.rs07.script.Script;
  9. import org.osbot.rs07.script.ScriptManifest;
  10.  
  11. @ScriptManifest(author="Chad0ck", info="Dances for money!", name="Master Dancer", version=1.00, logo="")
  12. public class DancingForMoney
  13. extends Script
  14. {
  15. public void onStart()
  16. {
  17. this.mouse.click(new InterfaceDestination(this.bot, this.interfaces.getChild(548, 22)));
  18. this.mouse.click(new InterfaceDestination(this.bot, this.interfaces.getChild(548, 36)));
  19. }
  20.  
  21. private static enum State
  22. {
  23. Spam, Accept;
  24. }
  25.  
  26. private DancingForMoney.State getState()
  27. {
  28. if (this.interfaces.getChild(137, 4).interact(new String[] { "Accept trade" })) {
  29. return DancingForMoney.State.Accept;
  30. }
  31. return DancingForMoney.State.Spam;
  32. }
  33.  
  34. public int onLoop()
  35. throws InterruptedException
  36. {
  37. switch (getState())
  38. {
  39. case Spam:
  40. sleep(500L);
  41. for (int counter = 0; counter < 15; counter++) {
  42. if (this.trade.getTheirOffers().isEmpty())
  43. {
  44. sleep(1000L);
  45. }
  46. else
  47. {
  48. for (int counter2 = 0; counter2 < 15; counter2++)
  49. {
  50. if (this.trade.isFirstInterfaceOpen()) {
  51. this.trade.acceptTrade();
  52. }
  53. sleep(1000L);
  54. }
  55. if (!this.trade.isSecondInterfaceOpen()) {
  56. break;
  57. }
  58. sleep(1500L);
  59. for (int counter2 = 0; counter2 < 15; counter2++) {
  60. if (this.trade.isSecondInterfaceOpen())
  61. {
  62. this.mouse.click(new InterfaceDestination(this.bot, this.interfaces.getChild(334, 20)));
  63. sleep(1000L);
  64. }
  65. }
  66. sleep(1000L);
  67. this.mouse.click(new InterfaceDestination(this.bot, this.interfaces.getChild(464, 13)));
  68. sleep(4000L);
  69. this.mouse.click(new InterfaceDestination(this.bot, this.interfaces.getChild(464, 14)));
  70. sleep(3000L);
  71. this.mouse.click(new InterfaceDestination(this.bot, this.interfaces.getChild(464, 16)));
  72. sleep(2500L);
  73. this.mouse.click(new InterfaceDestination(this.bot, this.interfaces.getChild(464, 15)));
  74. counter = 15;
  75. }
  76. }
  77. break;
  78. case Accept:
  79. this.keyboard.typeString("Dancing for Money!");
  80. sleep(5000L);
  81. }
  82. return random(150, 250);
  83. }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment