Jump to content

redeems

Members
  • Posts

    23
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by redeems

  1. The first one would be best. Create a state that handles logging in, and put a timeout on it. If it doesn’t complete the login action, you could assume 1 of two things. Credentials are incorrect, or the account is banned.
  2. true. conditional sleeps are almost always better than static sleeps.
  3. } else if (currentState == States.DROPPING) { //if the state is dropping... log("Inventory full dropping fish.."); //log that we are in this state and executing getInventory().dropAllExcept("Feather","Fly fishing rod"); //drop everything besides feathers and rod int openslots = (getInventory().getEmptySlotCount()); //variable for open inventory spots if (openslots == 26) { currentState = States.FISHING; } } } corrected. now it will go the distance.
  4. private States currentState = States.FISHING; //setting starting state private Area area = new Area(3109, 3434, 3103, 3423); // fishing area public enum States {FISHING, DROPPING} //the two states LUL just realized i never ....okay you win this time LUL
  5. ? https://gyazo.com/134f41b8e4a867b03c372fb0e6a70020
  6. the states are an enumeration. using states allows you to be dynamic. for this, case/switch works just fine, but what happens when you have a lot of cases, gets confusing. Your way is not incorrect. It's never wrong if the outcome is successful. yours is correct. It's just good practices.
  7. I've written this into a better structure using states. I commented everything so please take it and learn from it. Look up some java tutorials, and keep scripting. import org.osbot.rs07.script.Script; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; import org.osbot.rs07.api.model.NPC; @ScriptManifest(name = "Fishing for States", author = "Redeems", version = 1.0, info = "", logo = "") //manifesto public class Main extends Script { private States currentState = States.FISHING; //setting starting state private Area area = new Area(3109, 3434, 3103, 3423); // fishing area public enum States {FISHING, DROPPING} //the two states private void startfishing() throws InterruptedException { //function to run on loop if (currentState == States.FISHING) { //if the state is "FISHING" then NPC fishSpot = getNpcs().closest("Rod Fishing spot"); //get closest rod fishing spot int openslots = (getInventory().getEmptySlotCount()); //variable for open inventory spots if (!myPlayer().isAnimating() && !getInventory().isFull() && !myPlayer().isMoving() && fishSpot != null) { //conditions for action log("Fishing.."); //log we've passed conditions fishSpot.interact("Lure"); //interact with fishing spot (fish) sleep(random(300, 600)); //sleep to give time to interact getMouse().moveOutsideScreen(); //move mouse off screen "said to be good? i dont do this..." if (openslots == 0) { //if no open inventory spaces....then currentState = States.DROPPING; //switch state to dropping } } } else if (currentState == States.DROPPING) { //if the state is dropping... log("Inventory full dropping fish.."); //log that we are in this state and executing getInventory().dropAllExcept("Feather","Fly fishing rod"); //drop everything besides feathers and rod } } @Override public void onStart() { } @Override public void onExit() { } @Override public int onLoop() { if (!area.contains(myPlayer())) { // if the area doesnt contain yourself log("Not in fishing area.. walking there."); //log that to be the case getWalking().walk(area); //walk to fishing spot } else { // otherwise.... if (area.contains(myPlayer())) { //if the area does include you try { //try catch statement in case something goes wrong we have an exception. if (myPlayer().isVisible()) { //something thats always true. log("about to start fishing"); //log entering function startfishing(); //enter function } } catch (InterruptedException e) { //catch log("got interrupted!"); //useless exception. } } } return random(1000, 1500); //how fast we loop. not needed to be random, i like it just for fun. } @Override public void onPaint (Graphics2D g) { } }
  8. if(!myPlayer().isAnimating()) { if(!myPlayer().isMoving()) { if(!getInventory().isFull()) { if(fishSpot != null) { log("Fishing.."); you can just use and instead of doing each if. if(!myPlayer().isAnimating() && !getInventory().isFull() && !myPlayer().isMoving() && fishSpot != null) { log("Fishing.."); fishSpot.interact("Lure"); sleep(random(300,600)); getMouse().moveOutsideScreen(); }
  9. The best way, if you have some know how about java, is to look over the API, learn it, and try to achieve something that there is no public resource for, this way you are forced to research specific concepts, instead of just looking at a source and not understanding. The way to include antibans is to not include them, they are pointless. Walkpaths you can look at the API in the classes "Walking, walking event, webwalking". There can never be a tutorial on making something "unique". There is also a scripting help section, which i've found users to be very willing to help answer questions. Furthermore, the snippets section has a lot of good resources as well.
  10. redeems

    GE Data

    Just because I know people will have issues converting this. This is how you do that. String Itemname = "Logs"; Optional<String> Itemprice = ItemLookup.get(Itemname, Property.SELL_AVERAGE); int ItemPriceConverted = Integer.valueOf(Itemprice.get()); log(Itemname + " are worth " + ItemPriceConverted + " gp"); Great stuff dreameo
  11. Sent the request, thanks man
  12. Hey frost bug would it be possible for me to add you on Discord
  13. Perfect, exactely what I was in need of. I was hoping you'd be the one to respond to this post, love me some frost scripts.
  14. Google State Machine, it's basically the foundation for most scripts. Your onLoop will only run a function. States can be stored in your main file, or you can create a class. Actually, you could even create a class for each state. The point is, it allows you to break up your code into smaller, more defined sections. here's the logic behind it. Code length does not define proper or improper. Being able to catch and contain errors using a state machine, will not only make your life easier, but will allow you to be much more diverse with your code. A state is essentially a "condition" which defines everything, so by using states, you can be much more diverse in your approach.
  15. So in my paint, i highlight a polygon, how would I go about putting a timer on that spot for x amount of time, then clearing the polygon? I've looked through the API, and googled. The timer doesn't have to be a timer, it could be a progress bar, or just some indication of an integer's progress. logic I'm going for: //pick up item off table //draw polygon around item's spawn //visual representation of how long until item appears //clear polygon I know i could do it off of the polygon, and just have a timer, I'm just curious if I can draw inside the polygon, and how to go about it. Thanks everybody.
  16. redeems

    FrostCaves

    Cool, I'm happy with my purchase. I wonder what could be done to nill banrates on this script. Seems to be hard, being as it's the only functional fire cape script out there, Also, being humanlike becomes harder, as for the script to function properly it needs to calculate things in a bot like way to prevent fails. If you were to look into that, besides prayer flicking, what would you look into? A new way to identify monster spawns? Also, in my experience, stopping the script and manually doing a wave here and there (easy waves - 62 for example) and then restarting the script completely made me ban free.
  17. redeems

    FrostCaves

    Have you ever tested the pet functionality? Just curious if anybody has gotten a pet using this script.
  18. redeems

    FrostCaves

    62 hp, 75 range, 43 prayer 40 def 64 cb. This script does okay, it could use some updates on attack order. The way it lures monsters is really smart when it does it correctly. I have the full video of the caves if Frostbug is intersted, quite a few spots I could point out where it needs improvement. At the end of the day, it did what it had to, and on a high level account it should have no issues. The way it fights jad is bizarre.
  19. redeems

    Stealth Quester

    personally excited for the future of this, as many others seem to be too. Great job, and thanks for updating!
  20. So, here is my overall review. from 1-20 agil. I trained manually. nothing exciting there. 20-40 agil I used this script straight through, no problems. I then took a 5 hour break I then continued agility from 40-65 with short breaks (5-8 min) Then at 65 I took another 5 hour break. at 65 I moved to seers agility course. Here I was banned within 5 hours. but did get 70 agil. and only a 2 day ban. Overall, this script does what it says it will, and it's very reactive, and seems to have a fair bit of randomization within movement. I think If you are to use this script, prepare to take longer breaks then I did, and mix in other tasks in between and you should have no issues. I don't believe the script is at fault for my ban, but rather, that I triggered bot detection on myself by training one skill for to long. Sooooo, do you buy it? Yes. buy it. Be smart with it. It will do you well.
  21. As far as I know, it supports a vast array of food, and it auto detects what food that is. Just have it in your inv.
×
×
  • Create New...