Jump to content

OSBOTTESTER101

Members
  • Posts

    12
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by OSBOTTESTER101

  1. Wow thank you for this, can you give me some advice on the main loop how long you should put the return statement? do you have put it for 10seconds
  2. import org.osbot.rs07.utility.ConditionalSleep; import java.util.function.BooleanSupplier; public final class Sleep extends ConditionalSleep { private final BooleanSupplier condition; public Sleep(final BooleanSupplier condition, final int timeout) { super(timeout); this.condition = condition; } @Override public final boolean condition() throws InterruptedException { return condition.getAsBoolean(); } public static boolean sleepUntil(final BooleanSupplier condition, final int timeout) { return new Sleep(condition, timeout).sleep(); } } this is my sleep method
  3. if (exactLocationOfConveyor.interact(x.getBot(), "Put-ore-on") || exactLocationOfConveyor2.interact(x.getBot(), "Put-ore-on")) { Sleep.sleepUntil(() -> !x.myPlayer().isMoving() && !x.getInventory().contains("Gold ore"), 5000); if (!x.getInventory().contains("Gold ore")) { x.getWalking().walk(exactLocationOfBarDispenser); Sleep.sleepUntil(() -> getSmithXP < x.getSkills().getExperience(Skill.SMITHING), 3000); if (x.getEquipment().isWearingItem(EquipmentSlot.HANDS, "Goldsmith gauntlets")) { x.getInventory().interact("Wear", "Ice gloves"); barDispenser.interact("Take"); } } } Ok so I am getting results on my bot up until the lines i wrote in here the first line works for example it is suppose to click on the conveyor belt and walk to it but for some reason it does do that and when it gets there it spams click instead of sleeping i am using a sleep that i found on explvs and it was working for some things but it just does not actaully sleep the way i thought it would any suggestion?
  4. RS2Object conveyorBelt = x.getObjects().closest("Conveyor belt"); RS2Object barDispenser = x.getObjects().closest("Bar dispenser"); Position barDispenseArea = new Position(1942, 4967, 0); x.log("Walking to conveyor belt"); if (conveyorBelt.exists() && conveyorBelt != null) { x.getWalking().walk(barDispenseArea); Sleep.sleepUntil(() -> !x.myPlayer().isMoving(), 1000); } Everytime my player walk to the barDispenseArea it keeps hovering its mouse on the object and trying to click something I did not specfiy in my code to click anything when it arrives just to sleep. does my if statement play a role in what is going on? When I say everytime I mean every time my player goes over to the conveyor belt it tries to click something but for no reason because where did i put in my code to click?
  5. What do you mean exactly because I did not call anything on the onStart method I just used onLoop method
  6. public class Attack { private static Script sI; NPC npc = sI.getNpcs().closest("Rat"); public void getAllNpcs(Script sI, String npcsName){ if(!sI.myPlayer().isUnderAttack()){ if(npc.exists()){ sI.npcs.closest(npcsName).interact("Attack"); }else{ sI.log("Cant find the current NPCS " + npcsName); } } } } Above is my code and this is only the " ATTACK class, that creates a getAllNpcs which when is suppose to attack the given String npcsName now before I had a collection of Npcs that is why you see the method ask for a given String basically it was like this private static List<NPC> npc = sI.npcs.getAll(); rather then the method you use above anyways am I doing something wrong ? because when I click play and try to use the bot script it does nothing and after I do I can't even click on the osrs game anymore it is basically like if there were a JFrame over my game not letting me click anything on that screen after I try to run the unsucessful script Anyways I was thinking that maybe I should use a constructor to pass the script instance? Such as public class Attack { private Script sI; public Attack(Script sI){ this.sI = sI; } //private static List<NPC> npc = sI.npcs.getAll(); NPC npc = sI.getNpcs().closest("Rat"); public void getAllNpcs(Script sI, String npcsName){ if(!sI.myPlayer().isUnderAttack()){ if(npc.exists()){ sI.npcs.closest(npcsName).interact("Attack"); }else{ sI.log("Cant find the current NPCS " + npcsName); } } } } and below I will give you my main method public int onLoop () throws InterruptedException{ switch (getState()){ case EAT: print(getState()); Eat.eatFood(); break; case ATTACK: print(getState()); attack.getAllNpcs(this, "Rat"); break; case BANK: print(getState()); bank.bankMode(this, Banks.VARROCK_WEST); break; } return random(3000); } private States getState(){ if(myPlayer().getHealthPercent()<20){ return States.EAT; }else if(!myPlayer().isUnderAttack()){ return States.ATTACK; }else return States.BANK; // do not mind the return States.BANK as I have not finished the code but all I was trying to do is make the player attack is all and my player is not under attack so it should return States.attack Oh yes by the way I have never created States or Classes that have separate task, this is my first time and that is why maybe it is not working for me but if the code looks fine to everyone than maybe I am not setting the build path correctly and I am using IntelliJ
  7. Of course like everyone else here I have some question One of the question is that when you rent a server- do they physically bring it to your home? Also if you buy lets say 3 used servers and install them can you physically log in to each of those servers like to see a GUI? Would you be able to set them up individually ? and then would you get a new IP for each bot? or how does that work?
  8. Hi thank you for the code I yet have not used this on my account if (prayer.isActivated(PrayerButton.RAPID_HEAL)) { status = "Flicking \"Rapid Heal\" off..."; prayer.set(PrayerButton.RAPID_HEAL, false); } else { status = "Flicking \"Rapid Heal\" on..."; prayer.set(PrayerButton.RAPID_HEAL, true); return random(50, 100); } I am mainly confused only on this part because first you check to see if prayer is on "and if it is on" then you shut it off That part is clear but when you do shut it off again? does it loop back through the entire program to fulfil the other conditions? or does the return random(50,100) loop back around the same if statement one more time? That is a good point actually but I do not think this bot will mess up lol but that is definitely a good point incase that happens or you can do if >51 and down the line ==1, incase it goes over 1 into the 2 zone.
  9. Just showing you should know as well, jagex keeps tracks of IP address so actually having several osBOT apps opening would be better using different proxies on each, but that personal preference Logically you would need to have a timer on the script just stating to logout in 4 hours and log another account in right after.
  10. Imagine this... String [] allBanks = {Banks.AL_KHARID,Banks.GRAND_EXCHANGE,Banks.LUMBRIDGE_UPPER,Banks.VARROCK_EAST,Banks.VARROCK_EAST}; Now here is where we ask the user when starting the script USER -> STARTS SCRIPT -> SCRIPT THEN ASK -> Where would you like to go with the options 1-10, and names next to them 1. - AL KHARID BANK 2. G.E AND so on.
×
×
  • Create New...