-
Posts
763 -
Joined
-
Last visited
-
Feedback
100%
Everything posted by Flamezzz
-
So while this happens, is onLoop still being called? If this is the case, it's your script. If not, and you have no while loops, some API method is most likely blocking. The only method im aware of which may do that is localwalker#walk. It shouldn't be difficult to check where it goes wrong if you just add a shitload of log messages.
-
Nice snippet For moving the mouse inside the rect you might wanna use MouseEvent me = new MoveMouseEvent(new RectangleDestination(bot, menu.getOptionRectangle(idx))); that's what Menu#selectAction does (EDIT: might be better considering the upcoming resizable stuff )
-
you could use position.interact(bot, "Walk here")
-
Is it possible to drop inventory or items really fast?
Flamezzz replied to blueshirt's topic in Scripting Help
http://osbot.org/forum/topic/70076-mousekeys-like-mouse-movement/ -
GraphicsUtilities#drawModel?
-
in isMultiCombatArea() it returns health of npc > 0 else it returns not(npc is under attack) or npc interacts with myplayer and health of npc > 0
-
Is it possible to check if a grounditem is dropped by me?
Flamezzz replied to blueshirt's topic in Scripting Help
Highly doubt it, what's wrong with storing dropped items in a list? -
Is selecting an item at position 2 an issue? RS2Widget geSearchItemsMain = widgets.get(548, 125); for(RS2Widget item : geSearchItemsMain.getChildWidgets()) { if(!item.getMessage().equals("")) { log(item.getMessage() + " - " + item.getRootId() + ":" + item.getSecondLevelId() + ":" + item.getThirdLevelId()); } } -> [iNFO][bot #1][05/26 01:43:29 PM]: 3rd age amulet - 548:125:1 [iNFO][bot #1][05/26 01:43:29 PM]: 3rd age bow - 548:125:4 [iNFO][bot #1][05/26 01:43:29 PM]: 3rd age cloak - 548:125:7 [iNFO][bot #1][05/26 01:43:29 PM]: 3rd age full helmet - 548:125:10 [iNFO][bot #1][05/26 01:43:29 PM]: 3rd age kiteshield - 548:125:13 [iNFO][bot #1][05/26 01:43:29 PM]: 3rd age longsword - 548:125:16 [iNFO][bot #1][05/26 01:43:29 PM]: 3rd age mage hat - 548:125:19 [iNFO][bot #1][05/26 01:43:29 PM]: 3rd age platebody - 548:125:22 [iNFO][bot #1][05/26 01:43:29 PM]: 3rd age platelegs - 548:125:25 [iNFO][bot #1][05/26 01:43:29 PM]: 3rd age range coif - 548:125:28 [iNFO][bot #1][05/26 01:43:29 PM]: 3rd age range legs - 548:125:31 [iNFO][bot #1][05/26 01:43:29 PM]: 3rd age range top - 548:125:34 [iNFO][bot #1][05/26 01:43:29 PM]: 3rd age robe - 548:125:37 [iNFO][bot #1][05/26 01:43:29 PM]: 3rd age robe top - 548:125:40 [iNFO][bot #1][05/26 01:43:29 PM]: 3rd age vambraces - 548:125:43 [iNFO][bot #1][05/26 01:43:29 PM]: 3rd age wand - 548:125:46 items are at interface 548:125:(1+3p)
-
return true if any other player is on a certain tile
Flamezzz replied to blueshirt's topic in Scripting Help
players.get(x,y).size() > 0 -
Smth like this? inventory.dropForFilter(item -> item.getName().equals("Item Name") && inventory.getAmount("Item Name") > 10); 10 can obv be replaced with getAmount-5 before you use this statement if you want
-
interact() returning true even though entity is not interacted with
Flamezzz replied to abotter's topic in Scripting Help
I'd use something like: if floor = 1 then attempt to click ladder wait for a small amount of time if moving/animating then wait a little longer (LocalWalker#waitUntilIdle() or smth similar) As Mysteryy points out you shouldn't use a while loop. You want to do 1 action each time the onLoop method executes. -
Return true if there are 10 dropped buckets on the floor
Flamezzz replied to mlrkey's topic in Scripting Help
Or just: groundItems.filter(item -> item.getName().equals("Bucket")).size() == 10 -
Well if it is any faster the speed improvement is negligible. The main advantage is that it's clean, and you can't really do anything wrong in this method as long as your filter is defined correctly (and of course interact works). In this case it doesn't really matter if you return a void or boolean, just did that because interact returns a boolean ^^
-
You could use a filter, some info: http://osbot.org/forum/topic/71713-objectsgetint-int-and-grounditemsgetint-int-not-working/ What you're doing right now is get the closest sheep and then check if it meets a few requirements. You could do this using a filter like this (not tested): public boolean Shear() { if (myPlayer().isAnimating()) return true; Area SHEEP_PEN = new Area(3193, 3257, 3211, 3276); NPC sheep = getNpcs().closest( npc -> npc.getName().equals("Sheep") && SHEEP_PEN.contains(npc) && npc.hasAction("Shear")); return sheep != null && sheep.interact("Shear"); } You basically say give me the closest npc which: has the name "Sheep", is located in the SHEEP_PEN area and has an action "Shear". interact should then turn the camera if needed.
-
Hi welcome and good luck! Your first script looks promising Alright, I briefly checked your script ;) First of all when you script it's important to use an IDE such as eclipse or IntelliJ IDEA. Using IntelliJ you can jump to the (decompiled) implementation of an API method, so you can actually see what it does. There's this line in your script: while (bank.isOpen()){ bank.close(); ... if we check the implementation, bank.close() already checks if the bank is open. I use this very often, perhaps it's useful for you as well to understand what exactly the api methods do. Arrays.asList(stairs.getDefinition().getActions()).contains("Climb-down") could be simplified into stairs.hasAction("Climb-down") You could also check out the doorHandler api, it most likely support gates. You specify what position you want to walk to and the doorhandler opens any doors/gates between the player and the target position. There are a lot of nested if statements :p I remember I did the same thing when I first started scripting. It's very difficult to debug, so you might want to avoid it ;)
-
Can be done in advanced settings:
-
The google web crawler? :p
-
Login and welcome screen messing up my script
Flamezzz replied to anderiel's topic in Scripting Help
You probably want to use one of the client methods: http://osbot.org/api/org/osbot/rs07/api/Client.html like client#isLoggedIn() or client#getLoginState(). Hmm in the welcome screen you're already logged in since it activates when client.isLoggedIn() && widgets.isVisible(378); You could also check for that widget (or specific colors) yourself. -
I wasn't really serious, but this is great for my post count So if you wanna buy for 2/m add me Edit: this was not intended to boost my post count...
-
2 + fee and you go first, I don't trust cats
-
2.1 + fee Skype: flamezzztw2
-
I can sell you a $5 voucher for 2.5m 07gp. Skype: flamezzztw2
-
There's a blacklist to prevent that. Apparently some people are willing to take the risks, let them :p
-
So you just bother us with that... that... yeah I guess it's not that bad after all. Damn it.