Everything posted by Twin
-
need help finding a good way to make a if statement to a state more reliable.
I think I already have that there with the inventory.contains(2353)//2353 is steel bar id When I had it without the cannonballs, it would constantly go back and redo the entire process of selecting the steel bar, furnace, then clicking on steel bars and making all again. and it would do this after every 3 or 4 cannon balls. case SMITH: Entity furnace = objects.closest("Furnace"); sleep(random(1000,2000)); inventory.interact("Use", 2353); sleep(random(500,1000)); furnace.interact("Use"); sleep(random(2000,3000)); if(!inventory.isItemSelected()) { this.interfaces.interactWithChild(309, 2, "Make All"); sleep(random(10000,20000)); break; } that's my smith state if that helps
-
need help finding a good way to make a if statement to a state more reliable.
My whole script works fine, it's just this if(SMITH.contains(myPlayer())&&inventory.contains(2353)&&!myPlayer().isAnimating()&&!inventory.contains("Cannonball")) everything works all fine and dandy until an event comes in the middle of smithing, because when it goes to dismiss a random event, it will have cannon balls and won't go back to smithing, What would be abetter way to do this.
-
OLDSCHOOL RUNESCAPE BLAST FURNACE
There was one adn it was 15 dollars so not to many people would use it and crash ore prices. I've been making one but i've had a few issues with it.
- Picking up Items
- Hi everyone!
-
Picking up Items
Object is its own thing. An object is something like A tree, ore vein, a door, things like that. A ground item is anything that is on the ground and has orange text.
-
How to use options on furnace after it's clicked?
So then it is the main interface is the parent, and the different clickable options are the children? And I'm assuming when you say it's not null, that means the text is black and not red? Thanks for the replies by the way, definatly cleared some confusion up.
-
How to use options on furnace after it's clicked?
So would It be something likeEntity furnace = objects.closest("Furnace"); furnace.interact("Smith"); Furnace.interact(Id of option after first click goes here?); So a parent is the main interface, once clicked that becomes the child, and if that's clicked it becomes the grandchild? Will it tell me the ID then of the option I want to click? I was messing around with that yesterday on the spinning wheel and couldn't figure it out
-
How to use options on furnace after it's clicked?
So when you click smelt on a furnace, it brings up a bunch of options like bronze, blurite, iron, all of that. How do I have the bot click on one of those, Can't seem to figure it out and have no idea where to look in the api. I thought it might be interfaces but I didn't know what it meant by parent/child.
-
A Beginners Guide to Writing OSBot Scripts (where to get started!) by Apaec
inventory.dropAllExcept(this id, this id, and this id);
-
Question about entity's.
Currently working on my MLM script, and I wanted to know if there a way to get the closest entity ore vein, and if none are visible have it walk to a different area. I'm assuming this would be an if statement like if(pay==null)//pay being the entity ore vein { getLocalWalker().walk(position for walkinghere); break; } And then have it stop when it gets to the nearest ore vein on the way there. So if it doesn't see an ore vein it will walk to the given point until it sees an ore vein, then move onto the state mine like normal. Would this be the correct way to donit?
-
Teacher Required
You'd want something like if(!inventory.isEmpty()){ Bones.interact("Bury"); break; } //then you'd have if(inventory.isEmpty()) { bank.Open; bank.Withdraw(either a string"Bones" or whatever the id of bones are you're using) ;bank.Close(); break; } //this isn't 100% right but it's a start. basically just go into the api, press f3 and search //inventory, then search for a keyword that you //think will help you, and then implement the method //next to inventory so if you want to do something if your inventory is full, inventory.IsFull(); edited something from mobile and it fucked up this things formatting, sorry about that.
-
Teacher Required
http://osbot.org/forum/topic/58775-a-beginners-guide-to-writing-osbot-scripts-where-to-get-started-by-apaec/ specifically import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; @ScriptManifest(author = "You", info = "My first script", name = "Tea thiever", version = 0, logo = "") public class main extends Script { @Override public void onStart() { log("Welcome to Simple Tea Thiever by Apaec."); log("If you experience any issues while running this script please report them to me on the forums."); log("Enjoy the script, gain some thieving levels!."); } private enum State { STEAL, DROP, WAIT }; private State getState() { Entity stall = objects.closest("Tea stall"); if (!inventory.isEmpty()) return State.DROP; if (stall != null) return State.STEAL; return State.WAIT; } @Override public int onLoop() throws InterruptedException { switch (getState()) { case STEAL: Entity stall = objects.closest("Tea stall");//What this does is get's the closest entity //named tea stall, and stores it into stall if (stall != null) {//this if statement is saying if the stall //is not null(exist pretty much) it will interact from it with the option //"Steal-from" stall.interact("Steal-from"); } break;//the break will tell the script to move on to what's //next/go back to find another state case DROP: inventory.dropAll();//if your inventory is not empty, it will //go to this case which basically says it will drop anything in your inventory, one item in your //inventory will trigger this to go off. break; case WAIT: sleep(random(500, 700));//this will happen if your inventory is full, and the stall is //null(nothing on it) break; } return random(200, 300); } @Override public void onExit() { log("Thanks for running my Tea Thiever!"); } @Override public void onPaint(Graphics2D g) { } } This right here is going to be the bear bones to anything you do. You can pretty much write anything using Statements, I'd recommend starting off with a basic script that will power mine/power chop something. Anything that you might need is already a method in the osbot api so you wont need to make your own methods. Do you have knowledge of java itself or have you just wrote a few basic bot scripts before? Commented on some of the code just so you can get a better idea of what it's doing
-
Won't walk?
Make a second class and name it Walker, then just copy and paste it. And im not 100% sure since I'm not to familiar with osbot scripting but you might need to do Walker rswalk = new Walker(and then if something goes in here you type it); don't quote me on that though.
-
Need help with banking, bot just goes into bank and stand there
Apaec helped me kind of get to know the api and get a start on just general bot scripting, and I used his tea thiever guide to get started so It stemmed form there. What would another way of doing it be? multiple classes?
-
Need help with banking, bot just goes into bank and stand there
Didn't think of having a tree area change based on woodcutting level, will defiantly try it out. And I know it's not the best but i'm still trying to learn it, so if I can get something like this to work even if those code is written poorly it will still help me grasp the osbot api better and what not. Also, thanks for cleanig up the states, would have never really thought to change any of those. will defiantly try my best to not have my states just to be a bunch of jumbled of if statements. thanks for the reply!
-
Need help with banking, bot just goes into bank and stand there
Still getting stuck, tried to just get rid of using the bank class and making an entity called booth and having it interact with that, but it still didn't work. I'm assuming its getting stuck within another case in the script and it doesn't know what its supposed to do. I'm stumped with this one.
-
Need help with banking, bot just goes into bank and stand there
I've had a few hiccups with this script but apaec has helped me through with most of it, basically when, it cuts down trees, and depending on your level will choose between willows, oaks or trees. it all goes well until it goes into the bank, it just stands there cluelessly. import org.osbot.rs07.api.Bank; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.api.Skills; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.utility.Area; import java.awt.*; @ScriptManifest(author = "Twin 763", info = "1-30 auto woodcutting levler", name = "Twin Power WC", version = 1, logo = "") public class Bf extends Script { @Override public void onStart() { log("If you experience any issues while running this script please report them to me on the forums."); log("Enjoy the script, gain some woodcutting levels!."); } Area BANK_AREA = new Area(3092, 3246, 3097, 3240); private int wcLvl2; private enum State { CHOP, BANK_WALK, BANK, TREE_WALK, WAIT, CHOPO, CHOPW,UNDER_ATTACK }; private State getState() { if (myPlayer().isUnderAttack()) return State.UNDER_ATTACK; if (inventory.isFull()) return State.BANK_WALK; if (!myPlayer().isAnimating()&&!inventory.isFull()) return State.CHOP; if (!myPlayer().isAnimating() && wcLvl2 >= 15 && wcLvl2 < 30&&!inventory.isFull()) return State.CHOPO; if (!myPlayer().isAnimating() && wcLvl2 >= 30&&!inventory.isFull()) return State.CHOPW; if (BANK_AREA.contains(myPlayer())) return State.BANK; if(inventory.isEmpty()) return State.TREE_WALK; return State.WAIT; } @Override public int onLoop() throws InterruptedException { switch (getState()) { case CHOP: Entity tree = objects.closest(1276, 1277, 1278); if (wcLvl2 < 15&&!myPlayer().isAnimating()&&!inventory.isFull()) { tree.interact("Chop down"); sleep(random(500, 1000)); break; } case CHOPO: Entity oak = objects.closest("Oak"); if (wcLvl2 < 30&&!myPlayer().isAnimating()&&!inventory.isFull()) { oak.interact("Chop down"); sleep(random(2000, 3000)); break; } case CHOPW: Entity willow = objects.closest("Willow"); if (wcLvl2 >= 30&&!myPlayer().isAnimating()) { willow.interact("Chop down"); sleep(random(500, 1000)); } case BANK: if (BANK_AREA.contains(myPlayer())) bank.open(); if(bank.isOpen()) { bank.depositAll("Logs,Oak logs, Willow logs"); break; } case BANK_WALK: if(inventory.isFull()) getLocalWalker().walk(3093, 3243); if (BANK_AREA.contains(myPlayer())) break; case TREE_WALK: if (wcLvl2 < 15&&!inventory.isFull()) { getLocalWalker().walk(3100, 3245); break; } else if (wcLvl2 >= 15 && wcLvl2 < 30&&!inventory.isFull()) { getLocalWalker().walk(3100, 3245); break; } else { getLocalWalker().walk(3090, 3234); break; } case UNDER_ATTACK: if(myPlayer().isUnderAttack()) getLocalWalker().walk(3093, 3244); break; case WAIT: sleep(random(500, 700)); break; } return random(200, 300); } @Override public void onExit() { log("Thanks for running my Auto Woodcutter!"); } @Override public void onPaint(Graphics2D g) { wcLvl2 = skills.getDynamic(Skill.WOODCUTTING); } } probably have thrown in way more logic than I need to try and figure this out but I just can't get it. i've found a few other issues with the code after posting this, but still couldnt find out what's wrong with the banking.
-
Suggest F2P scripts now!
I'm actually working on this right now, except it does it all in draynor. Didn't actual think anyone would be interested in it.
-
Trying to use getDynamic(Skill.WOODCUTTING); but it's saying that it's undefined by type bf(my class)
knew it, im so dumb lol. Thanks for the reply
-
Trying to use getDynamic(Skill.WOODCUTTING); but it's saying that it's undefined by type bf(my class)
int wclvl = getDynamic(Skill.WOODCUTTING); is what I have, basically I need it to get the woodcutting level and have it return it so the script can determine what to cut. edit: forgot to have skills in front of get. int wcLvl = skills.getDynamic(Skill.WOODCUTTING);
-
how to make it so mining script doesn't drop rune pick while mining?
That's a good point, i didnt think about that. Would you happen to know how I can make it only mine iron ore id's, and have it wait while it mines? I currently have Entity Iron = objects.closest("13455,13466"); but since they're right next to eachother, it would try and store both of them into iron at the same time and get nothing done, right? the ID changes when it's mined I figured having the ID there instead of just "Rocks" would prevent it from spam clicking the same vein over and over again.
-
how to make it so mining script doesn't drop rune pick while mining?
hmm i didnt see that, i ended up just doing inventory.drop("Iron Ore"); thank you for the response though!
-
how to make it so mining script doesn't drop rune pick while mining?
Trying to work my way up to making a basic motherlode mining script, but im having an issue doing this basic powermining iron script. everything in it should work, it drops my inventory then goes to mine iron. only issue is I can't mine without a pick. What's the code to ignore an item in the inventory?
-
How to have bot pick up birdsnare after a bird has been caught/it fell over
Thank you for this! Defiantly helped a lot since i'm still new with java, only about 6 months experience. I didn't even have any idea where to look in the api to find some of this since there's a lot there. Let me see if I can use this to get something basic out(just functionally, really) and I'll get back to you! thanks again =) I'm confused with this. Would I have to make another class with my project then make the snare object?Also, I never really thought arrays were useful so thanks for proving me wrong lol