Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.38 KB | None | 0 0
  1. import org.rsbot.script.*;
  2. import org.rsbot.script.wrappers.*;
  3.  
  4. import javax.swing.*;
  5. import javax.swing.event.*;
  6.  
  7. import org.rsbot.event.listeners.PaintListener;
  8. import org.rsbot.script.*;
  9. import org.rsbot.script.methods.Game;
  10. import org.rsbot.script.util.Timer;
  11.  
  12.  
  13. @ScriptManifest(authors = {"David"}, keywords = {""}, name = "RsbotTest", description = "Built by Mas410", version = 1)
  14.  
  15. public class RsbotTest extends Script{int [] ironRockID = {37309, 37307, 37308};
  16. int [] pickaxe = {1265, 1267, 1269, 1271, 1273, 1275, 14099, 14107, 15259};
  17.  
  18. @Override
  19. public boolean onStart() {
  20. AB.setVisible(true);
  21. while(AB.isVisible()){
  22. sleep(200);
  23. }
  24. return true;
  25. }
  26.  
  27. public int loop() {
  28.  
  29. if (!inventory.isFull()) {
  30. if (players.getMyPlayer().getAnimation() == -1) {
  31. RSObject rock = objects.getNearest(ironRockID);
  32. if (rock != null) {
  33. rock.doAction("Mine");
  34. }
  35. }
  36. }
  37. AB.antiBanMethod();
  38. if (AB.AFKTimer.isRunning()){return 200;}
  39. return random(500, 1500);
  40. }
  41.  
  42. @Override
  43. public void onFinish() {
  44.  
  45. if (AB.AFKTimer.isRunning()){
  46.  
  47. g.setColor(new Color(51, 51, 51, 150));
  48. g.fillRect(2, 1, 516, 336);
  49. g.setColor(new Color(255, 255, 255));
  50. g.drawRect(2, 1, 516, 336);
  51. g.setFont(new Font("Arial", 0, 12));
  52. g.drawString("Time Left in AFK: " + AB.AFKTimer.toRemainingString(), 147, 176);
  53. }
  54. }
  55.  
  56.  
  57. public AntiBan AB = new AntiBan();
  58. class AntiBan extends JFrame {
  59.  
  60. /*
  61. @Author Mas410
  62. @Date 5/8/2011
  63. */
  64. public Timer antiBanTimer = new Timer(0);
  65. public boolean customAB, AFK, Mouse, Camera, Tabs, LogOut, ABOn;
  66. public int ABFreq;
  67.  
  68. public double ABFreqTime;
  69. Timer AFKTimer = new Timer (0);
  70. public void antiBanMethod(){
  71. if (ABOn){
  72. if (!antiBanTimer.isRunning() && !AFKTimer.isRunning()){
  73. antiBan();
  74. antiBanTimer.setEndIn((int)random(ABFreqTime * .33, ABFreqTime * 1.66));
  75. }
  76. }
  77. }
  78.  
  79.  
  80.  
  81.  
  82. public void antiBan(){
  83. int t = 0;
  84. if (Camera){t++;};
  85. if (Tabs){t++;};
  86. if (AFK){t++;};
  87. if (Mouse){t++;};
  88. t += 0;
  89. switch(random(1, t)){
  90. case 1:
  91. if (Camera){
  92. camera.turnTo(getMyPlayer().getLocation().randomize(5, 5), 5);
  93. sleep(random(500, 750));
  94. return;
  95. }
  96. case 2:
  97. if (Tabs){
  98. switch(random(1, 4)){
  99. case 1:
  100. game.openTab(Game.TAB_FRIENDS);
  101. mouse.move((585+random(-35, 35)), (330+random(-90, 90)));
  102. sleep(750, 3000);
  103. game.openTab(Game.TAB_INVENTORY);
  104. sleep(random(500, 750));
  105. return;
  106.  
  107. case 2:
  108. game.openTab(Game.TAB_CLAN);
  109. mouse.move((585+random(-35, 35)), (330+random(-90, 90)));
  110. sleep(750, 1500);
  111. game.openTab(Game.TAB_INVENTORY);
  112. sleep(random(500, 750));
  113. return;
  114.  
  115. default:
  116. game.openTab(game.TAB_STATS);
  117. mouse.moveRandomly(random(1, 300));
  118. sleep(750, 1500);
  119. game.openTab(Game.TAB_INVENTORY);
  120. sleep(random(500, 750));
  121. return;
  122. }
  123. }
  124. case 3:
  125. if (AFK){
  126. int r = random(1, 100);
  127. if (r < 75){
  128. AFKTimer.setEndIn(random(3000, 5000));
  129. } else if (r >= 70 && r < 90){
  130. AFKTimer.setEndIn(random(5000, 15000));
  131. } else {
  132. AFKTimer.setEndIn(random(10000, 30000));
  133. }
  134. return;
  135. }
  136. case 4:
  137. if (Mouse){
  138. int s = random(1, 4);
  139. switch(s){
  140. case 1:
  141. mouse.moveOffScreen();
  142. sleep(750, 1500);
  143. return;
  144. case 2:
  145. mouse.moveSlightly();
  146. sleep(500, 1000);
  147. return;
  148. case 3:
  149. mouse.moveRandomly(random(1, 300));
  150. sleep(750, 1500);
  151. return;
  152. default:
  153. return;
  154. }
  155.  
  156. }
  157. default:
  158. return;
  159. }
  160. }
  161. public void setEnabled(boolean a, boolean b, boolean c, boolean d,
  162. boolean e, boolean f, boolean g, boolean h,
  163. boolean i, boolean j, boolean k, boolean l){
  164.  
  165. ABFreqSlider.setEnabled(a);
  166. ABOnOff.setEnabled(b);
  167. customAntiBanButton.setEnabled(c);
  168. ABLevelOptions.setEnabled(d);
  169. separator1.setEnabled(e);
  170. ABFreqLabel.setEnabled(f);
  171. AFKCheck.setEnabled(g);
  172. mouseMoveCheck.setEnabled(h);
  173. camMoveCheck.setEnabled(i);
  174. logOutCheck.setEnabled(j);
  175. openTabsCheck.setEnabled(k);
  176. ABLevelLabel.setEnabled(l);
  177.  
  178. }
  179.  
  180. public void getSettings(){
  181. if (!ABOnOff.isSelected()){
  182. ABOn = true;
  183. if (customAntiBanButton.isSelected()){
  184. customAB = true;
  185. ABFreq = ABFreqSlider.getValue();
  186. AFK = AFKCheck.isSelected();
  187. Mouse = mouseMoveCheck.isSelected();
  188. Camera = camMoveCheck.isSelected();
  189. Tabs = openTabsCheck.isSelected();
  190. LogOut = logOutCheck.isSelected();
  191. } else {
  192. customAB = false;
  193. if (ABLevelOptions.getSelectedItem().toString().contains("Low")) {
  194. ABFreq = 20;
  195. LogOut = true;
  196. Camera = true;
  197. Mouse = true;
  198.  
  199. } else if (ABLevelOptions.getSelectedItem().toString().contains("Medium")) {
  200. ABFreq = 40;
  201. Mouse = true;
  202. LogOut = true;
  203. Camera = true;
  204. AFK = true;
  205.  
  206. } else if (ABLevelOptions.getSelectedItem().toString().contains("High")) {
  207. ABFreq = 60;
  208. LogOut = true;
  209. Camera = true;
  210. Tabs = true;
  211. AFK = true;
  212. Mouse = true;
  213. }
  214. }
  215. log("AntiBan on");
  216. ABFreqTime = ((double)(240 / ABFreq) * 15000);
  217. antiBanTimer = new Timer ((int)random(ABFreqTime * .5, ABFreqTime * 1.5));
  218. } else {
  219. log("AntiBan off");
  220. ABOn = false;
  221. }
  222.  
  223. }
  224. public void ABToggle(){
  225. if ((ABOnOff.isSelected())){
  226. setEnabled(false, true, false, false, false, false, false, false, false, false, false, false);
  227. } else {
  228. if (customAntiBanButton.isSelected()){
  229. setEnabled(true, true, true, false, true, true, true, true, true, false, true, false);
  230. } else {
  231. setEnabled(false, true, true, true, true, false, false, false, false, false, false, true);
  232. }
  233. }
  234. }
  235. public void cantCont(){
  236. if ((customAntiBanButton.isSelected() && !AFKCheck.isSelected() && !mouseMoveCheck.isSelected()
  237. && !camMoveCheck.isSelected() && !openTabsCheck.isSelected()) || ABFreqSlider.getValue() == 0){
  238. contButton.setEnabled(false);
  239. } else {
  240. contButton.setEnabled(true);
  241. }
  242. }
  243.  
  244. public AntiBan() {
  245. initComponents();
  246. }
  247.  
  248. private void ABFreqSliderStateChanged(ChangeEvent e) {
  249. cantCont();
  250. }
  251.  
  252. private void ABOnOffStateChanged(ChangeEvent e) {
  253. ABOnOff.setToolTipText("The AntiBan is currently: " + content());
  254. ABOnOff.setText("Turn AntiBan " + OPcontent());
  255. ABToggle();
  256. cantCont();
  257. }
  258.  
  259. private void customAntiBanButtonStateChanged(ChangeEvent e) {
  260. ABToggle();
  261. cantCont();
  262. }
  263.  
  264. private void AFKCheckStateChanged(ChangeEvent e) {
  265. cantCont();
  266. }
  267.  
  268. private void mouseMoveCheckStateChanged(ChangeEvent e) {
  269. cantCont();
  270. }
  271.  
  272. private void camMoveCheckStateChanged(ChangeEvent e) {
  273. cantCont();
  274. }
  275.  
  276. private void logOutCheckStateChanged(ChangeEvent e) {
  277. cantCont();
  278. }
  279.  
  280. private void openTabsCheckStateChanged(ChangeEvent e) {
  281. cantCont();
  282. }
  283.  
  284. private void contButtonActionPerformed(ActionEvent e) {
  285. getSettings();
  286. setVisible(false);
  287. }
  288.  
  289.  
  290. String content(){
  291. if (ABOnOff.isSelected()){
  292. return "OFF";
  293. } else {
  294. return "ON";
  295. }
  296. }
  297. String OPcontent(){
  298. if (!ABOnOff.isSelected()){
  299. return "OFF";
  300. } else {
  301. return "ON";
  302. }
  303. }
  304. private void initComponents() {
  305. ABFreqSlider = new JSlider();
  306. ABOnOff = new JToggleButton();
  307. customAntiBanButton = new JRadioButton();
  308. ABLevelOptions = new JComboBox();
  309. separator1 = new JSeparator();
  310. ABFreqLabel = new JLabel();
  311. AFKCheck = new JRadioButton();
  312. mouseMoveCheck = new JRadioButton();
  313. camMoveCheck = new JRadioButton();
  314. logOutCheck = new JRadioButton();
  315. openTabsCheck = new JRadioButton();
  316. ABLevelLabel = new JLabel();
  317. contButton = new JButton();
  318.  
  319. addWindowListener(new WindowAdapter() {
  320. public void windowClosing(WindowEvent e) {
  321. stopScript();
  322. }
  323. });
  324. //======== this ========
  325. setTitle("AntiBan");
  326. Container contentPane = getContentPane();
  327. //---- ABFreqSlider ----
  328. ABFreqSlider.setMajorTickSpacing(40);
  329. ABFreqSlider.setSnapToTicks(true);
  330. ABFreqSlider.setPaintTicks(true);
  331. ABFreqSlider.setBackground(new Color(238, 238, 238));
  332. ABFreqSlider.setEnabled(false);
  333. ABFreqSlider.setPaintLabels(true);
  334. ABFreqSlider.setMinorTickSpacing(8);
  335. ABFreqSlider.setMaximum(240);
  336. ABFreqSlider.setValue(60);
  337. ABFreqSlider.setToolTipText("Allows you to select the average amount of AntiBans per hour");
  338. ABFreqSlider.addChangeListener(new ChangeListener() {
  339. @Override
  340. public void stateChanged(ChangeEvent e) {
  341. ABFreqSliderStateChanged(e);
  342. }
  343. });
  344.  
  345. //---- ABOnOff ----
  346. ABOnOff.setText("Turn AntiBan Off");
  347.  
  348. ABOnOff.setToolTipText("The AntiBan is currently: ON");
  349. ABOnOff.addChangeListener(new ChangeListener() {
  350. @Override
  351. public void stateChanged(ChangeEvent e) {
  352. ABOnOffStateChanged(e);
  353. }
  354. });
  355.  
  356. //---- customAntiBanButton ----
  357. customAntiBanButton.setText("Custumized AntiBan");
  358. customAntiBanButton.setToolTipText("Enables you to customize your AntiBan");
  359. customAntiBanButton.addChangeListener(new ChangeListener() {
  360. @Override
  361. public void stateChanged(ChangeEvent e) {
  362. customAntiBanButtonStateChanged(e);
  363. }
  364. });
  365.  
  366. //---- ABLevelOptions ----
  367. ABLevelOptions.setModel(new DefaultComboBoxModel(new String[] {
  368. "Low",
  369. "Medium",
  370. "High"
  371. }));
  372. ABLevelOptions.setSelectedIndex(2);
  373. ABLevelOptions.setToolTipText("Selects the level of AntiBan");
  374. //---- separator1 ----
  375. separator1.setForeground(new Color(100, 100, 100));
  376. //---- ABFreqLabel ----
  377. ABFreqLabel.setText("Avg. AntiBans P/H");
  378. ABFreqLabel.setToolTipText("Average. AntiBans per hour");
  379. ABFreqLabel.setEnabled(false);
  380.  
  381. //---- AFKCheck ----
  382. AFKCheck.setText("AFK's");
  383. AFKCheck.setEnabled(false);
  384. AFKCheck.setToolTipText("If checked, the AntiBan will perform AFK's");
  385. AFKCheck.addChangeListener(new ChangeListener() {
  386. @Override
  387. public void stateChanged(ChangeEvent e) {
  388. AFKCheckStateChanged(e);
  389. }
  390. });
  391.  
  392. //---- mouseMoveCheck ----
  393. mouseMoveCheck.setText("Mouse MoveMents");
  394. mouseMoveCheck.setEnabled(false);
  395. mouseMoveCheck.setToolTipText("If checked, the AntiBan will move the mouse");
  396. mouseMoveCheck.addChangeListener(new ChangeListener() {
  397. @Override
  398. public void stateChanged(ChangeEvent e) {
  399. mouseMoveCheckStateChanged(e);
  400. }
  401. });
  402.  
  403. //---- camMoveCheck ----
  404. camMoveCheck.setText("Camera Movements");
  405. camMoveCheck.setEnabled(false);
  406. camMoveCheck.setToolTipText("If checked, the AntiBan will move the camera");
  407. camMoveCheck.addChangeListener(new ChangeListener() {
  408. @Override
  409. public void stateChanged(ChangeEvent e) {
  410. camMoveCheckStateChanged(e);
  411. }
  412. });
  413.  
  414. //---- logOutCheck ----
  415. logOutCheck.setText("Log Out if Innactive");
  416. logOutCheck.setEnabled(false);
  417. logOutCheck.setVisible(false);
  418. logOutCheck.setToolTipText("Currently under construction");
  419. logOutCheck.addChangeListener(new ChangeListener() {
  420. @Override
  421. public void stateChanged(ChangeEvent e) {
  422. logOutCheckStateChanged(e);
  423. }
  424. });
  425.  
  426. //---- openTabsCheck ----
  427. openTabsCheck.setText("Open Tabs");
  428. openTabsCheck.setEnabled(false);
  429. openTabsCheck.setToolTipText("If checked, the AntiBan will open your friends list tab");
  430. openTabsCheck.addChangeListener(new ChangeListener() {
  431. @Override
  432. public void stateChanged(ChangeEvent e) {
  433. openTabsCheckStateChanged(e);
  434. }
  435. });
  436.  
  437. //---- ABLevelLabel ----
  438. ABLevelLabel.setText("AntiBan Level");
  439. ABLevelLabel.setToolTipText("AntiBan Level");
  440.  
  441. //---- contButton ----
  442. contButton.setText("Continue");
  443. contButton.setToolTipText("Starts the Script");
  444. contButton.addActionListener(new ActionListener() {
  445. @Override
  446. public void actionPerformed(ActionEvent e) {
  447. contButtonActionPerformed(e);
  448. }
  449. });
  450.  
  451. GroupLayout contentPaneLayout = new GroupLayout(contentPane);
  452. contentPane.setLayout(contentPaneLayout);
  453. contentPaneLayout.setHorizontalGroup(
  454. contentPaneLayout.createParallelGroup()
  455. .addGroup(contentPaneLayout.createSequentialGroup()
  456. .addGroup(contentPaneLayout.createParallelGroup()
  457. .addGroup(contentPaneLayout.createSequentialGroup()
  458. .addGap(102, 102, 102)
  459. .addComponent(ABOnOff, GroupLayout.PREFERRED_SIZE, 182, GroupLayout.PREFERRED_SIZE))
  460. .addGroup(contentPaneLayout.createSequentialGroup()
  461. .addContainerGap()
  462. .addGroup(contentPaneLayout.createParallelGroup()
  463. .addGroup(contentPaneLayout.createSequentialGroup()
  464. .addComponent(ABFreqLabel)
  465. .addGap(12, 12, 12)
  466. .addComponent(ABFreqSlider, GroupLayout.PREFERRED_SIZE, 260, GroupLayout.PREFERRED_SIZE))
  467. .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
  468. .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  469. .addComponent(ABLevelLabel)
  470. .addComponent(customAntiBanButton, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE))
  471. .addGroup(contentPaneLayout.createParallelGroup()
  472. .addGroup(contentPaneLayout.createSequentialGroup()
  473. .addGap(18, 18, 18)
  474. .addComponent(separator1, GroupLayout.PREFERRED_SIZE, 164, GroupLayout.PREFERRED_SIZE))
  475. .addGroup(contentPaneLayout.createSequentialGroup()
  476. .addGap(27, 27, 27)
  477. .addComponent(ABLevelOptions, GroupLayout.PREFERRED_SIZE, 140, GroupLayout.PREFERRED_SIZE)))
  478. .addGap(96, 96, 96))))
  479. .addGroup(contentPaneLayout.createSequentialGroup()
  480. .addGap(20, 20, 20)
  481. .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.TRAILING, false)
  482. .addGroup(contentPaneLayout.createSequentialGroup()
  483. .addComponent(mouseMoveCheck)
  484. .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  485. .addComponent(logOutCheck))
  486. .addGroup(contentPaneLayout.createSequentialGroup()
  487. .addComponent(openTabsCheck)
  488. .addGap(18, 18, 18)
  489. .addComponent(AFKCheck)
  490. .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
  491. .addComponent(camMoveCheck))))
  492. .addGroup(contentPaneLayout.createSequentialGroup()
  493. .addGap(109, 109, 109)
  494. .addComponent(contButton, GroupLayout.PREFERRED_SIZE, 167, GroupLayout.PREFERRED_SIZE)))
  495. .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  496. );
  497. contentPaneLayout.setVerticalGroup(
  498. contentPaneLayout.createParallelGroup()
  499. .addGroup(contentPaneLayout.createSequentialGroup()
  500. .addGap(10, 10, 10)
  501. .addComponent(ABOnOff)
  502. .addGap(18, 18, 18)
  503. .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
  504. .addComponent(ABLevelLabel)
  505. .addComponent(ABLevelOptions, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
  506. .addGroup(contentPaneLayout.createParallelGroup()
  507. .addGroup(contentPaneLayout.createSequentialGroup()
  508. .addGap(18, 18, 18)
  509. .addComponent(customAntiBanButton, GroupLayout.PREFERRED_SIZE, 44, GroupLayout.PREFERRED_SIZE))
  510. .addGroup(contentPaneLayout.createSequentialGroup()
  511. .addGap(35, 35, 35)
  512. .addComponent(separator1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
  513. .addGroup(contentPaneLayout.createParallelGroup()
  514. .addGroup(contentPaneLayout.createSequentialGroup()
  515. .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  516. .addComponent(ABFreqSlider, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
  517. .addGroup(contentPaneLayout.createSequentialGroup()
  518. .addGap(26, 26, 26)
  519. .addComponent(ABFreqLabel)))
  520. .addGap(15, 15, 15)
  521. .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
  522. .addComponent(openTabsCheck)
  523. .addComponent(AFKCheck)
  524. .addComponent(camMoveCheck))
  525. .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
  526. .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
  527. .addComponent(logOutCheck)
  528. .addComponent(mouseMoveCheck))
  529. .addGap(18, 18, 18)
  530. .addComponent(contButton)
  531. .addContainerGap(12, Short.MAX_VALUE))
  532. );
  533. pack();
  534. setLocationRelativeTo(getOwner());
  535. // JFormDesigner - End of component initialization //GEN-END:initComponents
  536. }
  537.  
  538. // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
  539. // Generated using JFormDesigner Evaluation license - Joe Titus
  540. private JSlider ABFreqSlider;
  541. private JToggleButton ABOnOff;
  542. private JRadioButton customAntiBanButton;
  543. private JComboBox ABLevelOptions;
  544. private JSeparator separator1;
  545. private JLabel ABFreqLabel;
  546. private JRadioButton AFKCheck;
  547. private JRadioButton mouseMoveCheck;
  548. private JRadioButton camMoveCheck;
  549. private JRadioButton logOutCheck;
  550. private JRadioButton openTabsCheck;
  551. private JLabel ABLevelLabel;
  552. private JButton contButton;
  553. // JFormDesigner - End of variables declaration //GEN-END:variables
  554. }
  555. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement