Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.scripts;
- import com.kbot2.scriptable.Script;
- import com.kbot2.scriptable.Random;
- import com.kbot2.scriptable.methods.Calculations;
- import com.kbot2.scriptable.methods.data.Walking;
- import com.kbot2.scriptable.methods.data.Interfaces;
- import com.kbot2.scriptable.methods.data.Skills;
- import com.kbot2.scriptable.methods.wrappers.Interface;
- import com.kbot2.scriptable.methods.wrappers.Obj;
- import com.kbot2.scriptable.methods.wrappers.Tile;
- import com.kbot2.scriptable.methods.wrappers.NPC;
- import com.kbot2.handlers.eventSystem.eventListeners.RandomListener;
- import com.kbot2.handlers.eventSystem.eventListeners.PaintListener;
- import javax.swing.*;
- import java.awt.*;
- import java.text.*;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import org.apache.commons.lang.ArrayUtils;
- public class AntibanTester extends Script {
- public boolean onStart(){
- log("Antiba script test");
- return true;
- }
- public String getName() {
- return "AntibanTester";
- }
- public String getAuthor() {
- return "DDMFat";
- }
- public String getDescription() {
- return "tests antiban.";
- }
- private long timeToNext;
- //Made by DDM
- public void actHuman() {
- if(timePassed(timeToNext)){
- int roll = (int) (Math.random() * 1000);
- if (timeToNext < System.currentTimeMillis()) {
- if (roll > 995) {
- highlightRandomPlayer();
- } else if (roll > 990 && getInventoryCount() < 23) {
- checkSkills();
- timeToNext = nextTime(2000, 4000);
- } else if (roll > 985 && getInventoryCount() < 23 && !RSInterface.getInterface(751).getChild(15).getText().contains("Off")) {
- checkFriendsList();
- timeToNext = nextTime(2000, 4000);
- } else if (roll > 960) {
- turnCameraRandom();
- } else if (roll > 940) {
- timeToNext = nextTime(2000, 4000);
- openTab(TAB_INVENTORY);
- } else if (roll > 890 && !isRunning() && getMyPlayer().isMoving() && !isResting()) {
- if(getEnergy() > 50)
- clickMouse(random(707, 762), random(90, 121), true);
- else {
- rest();
- while(isResting() && getEnergy() < 100){
- loop();
- wait(15);
- }
- wait(random(300, 800));
- clickMouse(random(707, 762), random(90, 121), true);
- }
- } else if (roll > 780) {
- moveMouseRandomly(500);
- timeToNext = nextTime(500, 7500);
- }
- }
- }
- }
- /**
- * VERY Human like method - great for anti bans!
- * This will move the mouse around the screen at a random distance between
- * 1 and maxDistance, but will sometimes move it more than one, like a human
- * would, resulting in cool effects like cursor circling and more.
- * @param maxDistance
- * @return true if it is going to call on itself again, false otherwise
- * (returns false to you every time)
- */
- public boolean moveMouseRandomly(int maxDistance) {
- if (maxDistance == 0) {
- return false;
- }
- maxDistance = random(1, maxDistance);
- Point p = new Point(getRandomMouseX(maxDistance), getRandomMouseY(maxDistance));
- if (p.x < 1 || p.y < 1) {
- p.x = p.y = 1;
- }
- moveMouse(p);
- if (random(0, 2) == 0) {
- return false;
- }
- return moveMouseRandomly(maxDistance / 2);
- }
- /**
- * Gives a X position on the screen within the maxDistance.
- * @param maxDistance the maximum distance the cursor will move on the X axis
- * @return A random int that represents a X coordinate for the
- * moveMouseRandomly method.
- */
- public int getRandomMouseX(int maxDistance) {
- Point p = getMousePos();
- if (random(0, 2) == 0) {
- return p.x - random(0, p.x < maxDistance ? p.x : maxDistance);
- } else {
- return p.x + random(1, (762 - p.x < maxDistance) ? 762 - p.x : maxDistance);
- }
- }
- /**
- * Gives a Y position on the screen within the maxDistance.
- * @param maxDistance the maximum distance the cursor will move on the Y axis
- * @return A random int that represents a Y coordinate for the
- * moveMouseRandomly method.
- */
- public int getRandomMouseY(int maxDistance) {
- Point p = getMousePos();
- if (random(0, 2) == 0) {
- return p.y - random(0, p.y < maxDistance ? p.y : maxDistance);
- } else {
- return p.y + random(1, (500 - p.y < maxDistance) ? 500 - p.y : maxDistance);
- }
- }
- }
Add Comment
Please, Sign In to add comment