Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
ScriptsForMains

Can someone double check my ABC2?

Recommended Posts

Looking at approved scripters' version of antiban, it's all extremely complicated.  The tutorial doesn't really make it easy to follow.  I believe I've correctly implemented it.  Can a more experienced scripter confirm this? Timed actions is pretty straightforward...  This is my implementation of hovering / option menu and generating reaction times based off those options. I wanted to make a tutorial but don't want to do that if I'm doing this wrong.   Thanks!!

The script: 

public void openPlantPacks() {
    RSItem[] potPack = Inventory.find("Plant pot pack");
    int whichPot = General.random(0, Inventory.getCount("Plant pot pack") - 1);
    potPack[whichPot].click("Open");
    hoveringOrOptionMenu = false;
    if (abc2Check) {
        if (abcUtil.shouldOpenMenu()) {
            if (vanessa[0].isOnScreen()) {
                if (!ChooseOption.isOpen()) {
                    General.println("Opening option menu (ABC2)");
                    DynamicClicking.clickRSNPC(vanessa[0], 3);
                    abcUtil.setOptionMenuOpen(true);
                    hoveringOrOptionMenu = true;
                } else
                    abcUtil.setOptionMenuOpen(false);
            }
        } else if (abcUtil.shouldHover()) {
            if (vanessa[0].isOnScreen()) {
                General.println("Hovering target (ABC2)");
                vanessa[0].hover();
                abcUtil.setHovering(true);
                hoveringOrOptionMenu = true;
            }
        } else
            abcUtil.setHovering(false);

    }

    int potPackCount = Inventory.getCount("Plant pot pack");
    int currentPotPack = potPackCount;
    int unPacked = 0;
    int loopCount = 0;
    status = "Opening packs.";
    while (Inventory.getCount("Plant pot pack") > 0) { //Keeps running tally of pots while opening
        sleep(1200);
        loopCount++;
        if (loopCount > potPackCount) {
            println("Script iterated through pack opening more time than expected, ending script to avoid bans");
            shouldRun = false;
            break;
        }

        unPacked = currentPotPack - Inventory.getCount("Plant pot pack");
        currentPotPack = Inventory.getCount("Plant pot pack");
        potCount = potCount + (unPacked * 100);
        safetyCheck();
    }
    if (abc2Check)
        try {
            abcUtil.sleep(abcUtil.ABC2ReactionTime(1200 * 26)); //26 pot packs, 1200ms each
        } catch (InterruptedException ie) {
            General.println("ABC2 sleep - exception thrown");
        }
}

The ABC2 class: 

package scripts.my_api;

import org.tribot.api.General;
import org.tribot.api.util.abc.ABCProperties;
import org.tribot.api.util.abc.ABCUtil;

public class ABC2 extends ABCUtil {
    private boolean isHovering=false;
    private boolean isInOptionMenu=false;

    public void checkAntiBanTimers(){
        // Here our player is idling, so we can check/perform the timed actions.
        if (this.shouldCheckTabs())
            this.checkTabs();

        if (this.shouldCheckXP())
            this.checkXP();

        if (this.shouldExamineEntity())
            this.examineEntity();

        if (this.shouldMoveMouse())
            this.moveMouse();

        if (this.shouldPickupMouse())
            this.pickupMouse();

        if (this.shouldRightClick())
            this.rightClick();

        if (this.shouldRotateCamera())
            this.rotateCamera();

        if (this.shouldLeaveGame())
            this.leaveGame();
    }

    public void setHovering(boolean hovering){
        isHovering = hovering;
    }

    public void setOptionMenuOpen(boolean optionsOpen){
        isInOptionMenu = optionsOpen;
    }

    public int ABC2ReactionTime(int waitingTime){
        long menuOpenOption = isHovering ? ABCUtil.OPTION_MENU_OPEN : 0;
        long hoverOption = isInOptionMenu ? ABCUtil.OPTION_HOVERING : 0;

        int reactionTime = this.generateReactionTime(this.generateBitFlags(waitingTime,menuOpenOption,hoverOption));
        General.println("ABC2 reaction time: "+reactionTime);
        return reactionTime;
    }
}

