Jump to content

rcrd

Members
  • Posts

    3
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

rcrd's Achievements

Newbie

Newbie (1/10)

0

Reputation

  1. Figured that was the only way. That's probably a bit too much for me right now, but I'll give it a shot as soon as I fix the easier issues. Thanks!
  2. Yeah, I wasted a crapload of time on mostly useless antiban, but it was useful to learn how most stuff works. I've solved pretty much every bug I had though, I was just wondering if there was any way I could change the behavior of the hover() method or if the only way to do that would be to use mouse.move? Also, I'll probably be done with the initial "release" of this later today or tomorrow at most, just got to add the rest of the F2P spots, improve my hovering and chopping methods a bit and do a simple GUI. I'd be glad if you could take a quick glance at the code after that, as I'm sure there are loads of rookies mistakes there. I like the placebo, sue me. Quite possible, it's literally my first actual attempt at scripting, but where exactly? Also, I would ignore the original snippets, if the current ones are bad, the old ones are terrible.
  3. EDIT: Only thing left now! Error 4) Not exactly an error, but I've noticed that hover() has a tendency to hover the trees in a way that are not very humanlike (it seems to love to hover the edges of trunk of the tree and it aso hovers through other trees). Is there anyway I can force it to hover the way I want? Hello. I'm rcrd, new to scripting and while trying to make my first attempt at a WCer, I've came across a couple of bugs that I can't seem to be able to fix by myself. Fixed Error 1) by doing this: else if(!myPlayer().isAnimating() || currentTree == null || (currentTree != null && !currentTree.exists())) { return State.WOODCUTTING; } It was a matter of the script trying to check if the tree existed on the first attempt and the currentTree value was null before chop() ran for the first time. Error 1) If I start the script and the player is already chopping down a tree (basically if he's doing the chopping animation), I get a NullPointer thrown by the getState function. Corresponding snippet: private State getState() { if(currentLevel == 0 || skills.getStatic(Skill.WOODCUTTING) > currentLevel) { return State.SETTINGS; } if(myPlayer().isUnderAttack()) { return State.ANTIATTACK; } else if(inventory.isFull()) { return State.BANKING; } else if(!currentArea.contains(myPosition())) { return State.WALKING; } else if(!myPlayer().isAnimating() || !currentTree.exists()) { return State.WOODCUTTING; } else { return State.ANTIBAN; } } @Override public int onLoop() throws InterruptedException { switch(getState()) { case SETTINGS: settingsFinder(); break; case ANTIATTACK: runAway(); break; case BANKING: bank(); break; case WALKING: walk(); break; case WOODCUTTING: chop(); break; case ANTIBAN: antiBan(); break; } return random(50, 200); } Fixed Error 2) by doing this: else if(r >= 680 && r < 685){ log("Antiban, Reporting"); Player cPlayer = players.closest(cp -> !cp.getName().equals("Ruffler")); if(cPlayer != null && !cPlayer.isVisible()) { camera.toEntity(cPlayer); } if(cPlayer != null && cPlayer.isVisible()) { Rectangle rect = null; cPlayer.interact("Report"); sleep(random(1111, 4444)); RS2Widget macroReport = getWidgets().getWidgetContainingText("Macroing or use of bots"); if(macroReport != null) { rect = macroReport.getRectangle(); if (rect != null) { mouse.click(new RectangleDestination(bot, rect)); } else { log("Couldn't close, we fucked!"); } } } sleep(random(111, 444)); } After a lot of searching on the forums, found a post by Token which helped a lot. Seems to work decent enough. Error 2) Certain widgets are giving me some issues. More specifically the various report options, where the bot doesn't feel like clicking them. I've "solved" it by using mouse.click, but I'd rather do it right if possible. else if(r >= 680 && r < 685){ log("Antiban, Reporting"); Player cPlayer = players.closest(cp -> !cp.getName().equals("Ruffler")); if(cPlayer != null && !cPlayer.isVisible()) { camera.toEntity(cPlayer); } if(cPlayer != null && cPlayer.isVisible()) { cPlayer.interact("Report"); sleep(random(1111, 4444)); RS2Widget macroReport = getWidgets().get(553, 9, 18); if (macroReport != null) { macroReport.interact("Send report"); } } } Fixed Error 3). My chop() function was only checking if the tree existed, I forgot to make a check for the player animation there as well. So until the currentTree stopped existing, it did nothing. Works fine now! Error 3) The one issue I haven't found a workaround for is the following: else if(r >= 680 && r < 685){ log("Antiban, Reporting"); Player cPlayer = players.closest(cp -> !cp.getName().equals("Ruffler")); if(cPlayer != null && !cPlayer.isVisible()) { camera.toEntity(cPlayer); } if(cPlayer != null && cPlayer.isVisible()) { cPlayer.interact("Report"); sleep(random(1111, 4444)); mouse.click(random(50, 160), random(281, 291), false); sleep(random(1111, 4444)); chop(); } } - Bot is chopping fine; - Executes every other antiban code without any issue and returns to the loop. - Unless it goes to the piece of code from above. If it does, it gets stuck there after doing everything. I even added that "chop()" to try and force it to unstuck itself, but it didn't work. It simply reports the player and then just sits there waiting. I seriously have no clue why it does this. If you guys need more code to check it, just warn me. I'm gonna end up releasing this for free anyway, I just want to get it better before I do. Thanks in advance, rcrd
×
×
  • Create New...