Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

TheGengar

Registered
  • Content Count

    49
  • Joined

  • Last visited

  • Feedback

    N/A

Community Reputation

7 Neutral

About TheGengar

  • Rank
    New Botter

Personal

  • Sex
    Male

Recent Profile Visitors

843 profile views
  1. What I do for next target is instead of finding one via Antiban class before you click it, I do it after. For instance, see the following example for fishing: if (nextTarget == null) { nextTarget = fishingSpots[0]; } // Ensure menu isn't open for next entity, if it is, click it via options. if (ChooseOption.isOpen()) { ChooseOption.select("Bait Fishing spot"); } else { // If not, check if it's on screen if (!nextTarget.isOnScreen()) { Camera.turnToTile(nextTarget.getPosition()); } // Ensure uptext is fishing, if not right click it and fish. nextTarget.click(); } // Prior to idle scripts.gengarlibrary.Antiban procedures nextTarget = Antiban.get().getNextTarget(constructNextFishingSpots(fishingSpots)); This makes it so that if you already have a value for target you won't override it. You prob will need an added check to ensure the rock isn't depleted. As for your first jot, I would add print statements to ensure it is or isn't being called.
  2. I remember when I first encountered this issue, I was stuck for hours, not realizing what was going wrong lmao.
  3. I check via uptext to ensure that it is the right one. I think with those methods, if u input a string, then it will ensure it clicks it via a right click if it has to. Here's one of my "universal" clicking methods if you want something as reference. Not for your purpose I think what I said is fine, this is just for reference. /** * A safe way to ensure that you click an object. * * When normally clicking, other {@code Positionables} may obstruct your path, making you click on them instead. If * such case occurs, it would simply do a right click and click the uptext option. * * @param desiredUptext The option that you want to select * @return true if successful click, false otherwise */ private static boolean safeClick(String desiredUptext) { // fail safe for spam right click on option if (ChooseOption.isOpen()) { ChooseOption.select("Cancel"); System.out.println("safeClick: Option right click was open, cancelling options..."); return false; } // Before clicking, ensure nothing is in the way if (!Game.isUptext(desiredUptext)) { Mouse.click(3); if (Timing.waitChooseOption(desiredUptext, 500)) { ChooseOption.select(desiredUptext); // cant return this for w.e reason always false? return true; } else { ChooseOption.select("Cancel"); return false; } } else { Mouse.click(1); return true; } } /** * With supplied parameters, ensures that the entity will be clicked. * * Does all the null checking, camera movement, zoom out to ensure the above goal is met. If returns false, you * need to make the account walk to object and recall. * * @param clickableEntity An entity that is clickable and has a position * @param uptext String value representing the uptext when mouse hovers the npc * @param animation Desired animation when interacting with object. -1 if no animation to occur. * @return True if click was successful, false otherwise. **/ private static <T extends Clickable07 & Positionable> boolean clickEntity(T clickableEntity, String uptext, int animation) { if (!clickableEntity.isClickable() && !attemptAimCamera(clickableEntity)) { System.out.println("clickEntity: Unable to click entity. It is too far away; resolve from caller."); return false; } clickableEntity.hover(); Timing.waitUptext(uptext, General.random(650, 800)); BooleanSupplier boolSupp = animation == -1 ? GBooleanSuppliers.waitToStopMoving() : GBooleanSuppliers.waitForAnimation(animation); // Split into two if statements for readability if (clickableEntity.getPosition().distanceTo(Player.getPosition()) <= 1) { if (!safeClick(uptext) || !Timing.waitCondition(GBooleanSuppliers.waitForAnimation(animation), General.random(1800, 1950))) { System.out.println("clickEntity: Failed to click entity (1)"); return false; } } else if (!(safeClick(uptext) && Timing.waitCondition(GBooleanSuppliers.waitToStartMoving(), General.random(625, 800)) && Timing.waitCondition(boolSupp, General.random(5200, 5400)))) { System.out.println("clickEntity: Failed to click entity (2)"); return false; } return true; } /** * WastedBro's implementation (with slight tweaks) that aims the camera at an entity. * * Attempts to do so 2-5 times. This is random to avoid patterns each attempt is different than the last. * * @param clickableEntity Any Type that implements the Clickable and Positionable interfaces (RSObject, RSNPC, etc) * @return Whether or not the target is in camera view */ private static <T extends Clickable07 & Positionable> boolean attemptAimCamera(T clickableEntity) { if(clickableEntity == null) return false; int numberOfCameraAdjusts = 0; int maxCameraAdjusts = General.random(2, 5); while(!clickableEntity.isClickable() && numberOfCameraAdjusts <= maxCameraAdjusts) { if (numberOfCameraAdjusts == 0) { Camera.turnToTile(clickableEntity); } else if (numberOfCameraAdjusts == maxCameraAdjusts) { CameraZoom.zoomOut(); } else { // If we fail to find by rotation, then lower the angle (to see further) int angle = Camera.getCameraAngle(); Camera.setCameraAngle(angle - General.randomSD(5, angle, 30, 11)); } numberOfCameraAdjusts++; } return clickableEntity.isClickable(); }
  4. To determine the letter of the fairy ring combination, and set it, I use the rotationZ of a interface child within the entire combination interface. The issue I'm facing is that I hard coded the indexes and I've read that it is bad practice. I'm unable to filter out the index I want using Laniax's entity selector since the child index has no text/actions and no unique textid or colour. I was wondering how I could overcome this? Is there another viable method aside from hardcoding child values? Below is the code. It works perfectly. Would love any input regarding refactoring or better coding etiquette. Thanks. public class FairyRingHandler { private static final int TELEPORT_ANIMATION = 3265; // Interfaces private static final int master = 398; private static final int childRotationOne = 3; private static final int childRotationTwo = 4; private static final int childRotationThree = 5; private static final int leftChildClockwise = 19; private static final int midChildClockwise = 21; private static final int rightChildClockwise = 23; // Rotation values private static final int restingRotation = 0; private static final int firstRotation = 1536; private static final int secondRotation = 1024; private static final int thirdRotation = 512; // Arrays private static final int[] rotations = {restingRotation, firstRotation, secondRotation, thirdRotation}; private static final char[] validLeftChars = {'A', 'D', 'C', 'B'}; private static final char[] validMidChars = {'I', 'L', 'K', 'J'}; private static final char[] validRightChars = {'P', 'S', 'R', 'Q'}; public static boolean setFairyRingCombination(String combination) { if (combination.length() != 3) { System.out.println("SetFairyRingCombination: Invalid combination length"); return false; } // Rule out invalid character combination.toUpperCase(); char letter1 = combination.charAt(0); char letter2 = combination.charAt(1); char letter3 = combination.charAt(2); if (!areValidCharacters(letter1, letter2, letter3)) { System.out.println("setFairyRingCombination: Invalid characters entered."); return false; } // Open interface if it is not open if (!Interfaces.isInterfaceValid(master)) { RSObject fairyRing = Entities.find(ObjectEntity::new).nameEquals("Fairy ring").getFirstResult(); if (fairyRing == null) { System.out.println("setFairyRingCombination: No fairy rings are present."); return false; } String previousCombination = getFairyRingCombination(); String action = "Last-destination (" + previousCombination + ")"; // Tele to last destination if (previousCombination.equals(combination)) { if (AccurateMouse.click(fairyRing, action)) { waitToFInishTeleporting(); return true; } System.out.println("setFairyRingCombination: Failed to open fairy ring interface."); return false; } // Open the interface if (!AccurateMouse.click(fairyRing, "Configure") || !Timing.waitCondition(GBooleanSuppliers.isInterfaceValid(master), General.random(4800, 5340))) { System.out.println("setFairyRingCombination: Failed to open fairy ring interface."); return false; } } setCombinationLetter(letter1, leftChildClockwise); setCombinationLetter(letter2, midChildClockwise); setCombinationLetter(letter3, rightChildClockwise); if (!getFairyRingCombination().equals(combination)) { System.out.println("setFairyRingCombination: Failed to set fairy ring combination, resetting"); setFairyRingCombination(combination); } RSInterface confirm = Entities.find(InterfaceEntity::new).actionEquals("Confirm").getFirstResult(); if (confirm == null) { System.out.println("setFairyRingCombination: Unable to find the confirm button, closing interface"); RSInterface close = Entities.find(InterfaceEntity::new).actionEquals("Close").getFirstResult(); if (close == null) { System.out.println("setFairyRingCombination: Unable to find close button?"); return false; } close.click(); return false; } confirm.click(); if (!waitToFInishTeleporting()) { System.out.println("setFairyRingCombination: Failed to teleport?"); return false; } return true; } private static boolean waitToFInishTeleporting() { return Timing.waitCondition(GBooleanSuppliers.waitForAnimation(TELEPORT_ANIMATION), General.random(1850, 2000)) && Timing.waitCondition(GBooleanSuppliers.waitForAnimation(-1), General.random(3150, 3400)); } private static boolean areValidCharacters(char one, char two, char three) { return isValidChar(one, validLeftChars) && isValidChar(two, validMidChars) && isValidChar(three, validRightChars); } private static boolean isValidChar(char givenChar, char[] validChars) { for (char character : validChars) { if (givenChar == character) { return true; } } return false; } private static void setCombinationLetter(char letter, int clockwiseIndex) { if (!Interfaces.isInterfaceValid(master)) { System.out.println("setCombinationLetter: Fairy ring interface is not open."); return; } // case variables char[] characterCombination; int rotationChild; switch (clockwiseIndex) { case 19: characterCombination = validLeftChars; rotationChild = childRotationOne; break; case 21: characterCombination = validMidChars; rotationChild = childRotationTwo; break; case 23: characterCombination = validRightChars; rotationChild = childRotationThree; break; default: System.out.println("setCombinationLetter: Invalid lettrs, returning."); return; } // Find letter placement in the array. int currentRotation = Interfaces.get(master, rotationChild).getRotationZ(); int desiredRotationIndex = getDesiredRotationIndex(characterCombination, letter); int currentRotationIndex = getCurrentRotationIndex(currentRotation); // Compare the two indexes and determine if you need to rotate clock, counter or nothing. int numberOfRotations; RSInterface rotationInterface; // TODO make it so if 3 rots required, do the other way (i.e. from clock to counter) if (currentRotationIndex < desiredRotationIndex) { // rotate clockwise the difference numberOfRotations = desiredRotationIndex - currentRotationIndex; rotationInterface = Interfaces.get(master, clockwiseIndex); } else { numberOfRotations = currentRotationIndex - desiredRotationIndex; rotationInterface = Interfaces.get(master, clockwiseIndex + 1); } // Rotate for (int i = 0; i < numberOfRotations; i++) { // CLick specified index rotationInterface.click(); Timing.waitCondition(()-> { General.sleep(125); return isRotationValueValid(rotationChild); }, General.random(1450, 1600)); } } private static boolean isRotationValueValid(int rotationChild) { RSInterface rotationInterface = Interfaces.get(master, rotationChild); for (Integer rotation : rotations) { if (rotation == rotationInterface.getRotationZ()) { return true; } } return false; } private static int getDesiredRotationIndex(char[] characterCombination, char letter) { int counter = 0; for (char character : characterCombination) { if (character == letter) { return counter; } counter++; } System.out.println("getDesiredRotationIndex: Error, unable to find character in given array"); return -1; } private static int getCurrentRotationIndex(int currentRotation) { int counter = 0; for (int rotation : rotations) { if (rotation == currentRotation) { return counter; } counter++; } System.out.println("getCurrentRotationIndex: Error, unable to find rotation in given array"); return -1; } /** * Returns a three-letter string whcih represents the fairy code combination. Please note that this should only be * called when the interface is not rotating (i.e. is at rest). * * @return combination */ public static String getFairyRingCombination() { // Get rotation indexes and get the corresponding letters if (Interfaces.isInterfaceValid(master)) { RSInterface masterInterface = Interfaces.get(master); int rotationIndexOne = getCurrentRotationIndex(masterInterface.getChild(childRotationOne).getRotationZ()); int rotationIndexTwo = getCurrentRotationIndex(masterInterface.getChild(childRotationTwo).getRotationZ()); int rotationIndexThree = getCurrentRotationIndex(masterInterface.getChild(childRotationThree).getRotationZ()); if (rotationIndexOne == -1 || rotationIndexTwo == -1 || rotationIndexThree == -1) { System.out.println("getFairyRingCombination: The fairy ring is rotating thus unable to determine combination."); System.out.println("getFairyRingCombination: Please wait for it to stop rotating."); return ""; } char charOne = validLeftChars[rotationIndexOne]; char charTwo = validMidChars[rotationIndexTwo]; char charThree = validRightChars[rotationIndexThree]; return new String(new char[]{charOne, charTwo, charThree}); } else { RSObject fairyRing = Entities.find(ObjectEntity::new).nameEquals("Fairy ring").getFirstResult(); if (fairyRing == null) { System.out.println("getFairyRingCombination: No fairy rings are present."); return ""; } String[] actions = fairyRing.getDefinition().getActions(); String action = null; for (String s : actions) { if (s.startsWith("Last")) { action = s; } } if (action == null) { System.out.println("getFairyRingCombination: Action is null some how ?."); return ""; } return action.split("[()]")[1]; } } }
  5. Yes it is. My friend got mac addressed banned. I'd imagine you ahve to do some fucked up shit to get banend that way though (which he did)
  6. You need to know basic Java to make scripts. Tutorial can be found here: https://tribot.org/forums/forum/43-scripting-tutorials/ First thing you should prob look at since your new is this:
  7. pretty sure runelite+ already provides this
  8. Wow this is insane, just found this. Quick nooby question, in the efficient scripting post by trilez, he said that finding something by ID is the most efficient method of doing so (4th efficient being by name). I see that you wrote "added performance overhead is minimal" but just wanted confirmation that finding an object by ID has near identical processing speed as finding said object via .nameContains("name).getFirstResult(); Thanks
  9. https://github.com/Einstein-TRiBot/Universal-Woodcutter I used this to learn how to script and use the antiban
  10. Almost max pure gear and blowpipe with mith darts I think NMZ is extremely safe imo. All you do is afk in there anyways, aside from clicking pots every now and then.
  11. I haven't botted to max stats, but I did bot to 99 range on one of my pking accounts. All I did was run my NMZ script and would take like 30 minute breaks between each session.
  12. Yes you can be banned via mac. My friend is banned that way; however, he did some really fucked up shit that fucked with RS (not going into detail). IDK if I'm allowed to post a link to another botting forum, but he goes into extreme detail about his hardware ban.
  13. I don't know personally, but here's a thread asking for the samething.
  14. Hey, I have a few questions. To get this to work again, I had to import multiple libraries (allotari, guava and gson), and then set the credentials in the beginning of my script (i.e. at Starting). How come all of this required now? Is this because TRiBot now allows for more 3rd part libraries since August 30th (as shown HERE)? What benefits do these libraries give opposed to how WebWalker was working before (i.e. without these libraries)? Should I also familiarize myself with these libraries (would it be helpful for my own personal scripts)? Thanks
  15. I have this NMZ script I made and all it does is drink pots when needed and is AFK otherwise. All of my other scripts that I've made use timedactions where appropriate; however, none of these scritps have an extremely long afk time. Would implementing TimedActions be efficient here? I feel like doing absolutely nothing would have less ban detection (kind of like auto-clicking splashing). Of course I have no evidence to support this, so I was wondering if anyone else knows. Thanks.
×
×
  • Create New...