Everything posted by dreameo
-
Sleep until?
For furnace, you would want to cond sleep when widget are null or no longer visible. You want to interact with furnace if you been idle for x seconds private boolean idleFor(int millis){ if(myPlayer().isAnimating()) { timeSinceAnimation = System.currentTimeMillis(); } else { timeSinceIdle = System.currentTimeMillis(); } return timeSinceAnimation + millis < timeSinceIdle; } variables are global
-
Cast telegrab on an item?
getMagic().castSpellOnEntity(NormalSpells.TELEGRAB, item)
-
Get closest player not me
using equals method is best suited for strings, it's not good to compare objects otherwise like that. String s = new String("hello"); String p = new String("hello"); s.equals(p) // true s == p // false;
- Gold bracelet
- Gold bracelet
-
if (YEW == null) is not working
lol, you just have to put your code in the right spot, but we don't have the source. Easiest thing to do is put it in the onLoop but that's a short term fix (for your overall development)
-
if (YEW == null) is not working
You have to update the tree object. You most likely initialized the tree object but failed updating the variable.
-
A Beginners Guide to Writing OSBot Scripts (where to get started!) by Apaec
fishing spots are NPC.
-
Not sure why my script isn't running
- Not sure why my script isn't running
public boolean hasItem(String itemName){ return getInventory.contains(itemName); } You just create methods to reduce any duplicate code. Example: I can call this method whenver i need to see if i have I have an item in my inventory. For more practical use, the methods you invoke will have larger pieces of code inside them.- Not sure why my script isn't running
Yea I agree Apa completly. But relative to the code by op, names of items are constant ;), regardless of how he sets up the code. I get what you mean however.- Open Source Woodcutting Script
Easier way to get tree area; Area yewArea = new Area(3203, 3506, 3225, 3497); Area oakArea = new Area(3171, 3425, 3159, 3399); Area areaToChop = getSkills().getDynamic(Skills.WOODCUTTING) >= 60 ? yewArea : oakArea;- Not sure why my script isn't running
This comes from Oracles code convention. Not sure what you're saying at the end lol.- Not sure why my script isn't running
Somewhat, you can create your own methods and then call them in the onLoop. When interacting with NPCs or Entitys, you need the references to those objects updated (i.e within the loop). Constants can be global as you have them (Strings, areas), the rest you should do within methods ;)- Not sure why my script isn't running
how he used string is good, if you put it in a method, you would be creating a string object everytime. Note, anything final should be left in uppercase (final string NAME = "")- Open Source Woodcutting Script
yea, think it's missing an ! at the if ;o- Simple Feather Collector By Flewis
Yes, however there is a case when you click, and are moving, a feather either disappears or is already taken. Yet the bot continues towards the feather that is no longer there.- Simple Feather Collector By Flewis
I thought of this too. Can check that current tile to see if it no longer has a grounditem called feather. ;)- Timer help
- How to make ore detection more accurate?
null rocks have a specific id- Setting mouse speed
Hmm.. Inside MoveMouseEvent is a seperate Vector class. I'm guessing the construction of the vector class is what initializes the speed of mouse.- Stealth Quester
nice script, can i get auth? Is there a particular order you can do f2p quests to ensure you have all the req for every next quest?- useOn()
I understand alek may have posted explaining but, you still haven't given me a valid reason. Saying that its more 'bot like' doesn't prove anything. And yes, I keep behavior strictly to what the method does. Same as the interact method in osbot, you must first check to see if an entity is not null and visible before you interact, it's not the responsibility of the interact method to do that. Simply creating a method to check beforehand is what you're looking for. I never rejected your criticism, i'm asking for clarification.- Acting based on inventory changing?
np, how was the implementation of inv listener? forgot: make sure to stop thread onExit- Acting based on inventory changing?
Credits: Modified source for osbot: Implementation: - Not sure why my script isn't running