Share this post


Link to post
Share on other sites
Posted (edited)

Before doing an action should do this:

if (Vars.get().WAIT_TIMES.isEmpty())
				Antiban.generateTrackers(General.random(2137, 3352), false);
			else
				Antiban.generateTrackers(Utils.get().calculateAverage(Vars.get().WAIT_TIMES), false);
			final int reaction_time = Antiban.getReactionTime();
			Vars.get().WAIT_TIMES.add(reaction_time);
			Antiban.sleepReactionTime();

After timing and completing the action should looks something like this:

Antiban.generateTrackers((int) (System.currentTimeMillis() - start), false);
Vars.get().WAIT_TIMES.add(Antiban.getReactionTime());

Also during an action like "woodcutting" you should use:

Antiban.timedActions();

Hope this helps man!

If you'd like for me to provide the Antiban used for the above file PM me.

Edited by Miracle

Share this post


Link to post
Share on other sites
On 5/20/2019 at 12:24 AM, Miracle said:

Before doing an action should do this:

if (Vars.get().WAIT_TIMES.isEmpty())
				Antiban.generateTrackers(General.random(2137, 3352), false);
			else
				Antiban.generateTrackers(Utils.get().calculateAverage(Vars.get().WAIT_TIMES), false);
			final int reaction_time = Antiban.getReactionTime();
			Vars.get().WAIT_TIMES.add(reaction_time);
			Antiban.sleepReactionTime();

After timing and completing the action should looks something like this:

Antiban.generateTrackers((int) (System.currentTimeMillis() - start), false);
Vars.get().WAIT_TIMES.add(Antiban.getReactionTime());

Also during an action like "woodcutting" you should use:

Antiban.timedActions();

Hope this helps man!

If you'd like for me to provide the Antiban used for the above file PM me.

@Miracle thanks for responding :)

Does generateTrackers() create variables that are used in the timed actions?  I'm a little confused by the api: 
image.png.d425dee894b1ba63fe1ee38550b18a51.png

Share this post


Link to post
Share on other sites
On 5/27/2019 at 5:28 PM, ScriptsForMains said:

@Miracle thanks for responding :)

Does generateTrackers() create variables that are used in the timed actions?  I'm a little confused by the api: 
image.png.d425dee894b1ba63fe1ee38550b18a51.png

I'm no expert by any means, but this is what I have written down in my Antiban class when I was learning this

* Generates variables that are essential in performing anti-ban, while the player is waiting for something. To be
* more specific, it targets how often the mouse should leave the game area. When an entity is clicked which
* requires the player to wait a variable amount of time, this method should be called right after.
*
* You should implement reaction times (and generate trackers off that reaction time) anytime you are performing
* an action that will take a variable amount of time. You might find it is too slow, but this is how ABC2 works
* for everything.
*
* Should be called after the action we are reacting too (i.e. after reacting to not chopping tree) and after the
* sleep. After this, ABCUtil should leave game and leave game should be called. This can be done via calling
* timedActions defined in this class.

 

For an example, I have this after I click an agility obstacle:

updateWaitTime((int) (Timing.currentTimeMillis() - currentTime));
int reactionTime = Antiban.get().generateReactionTime(averageWaitingTime);
Antiban.get().sleepReactionTime(reactionTime);
Antiban.get().generateTrackers(reactionTime,false);
Antiban.get().timedActions();

 

Share this post


Link to post
Share on other sites
On 6/12/2019 at 2:05 PM, TheGengar said:

I'm no expert by any means, but this is what I have written down in my Antiban class when I was learning this

* Generates variables that are essential in performing anti-ban, while the player is waiting for something. To be
* more specific, it targets how often the mouse should leave the game area. When an entity is clicked which
* requires the player to wait a variable amount of time, this method should be called right after.
*
* You should implement reaction times (and generate trackers off that reaction time) anytime you are performing
* an action that will take a variable amount of time. You might find it is too slow, but this is how ABC2 works
* for everything.
*
* Should be called after the action we are reacting too (i.e. after reacting to not chopping tree) and after the
* sleep. After this, ABCUtil should leave game and leave game should be called. This can be done via calling
* timedActions defined in this class.

 

