Jump to content

R I F T

Members
  • Posts

    16
  • 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.

R I F T's Achievements

Newbie

Newbie (1/10)

0

Reputation

  1. Seems like somebody who can be assed should investigate with a generic algorithm. Run 10 instances of the bot with randomised parameters for efficiency, afking, mouse movements, mirror mode/stealth injection, and whatever else you can think of, for however many generations you can be bothered doing. I'd do it myself but ive not got enough API knowledge/accounts ready. Maybe something I'll try in future though... https://towardsdatascience.com/introduction-to-genetic-algorithms-including-example-code-e396e98d8bf3
  2. I got 1 day banned on my main too after getting a couple of 99s. If you've got 1900+ total, its absolutely not worth the risk. Bot an alt for cash then trade that to your main and do the fastest exp methods using that gp if you still want fast gains
  3. I think you should print the contents of your booleans so you see what you're getting back. If they don't return what you expect, you've found your problem
  4. @z10n Have you implemented something like this into your scripts? How have the results been if so.
  5. 3 years ago but I believe nothings changed -> https://www.reddit.com/r/2007scape/comments/3g06rq/guide_using_the_old_school_ge_page_api/ Should be able to get it working with a bit of Googling on how to send the requests / parse JSON responses
  6. I'm writing a sand crab script and before I run to the correct position to begin afking, I want to walk to an area first. I run to the area fine, but when I try and walk to the specific position, I get stuck in an infinite loop as getWalking().walk(desiredPosition) is falsely returning true. It always leaves me about 2-3 tiles away. private Area currentArea; private Position currentSpot; ... private void takeSpot() { currentArea = spotManager.freeArea(); currentSpot = spotManager.freeSpot(); log("Found a spot at " + currentSpot.toString()); log("Taking spot ..."); while(!currentArea.contains(myPlayer())) { log("Moving to area ..."); getWalking().walk(currentArea); new Sleep(() -> myPlayer().isMoving(), 6000).sleep(); sleep(200); } log("Moved to area!"); log("Current position: " + myPlayer().getPosition().toString()); log("Desired position: " + currentSpot.toString()); while(myPlayer().getPosition() != currentSpot) { log("Moving to position"); log("Current position: " + myPlayer().getPosition().toString()); log("Desired position: " + currentSpot.toString()); log("Result of attempting to walk to position is: " + getWalking().walk(currentSpot)); getWalking().walk(currentSpot); new Sleep(() -> !myPlayer().isMoving(), 3000).sleep(); } } Example outputs of logs: [INFO][Bot #1][11/30 07:41:28 PM]: Moving to position [INFO][Bot #1][11/30 07:41:28 PM]: Current position: [x=1696, y=3470, z=0] [INFO][Bot #1][11/30 07:41:28 PM]: Desired position: [x=1695, y=3471, z=0] [INFO][Bot #1][11/30 07:41:28 PM]: Result of attempting to walk to position is: true [INFO][Bot #1][11/30 07:41:28 PM]: Moving to position [INFO][Bot #1][11/30 07:41:28 PM]: Current position: [x=1696, y=3470, z=0] [INFO][Bot #1][11/30 07:41:28 PM]: Desired position: [x=1695, y=3471, z=0] [INFO][Bot #1][11/30 07:41:28 PM]: Result of attempting to walk to position is: true [INFO][Bot #1][11/30 07:41:28 PM]: Moving to position [INFO][Bot #1][11/30 07:41:28 PM]: Current position: [x=1696, y=3470, z=0] [INFO][Bot #1][11/30 07:41:28 PM]: Desired position: [x=1695, y=3471, z=0] [INFO][Bot #1][11/30 07:41:28 PM]: Result of attempting to walk to position is: true It says that the call to getWalking().walk(currentSpot) is true, however I'm still 2-3 squares away. I can move into the area containing this spot fine, but get stuck in an infinite loop in my second while loop. I'm only using a static sleep(200) for debugging, as the client crashes otherwise. I'm new to scripting and a Java nooblet, so any help is welcomed
  7. I'm commuting home from work rn so I can't read the code, but I think people may be more inclined to help you if you broke some of that logic inside your onLoop into methods to make it easier to read
  8. Had a quick google and found a stack overflow question which has seems to have a good answer on how to solve your problem: https://stackoverflow.com/questions/23211589/error1-1illegalcharacter-ufeff-when-compiling-on-android-studio Top answer: Incorrectly copy/pasting code from somewhere in the forums sometimes gives me syntax errors, so be careful when you're using snippets etc.
  9. What an awesome read! Thanks for putting the effort in to write this. Very useful info
  10. Not been following it for a while and just checked coinmarketcap ... WOW... Get out while you can. Glad I sold a few months back. I feel for the people who actually bought BTC at $19.5k
  11. I'm writing a sand crab bot and currently writing the logic for checking what spots are available. I've been debugging a null pointer problem I've been getting and it looks like whenever I try and use a method from the MethodProvider class (currently trying log) I get a null pointer. Create an instance of SpotManager passing the RIFTSandCrabs class (my script) ,,, public class RIFTSandCrabs extends Script { ... private SpotManager spotManager = new SpotManager(this); And then in my SpotManager I have this ... public class SpotManager extends MethodProvider { ... private Script RIFTSandCrabs; public SpotManager(Script RIFTSandCrabs) { this.RIFTSandCrabs = RIFTSandCrabs; } ... private void updatePositions() { for (int i = 0; i < crabLocations.length; i++ ) { log(i); updatePosition(crabLocations[i], i); } } private void updatePosition(Position p, int index) { RIFTSandCrabs.stop(false); log("Position coords are " + p.toString()); log("Players located are " + getPlayers()); log("Result of isEmpty() is " + getPlayers().get(p.getX(), p.getY()).isEmpty()); if (getPlayers().get(p.getX(), p.getY()).isEmpty()) { spotStatus[index] = true; } } ... } I pass the instance of my script through to this class only to stop executing at a certain point to check logs etc. What I'm trying to do is make sure the logic I have in place to check if a spot is free is correct and is returning what I want it to return. I get a null pointer at " log(i) " inside the for loop of updatePositions( ). I'm a Java nooblet, so any help would be appreciated EDIT: Solved problem. Resource was in Explvs Tutorial (5). Close please
  12. Aha... I'd just changed it to use a workaround checking if the entity.getName starts with "Chicken". I'll remove that now. Thanks for that
  13. I'm trying to write my first script (classic chicken killer) and somewhat following Explvs Scripting 101 concepts. I'm trying to make a filter to then get the closest and attack that chicken. Here's my code: package core; import org.osbot.rs07.api.filter.Filter; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; @ScriptManifest(name = "RIFTChickens", author = "R I F T", version = 1.0, info = "", logo = "") public class RIFTChickens extends Script { private final Area chickenCoop = new Area(3225, 3295, 3236, 3301); private final Area yardArea = new Area(3236, 3293, 3231, 3288); public Filter<Entity> chickenFilter = new Filter<Entity>() { @Override public boolean match(final Entity entity) { return entity.getName() == "Chicken" && (chickenCoop.contains(entity) || yardArea.contains(entity)); } }; @Override public void onStart() { //Code here will execute before the loop is started } @Override public void onExit() { //Code here will execute after the script ends } @Override public int onLoop() { if (!isAttacking()) { Entity targetChicken = getNpcs().closest(chickenFilter); if (targetChicken != null) { targetChicken.interact("Attack"); } } return random(300, 400); //The amount of time in milliseconds before the loop starts over } @Override public void onPaint(Graphics2D g) { //This is where you will put your code for paint(s) } private boolean isAttacking() { return myPlayer().isMoving() || myPlayer().isAnimating() || myPlayer().isUnderAttack(); } } The error that I am getting is... The method closest(String...) in the type EntityAPI<NPC> is not applicable for the arguments (Filter<Entity>) ... which happens on this line ... Entity targetChicken = getNpcs().closest(chickenFilter); I've been playing around with it for about 45 minutes but I can't seem to solve it. Any ideas? EDIT: Solved my problem. Changed this... public Filter<Entity> chickenFilter = new Filter<Entity>() { @Override public boolean match(final Entity entity) { return entity.getName() == "Chicken" && (chickenCoop.contains(entity) || yardArea.contains(entity)); } }; ...to... public Filter<NPC> chickenFilter = new Filter<NPC>() { @Override public boolean match(final NPC entity) { return entity.getName().startsWith("Chicken") && (chickenCoop.contains(entity) || yardArea.contains(entity)); } }; Still have the question as to why Explv could do it the original way, so if anyone knows please let me know (new to Java).
×
×
  • Create New...