Everything posted by Alek
-
Objects on Ground?
Show the execution result for the event. You may want to take a look at our API, there are definitely ways to right click. InteractionEvent is built using the same API which you have access to; meaning that you can write the same exact methods which we wrote.
-
GrandExchange, how to buy items and sell them?
Well I think most of it should come back to you fairly quickly then. Just be careful when using static ids; scripters get lazy and use them but in the long run it requires a lot more work because of maintenance. If you have issues finding widgets without the use of static ids, I could write a small tutorial on it to introduce the basic idea.
-
OSBot 2.4.99 - Bot Farmer's Dream
It's a development build. Go to the forum index, right hand side it says "Advanced User Panel", its a small box.
-
OSBot 2.4.99 - Bot Farmer's Dream
As discussed in my previous posts, I mentioned that RandomBehaviorHook was a thing of the past and needed to be ditched desperately. Starting today you can remove all OSBot randoms and have your scripts execute and soon as you start it through a new CLI allow argument, "norandoms". What does this mean? "norandoms" removes ALL random events including AutoLogin, BankPin, WelcomeScreen, etc. Scripters can now use the LoginResponseCodeListener and decide how they want their script to function during the login process. Additionally I took at look at the ResponseCode class and updated the methods isConnectionError and isDisabledError (thanks to @Th3 for providing the updated codes). This in turn gave me reason to update the AutoLogin random to make it a bit more responsive and predictable. What we have now: switchAccount - Properly swaps accounts on the current bot instance "norandoms" - Allows farmers to create truly automated farms No hacky external programs, no confusing hooks, just simple botting. Changelog: -Added CLI parameter norandoms -Updated ResponseCode class -Updated AutoLogin I hope everyone had a fun and safe Halloween (for those who celebrate).
-
"NPC Could not be resolved"
Think about it logically, you're using "closest". It will always return the closest cow to you and if that closest cow is under attack then you are going to be waiting until that cow is killed. Use one of the methods above to filter cows by distance/area, health > 0, not under attack, etc. After that you're going to want to sort those results by distance. This way you only get cows which you can attack, ordered by distance (instead of all cows which you don't know if you can attack or not).
-
"NPC Could not be resolved"
NPCs closest returns a single NPC, not a collection of NPCs for you to filter. You want something like: Optional<NPC> suitableNpc = getNpcs().getAll().stream().filter(npc -> npc.getHealthPercent() > 1).findFirst(); if (suitableNpc.isPresent()) { suitableNpc.get().interact("examine"); } You may want to look a little bit into Java 8 streams before using them. Edit: Or better yet you can use the FilterAPI way which is native to OSBot getNpcs().closest(new Filter<NPC>() { @[member='Override'] public boolean match(NPC obj) { return obj.getHealthPercent() > 1; } }) ; EntityAPI: http://osbot.org/api/org/osbot/rs07/api/EntityAPI.html
-
GrandExchange, how to buy items and sell them?
Well if he uses snippets because he doesn't understand how to write the methods, that's not teaching him anything. He should spend some time learning more about widgets and understanding our API. That will make him a better scripter and programmer in the long run. Edit: Widgets is a good way to learn inheritance
-
Calling an Instance in onLoop
Learn how to code before you copy-pasta task node systems. Also why the hell are you passing script and not the Bot instance? Edit2: I deleted that tutorial Too many new scripters are using those node frameworks without understanding them. There is nothing wrong with using the simple loop until you understand OOP. Once you learn more about Java, you will be able to write and understand that node system. For now, just stick with learning step by step.
-
GrandExchange, how to buy items and sell them?
If you can't figure it out you should probably be writing a script which you can write. The API spoon feeds a lot, a little too much actually. Learn more about widgets.
-
OSBot 2.4.98 - Account Switching Supported
Now you have no reason to use hooks. Botters: -Your account details are still protected if you are using the official OSBot Account Selector -Any information you put outside of the OSBot Account Selector is not safe Scripters: -Do NOT put a script that uses account switching on the SDN - harsh penalties Bot switchAccount(String username, String password, int pin) -Go Wild and Happy Botting
-
OSBot 2.4.97 - Small Stuff and Debug
Random Events History (long read): A very long time ago Random Events were required, until they were removed because bots could solve them. During this time we had something called a RandomBehaviorHook which would allow a scripter to implement their own Random Event solver, ignoring the OSBot solvers. Since then, Random Events are no longer required to be solved and many of them can be simply dismissed. At no point was a scripter ever allowed to remove our solvers, simply overwrite them with their own. In addition to your standard solvers (such as Prison Pete or Freaky Forester), events such as Bank Pin and Welcome Screen are also "random events" which we solve. We started running into common issues where scripters would overwrite random events with their own events, only for their implementation to be much worse. Of course the Development team would get yelled at for these issues, unknowingly that Scripters were responsible. Since that point, it's become impossible to overwrite these solvers for two main reasons: 1. Events such as Bank Pin and the Login Screen should really only be handled by us 2. There are security risks in allowing a scripter to handle these events Subsequently Scripters have been trying to use unregisterHook on solvers, although that does nothing because a hook is not a solver. You cannot remove a solver, only hooks which you have registered. Changelog: -Removed RandomExecutor registerRandoms -Removed RandomExecutor registerHooks -Removed unregisterHook(RandomBehaviorHook) -Removed unregisterHook(RandomEvent) -Removed hasHook -Removed RandomExecutor clearHooks -Removed RandomBehaviourHook -Deprecated Entity examine() - Use InteractionEvent -Removed ScriptAnalyzer tab until it's reactivated -Added MyPlayer debug -Happy Botting
-
Stuck - script won't start
It was better the way you had it before, primitives are better. int check = new Integer(0); This still does nothing because willow is null: private Entity closestObjectForName(String WILLOW_TREE) { // TODO Auto-generated method stub return willow;//FIX THIS FUCKING NULL } Actually, how is your script even compiling? Your method doesn't have access to "Entity willow". What is this? public TP(String name){ this.willowtree = Objects.requireNonNull(willowtree); } You're assigning a generic to a string? Just delete this altogether. Why are you writing your own custom methods for things that already exist in the API: @SuppressWarnings("unused") private void castSpell(MagicSpell spell) { // TODO Auto-generated method stub NormalSpells vartele = Spells.NormalSpells.VARROCK_TELEPORT; } The reason I'm having a hard time believing that you wrote this is because you wrote a ton of code without testing it until now? When was this script last working?
-
Stuck - script won't start
Good catch @@Imateamcape
-
Stuck - script won't start
You have a lot of dangerous code in there, it could be just about anything. For starters: int check; always returns Falador after check > 3, and it's never reset. I'm assuming you wanted your logic to cycle through the farming patches? Anyways, your second state is Varrock (which is should be reaching). You call: willow = closestObjectForName(WILLOW_TREE); That method returns null every time: private Entity closestObjectForName(String willow_tree2) { // TODO Auto-generated method stub return null; } So either your script throws an NPE and crashes at: getCamera().toEntity(willow); or your null check for the willow tree later down prevents your script from doing anything. Did you even write this script?
-
WebWalker - noClassDefinitionError
Is he using a cracked version of OSBot from a year ago? Edit: Need to know more information.
-
NATIONAL ALEK APPRECIATION DAY.
I like the use of whitespace and calligraphy, very eloquent. I accept this day of honor.
-
Hit splats API?
There was an issue with the HitSplatListener (I think that was the name). We used to use it in legacy code a while back, then found a more efficient way. After some time the listener broke, nobody used it, and I believe I either deprecated it or deleted it.
-
ArrayList to Area
Ah I see; nope you got some good suggestions. Good luck with your tool!
-
ArrayList to Area
Every time you add or remove a position from that area, you should be reconstructing that Area using the new positions in the list (after converting to an array). Or is your issue converting from a list to an array?
-
[Suggestion] GrandExchange#getItemName(Box)
It's not based on configs or widget data, but a separate hook. ItemDefinition.forId(getGrandExchange().getItemId(GrandExchangeBox)).getName();
-
Script Not Starting - No error messages or anything :0
I see in your onPaint you have a fancy but useless mouse paint. How about adding a functional output which displays your current state? This way you can at least see which state it's stuck on. Some additional tips: Worry about making a properly functioning script, that will save you from more bans than bullshit tinfoil logic. If you are interested why, look into linear regression. It's something you will learn if you take a Statistics course in High School/University. Use Java conventions for your brackets. if(conditional) { //Code here } Not: if(conditional) { //code here } This doesn't execute: new ConditionalSleep(20000, 25000) { ConditionalSleep(timeout, recheck) Should be something like (20000,1000). The one parameter form does a recheck every 50ms. Edit: Hid your old topic
-
GE Help
Don't want to be rude, but you're recreating Grand Exchange API with methods that are very unstable and not particularly efficient. You used third level static ids which are really prone to breaking on any update involving the Grand Exchange. Additionally that ConditionalSleep will never execute. GrandExchange isSellOfferOpen() We have hooks for this. http://osbot.org/api/org/osbot/rs07/api/GrandExchange.Status.html Should look something like this: if(getGrandExchange().getStatus(GrandExchangeBox).equals(GrandExchangeStatus.FINISHED_SALE)
-
OSBot 2.4.96 - Bunch of Treats, No Tricks
Fixing real quick Edit: Try now
-
OSBot 2.4.96 - Bunch of Treats, No Tricks
I'm going to count this as my Halloween release, so I hope you enjoy the spookiness. -Added Web Walking Link: Yanille Agility Obstacle (suggested by @Imateamcape and @Chris) -Added Web Walking Link: Ardougne Agility Obstacle (suggested by @Molly) -Modified various Web Walking timeouts, should recover a bit quicker (various suggesters) -Patched Store API not purchasing the correct amount of items -Added Store method sell(int itemId, int amount) (suggested by @House) -Added Level-7 Enchant spell (suggested by @Solzhenitsyn) -Added 6 new Banks --PISCARILIUS_HOUSE --LOVAKENGJ_HOUSE --LOVAKITE_MINE --SHAYZIEN_HOUSE --ARCEUUS_HOUSE --HOSIDIUS_HOUSE Stay safe, check your candy for razor blades and firearms, and keep your bots running while you're out enjoying yourselves.