Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.83 KB | None | 0 0
  1. import java.awt.FlowLayout;
  2. import java.util.Random;
  3.  
  4. import javax.swing.JCheckBox;
  5. import javax.swing.JFrame;
  6. import javax.swing.JOptionPane;
  7. import javax.swing.JPanel;
  8. import javax.swing.JTextArea;
  9. import javax.swing.event.ChangeEvent;
  10. import javax.swing.event.ChangeListener;
  11.  
  12. import org.rsbot.script.Script;
  13. import org.rsbot.script.ScriptManifest;
  14. import org.rsbot.script.methods.Game;
  15. import org.rsbot.script.wrappers.RSArea;
  16. import org.rsbot.script.wrappers.RSComponent;
  17. import org.rsbot.script.wrappers.RSInterface;
  18. import org.rsbot.script.wrappers.RSTile;
  19.  
  20. @ScriptManifest(authors = { "C123" }, keywords = "Doubling Scam", name = "C123MoneyDoubler", version = 2.4,description = "Doubling Money For You!")
  21. public class C123MoneyDoubler extends Script {
  22. String message;
  23. Random random = new Random();
  24. String effect[] = {"red:", "glow1:", "glow2:", "green:", "wave:", "wave2:", "cyan:", "green:", "white:", "flash2:"};
  25. String txt[] = {"Come on guys, try me! ", "Quitting RS ! Doubling all money 22M left! minumum 20k", "Quitting RS ! Doubling all money 22M left! minumum 20k"};
  26. String txt2[] = {"Quitting RS Doubling money 21m left! -- free 25k test try me", "Doubling money - Legit and pro guys!", "Doubling Money - Free 20k Test", "Double Money test me with 20k! T.R.U.S.T.E.D."};
  27. RSTile startTile;
  28. long timer2;
  29. boolean acceptAccepted = false;
  30. long timer = 0;
  31. public boolean isOnTradeWindow(){
  32. if(interfaces.get(334).isValid() || interfaces.get(335).isValid()){
  33. return true;
  34. }else{
  35. return false;
  36. }
  37. }
  38. public boolean onStart(){
  39. startTile = getMyPlayer().getLocation();
  40. acceptAccepted = (JOptionPane.showInputDialog("1. Accept when other person accepts? 2. Accept when other person adds money on trade? (1. = true, 2. = false").contains("true"));
  41. return true;
  42. }
  43.  
  44. public void dance(){
  45. if(!isOnTradeWindow()){
  46. RSInterface inter = interfaces.get(464);
  47. if(game.getCurrentTab() == 13){
  48. RSComponent dance = inter.getComponent(random(14,17));
  49. if(dance != null){
  50. if(timer < System.currentTimeMillis()){
  51. if(!isOnTradeWindow()){
  52. dance.doClick();
  53. }
  54. keyboard.sendTextInstant(effect[random.nextInt(effect.length)]+""+txt[random.nextInt(txt.length)], true);
  55. timer = System.currentTimeMillis()+7000;
  56. }
  57. }
  58. }else{
  59. game.openTab(13);
  60. }
  61. }else{
  62. RSInterface tradeOne = interfaces.get(335);
  63. if(tradeOne != null){
  64. RSComponent hasAccepted = tradeOne.getComponent(37);
  65. if(hasAccepted != null){
  66. if(acceptAccepted){
  67. if(hasAccepted.getText().contains("accepted")){
  68. RSComponent acceptOne = tradeOne.getComponent(17);
  69. if(acceptOne != null){
  70. acceptOne.doClick();
  71. }
  72. }
  73. }else{
  74. RSComponent wealth = tradeOne.getComponent(45);
  75. if(wealth != null){
  76. if(!wealth.getText().contains("transfer")){
  77. RSComponent acceptOne = tradeOne.getComponent(17);
  78. if(acceptOne != null){
  79. acceptOne.doClick();
  80. }
  81. }
  82. }
  83. }
  84. }
  85. }
  86. RSInterface tradeTwo = interfaces.get(334);
  87. if(tradeTwo != null){
  88. RSComponent acceptTwo = tradeTwo.getComponent(21);
  89. if(acceptTwo != null){
  90. acceptTwo.doClick();
  91. sleep(1000);
  92. }
  93. }
  94. }
  95. }
  96.  
  97. public void checkMessages(){
  98. if(!isOnTradeWindow()){
  99. RSInterface chatBox = interfaces.get(137);
  100. if(chatBox != null){
  101. for(int x = 180; x < 280; x++){
  102. if(chatBox.getComponent(x) != null && chatBox.getComponent(x).getAbsoluteY() > 330){
  103. String curCompText = chatBox.getComponent(x).getText();
  104. if(curCompText.contains("wishes to trade with you")){
  105. if(!isOnTradeWindow()){
  106. for(String y: chatBox.getComponent(x).getActions()){
  107. if(y.contains("trade"));
  108. chatBox.getComponent(x).doAction("trade");
  109. }
  110. sleep(1000);
  111. }
  112. }else if(curCompText.contains("Accepted trade.")){
  113. if(timer2 < System.currentTimeMillis()){
  114. keyboard.sendText("No Problem, bro. Come back in 30 minutes for your money, this takes a while >.<.", true);
  115. }
  116. }else if(curCompText.contains("Other player declined trade.")){
  117. if(timer2 < System.currentTimeMillis()){
  118. keyboard.sendText("No problem mate, quitting RS , this hour I double all money!", true);
  119. keyboard.sendText(txt2[random.nextInt(txt2.length)], true);
  120. timer2 = System.currentTimeMillis()+5000;
  121. }
  122. }
  123. }
  124. }
  125. }
  126. }
  127. }
  128.  
  129. public void checkArea(){
  130. if(!new RSArea(new RSTile(startTile.getX()-5, startTile.getY()-5), new RSTile(startTile.getX()+5, startTile.getY()+5)).contains(getMyPlayer().getLocation())){
  131. walking.walkTo(startTile);
  132. }
  133. }
  134.  
  135. @Override
  136. public int loop() {
  137. checkArea();
  138. checkMessages();
  139. dance();
  140. return 100;
  141. }
  142.  
  143. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement