Everything posted by Flamezzz
-
Need help with opening doors
doorHandler.handleNextObstacle(position) or doorHandler.handleNextObstacle(entity) Where position is the position you want to walk to. Make sure the object type of the door = 0, you can use the entity debugger to do this.
-
Grand Exchange
Well you don't create a GrandExchange instance yourself, it's already there. import org.osbot.rs07.api.GrandExchange; .... grandExchange.buyItems(GrandExchange.Box.BOX_1);
-
Use an item in specific slot help
mouse.click(inventory.getMouseDestination(slot)) something like this
- Hotkeys
-
Need some help with my first script
No I'm quite sure it does, I've implemented it like this in a script :p
-
Need some help with my first script
Mkay lets start with what you have now. npcs.closest("Cow").interact("Attack"); If there is no cow this will throw a NullPointerException. So what you want to do is NPC cow = ... if(cow != null) cow.interact.... But you're not checking if this particular cow is already under attack, dead or even reachable at all. And what if you're already attacking a cow? I suggest you first write that part of the script, attacking a cow and waiting while in combat, then add looting and finally banking. For banking, use bank.open() and never use a while loop like that. If your current state is banking, you could check the distance to the closest "Stairs". If you want to bank and there is a stairs then "Climb-up" if myPosition().getZ() < 2 else bank.open()
-
Need Java dev to help with a small project
I could do this, but not for $2 and most certainly not in java :p It would be helpful to post an example captcha (if it doesn't reveal too much about the project) since there are libraries to solve the easy ones but others are somewhat more complex... even for a human.
-
How to use widget debug?
You match the rectangle color with the numbers in that specific color, the first number is the parent widget ID, second is child widget ID etc. You would then use widgets.get(parentID, childID) to access it.
- [Need a Private Script] - Donating with RSGP/PayPal $
- Requesting PM Bot
-
I'm a noob and need some help
I'm pretty sure it's Limpwurt root, dunno what's causing osbot to crash tho...
-
Whats up in Al-Kharid?
You can barely make 20k/h now, it used to 40k/h...
-
Issue with localWaler.walkPath
1. I would recommend counting the amount of times you loop and not use actual minutes, since this wouldn't work when taking breaks. Something like: int loopCount = 0 in onLoop: loopCount++ if(loopCount % 1000 == 0) // check if xp > last xp >>> Note: this failsafe wouldn't work when a flaw causes your script to not loop anymore (localwalker ) 2. When a RandomSolver is active your script is paused and once it's finished it will be resumed. So during this time onLoop will not be called.
-
Issue with localWaler.walkPath
if (inventory.isFull()) { return State.WALK2BANK; } So if your inventory is full, you always return State.WALK2BANK. I think you want to move if (inventory.isFull() && bankArea.contains(myPlayer())) { return State.BANK; } this before the other if so that it is evaluated first.
-
How do I make my paint show up?
public void onPaint(Graphics2D g) { I think the issue is you're not overriding properly
-
ϝHerbCleaner
ϝHerbCleaner Features: - Cleans all herbs - 5 click patterns - Logs out when done - 6000 cleans/hour - Basic antipatterns Proggy:
-
Request: Flax Spinner
http://www.megafileupload.com/4Vzj/FFlaxSpinner.jar Local script folder = user/OSBot/Scripts
-
Request: Flax Spinner
You'd have to compile it yourself... package org.flamezzz; import org.osbot.rs07.antiban.AntiBan; import org.osbot.rs07.api.map.Position; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.api.ui.RS2Widget; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; import java.awt.*; /** * Created by Flamezzz on 16/07/2015. */ @ScriptManifest( name = "FFlaxSpinner", author = "Flamezzz", version = 2.1, info = "Spins flax in lumby.", logo = "" ) public class FFlaxSpinner extends Script { private long lastDeposit = 0; private int made = 0; private long start; private int total_flax = 0; private int total_bs = 0; public void onStart() { start = System.currentTimeMillis(); antiBan.unregisterBehavior(AntiBan.BehaviorType.RANDOM_MOUSE_MOVEMENT); } @Override public int onLoop() throws InterruptedException { log("Loop"); if(widgets.get(402,2,11) != null && widgets.get(402,2,11).isVisible()) { widgets.get(402,2,11).hover(); mouse.click(false); sleep(1000); } if(settings.getRunEnergy() >= random(20,40)) settings.setRunning(true); RS2Widget enterAmount = widgets.get(162,32); RS2Widget spinWidget; if(enterAmount != null && enterAmount.isVisible()) { log("Entering amount"); int rnd = random(3,9); keyboard.typeString(Integer.toString(rnd) + Integer.toString(rnd), true); sleep(random(600,900)); log("Waiting until done spinning"); int level = skills.getStatic(Skill.CRAFTING); int loops = 0; while(inventory.getAmount("Flax") > 0 && level == skills.getStatic(Skill.CRAFTING) && loops < 200) { sleep(random(300,600)); loops++; } sleep(random(400,700)); } else if( (spinWidget = widgets.get(459,93)) != null && spinWidget.isVisible()) { log("Make X"); spinWidget.interact("Make X"); sleep(random(200, 600)); } else if(myPosition().getZ() == 0) { objects.closest("Staircase").interact("Climb-up"); } else if(myPosition().getZ() == 2) { if(inventory.getAmount("Flax") > 0) { if(objects.get(3205,3208).get(0).interact("Climb-down")) { new ConditionalSleep(7000) { public boolean condition() throws InterruptedException { return myPosition().getZ() == 1; } }.sleep(); } } else { if(bank.isOpen()) { if(inventory.getAmount("Bow string") > 0) { bank.depositAll(); sleep(random(200,400)); if(System.currentTimeMillis() - lastDeposit > 20000) { made += 28; lastDeposit = System.currentTimeMillis(); } } else { if(bank.getAmount("Flax") <= 28) { log("Out of flax!"); bank.close(); stop(); } else { bank.withdrawAll("Flax"); } total_bs = (int) bank.getAmount("Bow string"); total_flax = (int) bank.getAmount("Flax"); } } else { if(map.getDestination() == null || map.getDestination().distance(myPosition()) < 6) { if(myPosition().distance(new Position(3208, 3218, 1)) > 6) { localWalker.walk(new Position(3208, 3218, 1)); } else { bank.open(); } } sleep(random(300,700)); } } } else if(myPosition().getZ() == 1) { if(inventory.getAmount("Flax") > 0) { if(myPlayer().isAnimating() && !myPlayer().isMoving()) { } else { RS2Object wheel = objects.closest("Spinning wheel"); if(map.canReach(wheel)) { if(wheel.interact("Spin")) { log("Interacted with wheel sleeping..."); new ConditionalSleep(7000) { public boolean condition() throws InterruptedException { return widgets.get(459,93) != null && widgets.get(459,93).isVisible(); } }.sleep(); log("Done"); } } else { doorHandler.handleNextObstacle(wheel); } } } else { RS2Object stairs = objects.get(3204, 3207).get(0); if(map.canReach(stairs)) { if(stairs.interact("Climb-up")) new ConditionalSleep(7000) { public boolean condition() throws InterruptedException { return myPosition().getZ() == 2; } }.sleep(); } else { doorHandler.handleNextObstacle(stairs); } } } return random(300,500); } public void onPaint(Graphics2D g) { g.setColor(Color.ORANGE); g.drawString("Running: " + format(start), 300, 100); g.drawString("Made: " + made, 300, 130); g.drawString("Total flax: " + total_flax, 300, 160); g.drawString("Total bowstring: " + total_bs, 300, 190); g.drawString("World: " + worlds.getCurrentWorld(), 300, 220); } public String format(long starttime) { long time = System.currentTimeMillis() - starttime; StringBuilder string = new StringBuilder(); long totalSeconds = time / 1000L; long totalMinutes = totalSeconds / 60L; long totalHours = totalMinutes / 60L; int seconds = (int)totalSeconds % 60; int minutes = (int)totalMinutes % 60; int hours = (int)totalHours % 24; if (hours > 0) { string.append(hours + "h "); } if (minutes > 0) { string.append(minutes + "m "); } string.append(seconds + "s"); return string.toString(); } }
-
Activating Quick Prayers & Some Item advise
Interact also left clicks. Finding widgets ids: http://osbot.org/forum/topic/79422-cook-all-option/?view=getlastpost
-
Cook All Option?
You need to use widgets. Go to settings and enable widget debugging. Now you see something like this: So the parent widget id = 307, child id = 4 RS2Widget cookMenu = widgets.get(307,4); if(cookMenu != null && cookMenu.isVisible()) cookMenu.interact("Cook All");
-
script wont launch
I don't even know where to start Well... first of all, this: Inventory inven = client.getMethods().getInventory(); Player player = client.getMethods().myPlayer(); Bank bank = client.getMethods().getBank(); What are you trying to do here? You already have access to the inventory by calling, for example, inventory.contains() directly. Same for player and bank. The reason the script doesn't start is that client doesn't exist yet, any initialization should be done in onStart. if(inven.isEmptyExcept(995)){ Should just use inventory.isEmptyExcept(995). if(BANK_AREA.contains(player)){ You have access to the local player through myplayer() ellis.getMethods().getWidgets().getWidgetContainingText("Hard Leather").in teract("All"); All methods are already accessible from the script itself. You can directly call : getWidgets().getWidgetContainingText("Hard Leather").interact("All"); Also, banking can simply be done by calling bank.open(), you don't have to do there interaction yourself
-
uses up too much memory
java -jar osbot.jar 1000
-
POH Locations
Ye there were some other bits set in config 738, but as liverare posted the enum values should of course be indexed and not iterated as I did.
-
POH Locations
Returns POH location found in config 738. My cons is quite low so I've only tested this for rimmington/taverly/pollniveach, unless they do some weird shit it should work for other locations as well. Note: positions for brimhaven/yanille are missing atm. public class POH { private static final int POH_CONFIG = 738; public static POHLocation getLocation(MethodProvider api) { int c = api.configs.get(POH_CONFIG) & 0x7; // clear other bits return POHLocation.values()[c]; } public enum POHLocation { None(0x0, new Position(0,0,0)), RIMMINGTON(0x1, new Position(2953,3224,0)), TAVERLY(0x2, new Position(2893,3465,0)), POLLNIVEACH(0x3, new Position(3340,3003,0)), RELLEKKA(0x4, new Position(2670,3631,0)), BRIMHAVEN(0x5, new Position(0,0,0)), YANILLE(0x6, new Position(0,0,0)); public final int mask; public final Position position; POHLocation(int mask, Position position) { this.mask = mask; this.position = position; } } }
-
4 Accounts banned at same time...
Imo f2p isn't worth botting unless your farm is fully autonomous, so accounts get replaced upon being banned and your mule auto collects. Accounts simply don't last too long in f2p, especially when low level.