For an example, I have this after I click an agility obstacle:

updateWaitTime((int) (Timing.currentTimeMillis() - currentTime));
int reactionTime = Antiban.get().generateReactionTime(averageWaitingTime);
Antiban.get().sleepReactionTime(reactionTime);
Antiban.get().generateTrackers(reactionTime,false);
Antiban.get().timedActions();

 

Yeah thanks a lot man I figured it out a while back this is an old post. This will help a lot of new comers.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Our picks

    • This update features:

      Fixed broken hooks from today's update


      Fix wilderness level with RuneLite (Thanks @Todd)


      Add support for Kotlin .class files in scripts (Thanks @wastedbro)


      Overhaul Inventory API (Thanks @wastedbro)


      Add List support for common methods


      Change method grouping to make more sense (by functionality)


      Refactor methods to utilize Java 8 streams instead of cumbersome loops




      Recognize chatbox minimization (Thanks @JoeDezzy1)


      Fix Screen#isInViewport when NPC chat is open (Thanks @JoeDezzy1)


      Fix login bot bugs (Thanks @erickho123)


      Fix hint arrow return values (Thanks @Encoded)


      Fix depositAllExcept functionality (Thanks @wastedbro)


      Change containing box interface bound and adjust for Y values (Thanks @erickho123)
        • Like
      • 148 replies
    • This release will:

      Fix prayers and world hopper API (Thanks @JoeDezzy1 and @erickho123)


      Improve banking API (Thanks @Encoded)


      Adds methods for returning and using Java Lists, rather than arrays


      Slightly randomizes some hardcoded behaviour


      Removes sleeps from waitConditions; the efficiency saving potential is negligible in these use-cases, therefore cleaner code is preferable


      Other back-end improvements





      Note: If you are using LG, please restart both the RS client and TRiBot.
        • Sad
        • Haha
        • Thanks
        • Like
      • 90 replies
    • This release will:

      Add new internal framework for capturing exceptions


      Fix issue with not selecting the last column in world hopper (Thanks @Todd)


      Add a message about pin usage in Banking#openBank (Thanks @Todd)


      Disable the firewall by default (Thanks @Todd)


      Fix handling of the welcome screen after login (Thanks @Encoded)


      Fix wrong amount bank withdrawal (Thanks @Encoded)


      Fix Screen#isInViewport


      Fix Game#isInViewport (Thanks @Encoded)


      Call onBreakEnd for ListenerManager Breaking Listeners (Thanks @Encoded)


      Fix Prayer#getPrayerPoints NumberFormatException (Thanks @JoeDezzy1)



      Note: If you are using LG, please restart both the RS client and TRiBot.
        • Thanks
        • Like
      • 28 replies
    • This release will:

      Fix LG for both OSBuddy and RuneLite


      Fix issue where the resizable client isn't able to be made smaller (Thanks @JoeDezzy1)


      Fix detection of the logout game tab when resizable mode and side panels are enabled (Thanks @JoeDezzy1)


      Add initial support for Sentry to allow us to identify and easily debug exceptions happening with all TRiBot users


      Add methods to determine if the bank is actually loaded, and not just the overarching interface (Thanks @wastedbro)



      Upcoming updates:

      Improved CLI support


      Full Sentry support


      Much more
        • Like
      • 64 replies
    • This release will:

      Fix NPE in Camera API (Thanks @wastedbro)


      Update deposit box interface ids (Thanks @Encoded)


      Add various bank methods (Thanks @wastedbro)


      Banking#getWithdrawXQuantity


      Banking#getDefaultWithdrawQuantity


      Banking#arePlaceholdersOn




      Fix resizeable minimap bug (Thanks @wastedbro)


      Remove Java 8 requirement


      Please note: TRiBot is not yet fully compatible with Java 10+




      Fix the break handler issues by ensuring the break handler thread never gets paused


      Fix broken settings hooks



      Upcoming updates:

      Improved CLI support


      Much more



      Note: If you are using LG, please restart both the RS client and TRiBot
        • Like
      • 68 replies
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...