Advertisement
Guest User

Untitled

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