-
Posts
252 -
Joined
-
Last visited
-
Feedback
100%
Everything posted by Nbacon
-
what are doing? does it it have an interface or animation?
-
Hey pigfarmer, I don't know if this works public RS2Object something() { for (RS2Object x:getObjects().getAll()) { if (myPlayer().isInteracting((org.osbot.rs07.api.model.Character<?>) x)){ return x; } } return null; } Also you might want to put questions in https://osbot.org/forum/forum/249-scripting-help/ not https://osbot.org/forum/forum/251-snippets/
-
@Lol_marcus idea could work but https://osbot.org/api/org/osbot/rs07/api/util/ItemContainer.html is better becuase Equipment extends it and gets methods like contains(stuff...), getItems(), onlyContains(stuff...). Items[] MyArmor =getEquipment().getItems()
-
Ironic. Hey, xghostsage please stop posting useless comments to bost your Post count. In the last hour you have made 50+ post [he has around 50 posts] [15 min update 70 post] [45 min update 100 post] I would like a real price check for this.
-
70 smithing Coal bag ice gloves Full Graceful
-
You could do that, there is nothing wrong with that. Its almost the same amount or more work(When i used that method it seemed like 3 times more work) as what this code does. This code is just Id10t proofing the sending, resiving and execution of data. No need to encode and decode data, No need to cast Strings to objects, and No need to make a parsing tree that only you can use because you made it. All you have to do is connection.addPacket(new YourPacket(info , info, info....));
-
I don't know what you mean I have packet x with String i, int j, long k I make an x packet. I give you an packet with only the info. You read the packet and see id, oh its an x packet so you know it has a string i, int j and a long k. We both agree that all x packets need string i, int j, and a long k but we dont care what the others dose with info. There only so much you can do and having molds for the grabage in and garbage out is usefull.
-
I don't think I under stand this fully explain more. Becuase to me they are protocol becuase both sides agree on info that is sent over the sockets. You dont need packets to be mono taskers. But they can keeping a theme in a packet, this is usefull for expandability (for me at least). For my bot at least I have never needed more then 5 "packet", The bots are kept in the dark about the 30 other packets they cant see but the server can handle all 35. This sounds like what it is doing.(I don't Know how you would do this externally)
-
Webwalk Can I make it so it does not check the quest tab every time? Where can I find a list of all supported charter, Tp, and other? Any way to save a path?
-
Hello there, I origanal made a post about this in Unofficial Scripts & Applications. But see how no one wants it. I'm moving the updates to Off-topic. When making Bots in I believe that best bots can stop and start at any time and keep going with mininal globle variables and find its place based off state of the bot. So this project is a full blow programming laungage called scheme a flavor of lisp writen in java (writing one language in another? yes). Scheme is a functional programming laungage so that means runs of the idea of Lambda expressions and inputs. Lambda expressions make funtions that take 0 to N inputs and can be thought of as the same like math funtions were you have some inputs/none to 1 output [example f(x,y) = x+y+5]. Scheme is not typed this means thay you can pass any to a funtion like other funtions, good and bad data. It can "find out" if programed to know what to do with the data. This weeks update is under this post The basics of Sceme (extensive https://www.scheme.com/tspl3/ ) Why I do I think funtional programming better then java? Because you can keep data and methods separate, the abilty to pass functions as parameters and Currying https://en.wikipedia.org/wiki/Currying. You can make a basic functional programming laungage in 500 lines or less in C. I can program program alot faster, I made an AIO woodcutter 2 hours becuase when I program like a dfs I believe they run faster, are easier to change/mantain and use less resourses. Showing off the basics [updated 07192020] Videos+Scripts AIO Woodcut video [updated for new code] Wc code rewriten for super banker saves around 300 lines of code. AIO Firemaking video AIO F2P runecrafting video Features You can make 1 liner bots. Implents 95% of Osbot api Live updates Funtions Local, globle and private variables Can do any thing lazy-scheme can do. Light weight memory becuase of the runtime abilty you only use the memory you need for that task at hand then drop it after words. Flat/Deep recursion https://inst.eecs.berkeley.edu//~cs61a/su10/resources/Carolen Notes/week6.pdf Tail recursion https://en.wikipedia.org/wiki/Tail_call Threading Async only map , folds, letrec, and bang map f(x) [1 2 3 4] ->[ f(1) f(2) f(3) f(4) ] https://en.wikipedia.org/wiki/Fold_(higher-order_function) https://docs.racket-lang.org/reference/let.html (!) bang sets value and can destroy mean of define. (define x 5 ) [like x=5 ] !x 7 [ x is now 7] Loops but they are bad with functional programing Switches, cond, if else https://docs.racket-lang.org/reference/if.html Classes and Objects Done in a jankie way. Goals Make abilty to have packages (current Goal) test about 600 500 400 300 more methods Gui system like scratch Gui that can be made at runtime Implement ansi common lisp (50% done) Dictionaries and hashmaps(current in O(n) time but can get to O(1) time) Arrays [have not needed them yet so i have not added them.] Program Goals AIO skilling system (like Expv's AIO) RC FM WC Combat Herblore Fletching AIO quest system All ftp quest done Account builder system like level 3 to MMF bot and level 3 to blast furnace with coal bag and ice gloves. Number of bots baned: 3 Feltching testing(injection) Some quest (my guess dorics quest.) Banned after doing Monkey madness. [no idea on cause] Cook assistant quest
-
NPE when trying to access MethodProvider instance
Nbacon replied to Epos OSBot's topic in Scripting Help
Avrae works but this will fix your problem without change any of your old code. public static MethodProvider MP = this;//script extends the MethodProvider -
Hello, I hope this code helps you. [edited 06072020] Over heads is about 10-20mb of ram but is worth it becuase of how flexable it is. How to use new Packets Packets are usefull because you can send data and both sides know what is being sent and how to use it. Examples of packets I have made mouse packet that takes an x and a y and a mouse button and when executed will click on the screen. The example below is from my login packet takes a name, password and a world. The server will send this to a client and using code in the script will log in. Goto src/com/bacon/eco/server/shared/packets Make a new Packet that "implements IPacket" Go to PacketType enum add this line ClassName(last number ++ , com.bacon.eco.server.shared.packets.ClassName.class), You will see 4 override methods echo, send, receive, execute in the new Class you just made Make 2 constructors like This. One needs to have 0 args taken, other can take what ever you want. public LoginPacket() { } public LoginPacket(final String username, final String password, final int world){ this.username = username; this.password = password; this.world = world; } echo -has a boolean and if the server ever gets this packet it will send the info to everone- good for pking and ge merching. send - Inside send you need to use connection.writeString, connection.writeInt, ... and others in the order that you want to send them @Override public void send(ActiveConnection connection) { connection.writeString( this.username); connection.writeString( this.password); connection.writeInt( this.world ); } receive - Inside receive use connection.readString,connection.writeInt in the same order as above. @Override public void receive(ActiveConnection connection) { this.username =connection.readString(); this.password=connection.readString(); this.world =connection.readInt(); } execute - put what you want your bot to do here @Override public void execute(ActiveConnection connection) { if ( Client.mp !=null) Client.mp.loginToAccount( username,password ); if ( Client.mp !=null) Client.mp.hopto( world ); } This will does the same this as excute inside the packet (just rember to leave execute blank or it will do both). make getters and inside Client -> handlePacket -> add code like this if (clazz == LoginPacket.class) { final LoginPacket packet = (LoginPacket)Ipacket; if ( Client.mp !=null) Client.mp.loginToAccount( packet.username() ,packet.password() ); if ( Client.mp !=null) Client.mp.hopto( packet.world() ); return; } How to add P2P messages Make a new Class Add it to the Enum PacketType Goto com.bacon.eco.server.server.network.Controller under handlePacket make code like this Test your code (example P2PMessagePacket) go to TestClient write some code like this. compile and run Change the code to un comment to see them talk to each other. out put shoud look like Adding useful info AbstractPingPongPacket these send a request for data [Advance] PingPacket this updates the server ever 3 seconds. info that could go in here userloged in username [example script you need write this your self] current script runnign User location much,much more Sever-side Tuning Basicly you can make methods that can be controlled by a gui or CLA with a scanner : Example This tells all accounts to log out or just some amount. public void sendlogouts(int logoutAmount) { final Set<ActiveConnection> clientSet = clients.keySet(); int count = 0; for (final ActiveConnection connection : clientSet) { if (connection.getType() == 1 && (count < logoutAmount || logoutAmount == -1)) { count++; connection.addPacket(new LogoutPacket()); } } } Adding it to your scripts Examples from my scripts This is code was my frist draft on networking.Code update to add change in How to use [06072020] Things that can be added: if your connection drops out then try to reconnect. Better way to drop old conections- at the moment if you get sent 10 null messages in a row the connetion is droped. Things that can be ran TestClient Mainserver Example (script) Any questions or help just ask. update [06072020] Username is example script needs to be defined in some way by you. code_06072020.zip
-
Killing two birds with one small thermonuclear device. You don't need a botting client for xp checks.... Download something like jitbit macro recorder they have a trial. make 1 recording at a time were you start in the bank or some solid static item and use add an image check before run that one recording.
-
I use the Ge and Items that are never trade so I just buy from myself 100 "apple pies" (not the item) for 3k each and sell them back for 200 gp. I keep the pies and the 280k profit. I have a few item one with an 8k margin and my bots are set up to buy this item after some gold threasehold so muling is never needed . Only problem is people under cuting your item so I do price check befor the transfer.
-
My thoughts: (opinions ) I made a mutiboxer that had the abilty to record the objects, menu options , wait for widgits, and title potions you clicked. It used the osbot api to make almost bullet proof macros. If the camera moved the bot would still work, if there was npc infront of something you need to click on it still worked. Long recordings just invite failure and would take alot of input. Do you think there's any validity to this approach? No, why? you are not using any osbot api so why would you need osbot to do this? Most bans are client checks (*opinion* needs a fact-check) JNativeHook library comes off as malicious and always gets deleted my by anti-virus. there is a macro recoder on osbot already with abity to load your own macros maybe record and inport to thier format . scriptID 1012
-
General advice for debugging slow/unresponsive scripts?
Nbacon replied to Impensus's topic in Scripting Help
Sorry I can't help you more. Its most likly something supper small. Sounds like a mermory leak or a threading problem. If a memory leak limit recursion and making new objects. If a threading problem try this. (I like ExecutorSevices to kill all threads.) That sucks. Maybe take out features add them back 1 at a time till you find the problem? -
Thanks. Functional programming program hits harder then any oo language on a résumé. (personal opinion ofc) Thanks. I don't think you understand how many times I rebuild scripts..... but amazing tip nevertheless.
-
General advice for debugging slow/unresponsive scripts?
Nbacon replied to Impensus's topic in Scripting Help
I agree with Ace. This sounds like your tring to use something that is null fixing this will help the memory issue. Fixes? Try/catch around the loop this is a bandaid for gun shot or null check everthing this is just a pain in the ass but saved me many heart aches . Follow questions to get a better answer. Can you stop the script after sometime or do you have to force kill it if this does happen? Do can you see the log? Is it only in one section of the script or you can't tell. -
Thread moved to Offtopic with Silent Updates. OG post Interesting title Ahoy all, Im here to show off my most resent project. Latly, Ive been programing alot of bots and find it to be the biggest pain in the ass is remake a jar after update the programing or to testing one part in my bots. So to slove this problem that is such a minor inconvenience and legit takes at most 5 minutes out of my life per script. I went a head and invested my lunch, test and break times to make my own run time programing language bases off scheme. So this was not a small under taking (15000 line and 30+ hours) but I think it 100% worth it. After I get It all methodes test because there are 100's of them. I would like to slap a gui on it that looks like scratch and apply to put it in the SDN. Ill post updates here and if anyone has any suggestions ill take them. Video (Also this is a lot kewler than you think it is) Example of working code. I need suggestions on how to test shit loads of code with out test cases for everthing. Features Implents 95% of Osbot api Live updates Funtions Local, globle and private variables Can do any thing lazy-scheme can do. Todo list test about 700 more methods Gui that looks like scratch implement ansi common lisp Floats every thing is in longs and ints atm filter, fold, letrec, and bang Loops Classes and Objects Dictionaries Switchs Arrays Flat recursion
-
Examples public void generateBotMouseEvent(int id, // MouseEvent.MOUSE_PRESSED or MouseEvent.MOUSE_RELEASED I think there maped to 1 and 0 long time, // The system time of when you want this click to happen. int modifiers, // Set this to 0. int x, //the x on a cartisian plane (0,0) is top left int y, // the y on a cartisian plane int clickCount, // 1 is click once 2 is double ... boolean popupTrigger, //just make this false int button, //MouseEvent.BUTTON1 , MouseEvent.BUTTON2 right/left boolean botInput) //make this true This a tip for all new to coding and want to see exaples of obscure code with bad docs.(I have said it like 30 times) goto github.com login type the string of the package you are using your case "org.osbot.rs07.input.mouse.MouseDestination;" put osbot after click Code its under Repositories (https://github.com/search?q=org.osbot.rs07.input.mouse.MouseDestination&type=Code) Look at the code and try to make it work. If you cant find anything try searching other keywords or using something else or rethink logic
-
Hello Flewis, The code works pat yourself on the back. Its a good start. The logic is most important part of a bot and ever sagement is broken in to a logic spot. BUT using a switch statement like this is like using goto and we can do better. If think like a state machine were all action is true false pair. Programing becomes fast and rapid becuase you can use "and then" and "what if" thinking. Will spin flax in Lumbridge castle. Yes Banks on the top floor. Yes Can be stopped and started anytime and will figure out where you left off. It does but there like goto. Will stop when the user has no more flax in the bank. Yes. Has mechanisms to deal with lag for example if widgets don't open ETC. Check for nulls is great becuase they will crash the client but for lag look into ConditionalSleep. Tested on all server locations. No idea what this means. Two tips limit accounts per loop and use conditionals logic not switches. (switches have a place like during quest ). This is how I would do it . I just a rearaging of your code to limit actions per loop and tried to explain the thinking behind it. step 1: break the bot in to 2 logical opposites like has bow stirngs or does not have bow strings. (you can use this pattern for 95% of banking skills) step 2: Think to yourself If i dont have not flax were am i and how do i get ride of this not flax? step 3: fill in the code to get you to the bank, bank your items and with draw the flax. Once this is done the logic for getting flax is done. Step 4: The else logic we have flax, we could be at the bank, or going to the sping wheel or making bowstrings. step 5 fill in and done.
-
Well the main goal is run-time scripts. Then after I get it debugged this nightmare. Ill slap a gui on and make it look like scatch just for the memes. I do have some methods 100% working and this code below makes uncharged orbs.
-
I hope you can understand this below... Ive been told I suck at explain things. so follow up questions if needed. At the moment im just doing every method 1 at a time and they mostly work on the frist try just need ideas to speed it up. How the program works. So I casted everthing to Object so it can be passed every were and casted back to that object. This is not the best way but it was fastest way implenet the whole api. So there are 2 ways to test the code call the lamba with java or in scheme. The lambdas on the java side are stored in a hashmap <int, 3-arg-lamba> with 1 maped to acceptTrade, 2 maped to ActionFilter, and 3 maped to add... . Calling the hashmaps in java. OSBOT.get(idNumber).run(args, interp, this.name) idNumber every method has a number and there are about 1000 of them. args is a linked list [something ]-> [something] -> ...-> [null] interp is my programing language no osbot methods need it. this.name is the name of the method like EDGEVILLE,equip,open , isopen, caaar, cddddr Calling the method in scheme and how it will run it in java. (equip (getEquipment) (HEADSLOT) "Rune full helm" ) what it turns into on the java side. OSBOT.get( equip id Number).run( [(getEquipment) ] -> [(HEADSLOT) ] ->["Rune full helm" ] ->[null], interp, "equip"); x is the linked list first(x) = [(getEquipment) ] rest(x)= [(HEADSLOT) ] ->["Rune full helm" ] ->[null] [this is a cdr ] x =rest(x) now first(x) =[(HEADSLOT) ] and second(x) = first(rest(x))=["Rune full helm" ] return scemeBot.getEquipment().equip((EquipmentSlot) (HEADSLOT), new String((char[]) ("Rune full helm" ))); examples of scheme code and how it works >(EDGEVILLE)\n returns Banks.EDGEVILLE not matter what is given to it. >EDGEVILLE\n returns {EDGEVILLE} this says its a method and should go in () The line below is example of inside out aways does the inner most right () set and is also infix... (op0 (op1 arg ... ) (op2 arg1 arg2 ) (op3 arg1)) op3 then op2 then op1 then op0 (EDGEVILLE (+ 5 2 (* 5 6) )) turns to (EDGEVILLE (+ 5 2 30 )) turns to (EDGEVILLE (37 )) and is the same thing as (EDGEVILLE) beucase it takes no arges same thing is posible with equip and open bank but in this case they would do something (EDGEVILLE (open (getBank)) (equip (getEquipment) (HEADSLOT) "Rune full helm" ) ) this will put on the rune full helm open the bank then finally Banks.EDGEVILLE Testcases The lines below will fail cases. (equip (getEquipment)) returns FALSE (equip (getEquipment) (HEADSLOT) ) returns FALSE (equip "Rune full helm" (HEADSLOT) ) returns FALSE (equip (HEADSLOT) ) returns FALSE The line below will do the same thing [returns true if the bot puts a rune full helm on] the (getEquipment) is not needed. (equip (getEquipment) (HEADSLOT) "Rune full helm" ) == (equip (getEquipment) (HEADSLOT) 1163 ) ==(equip (HEADSLOT) "Rune full helm" ) == (equip (HEADSLOT) 1163 ) (equip (getEquipment) 9 "equip" ) == (equip 9 "equip" ) *no idea what that means but what ever (Equips an item in the specified inventory slot with the specified action.)* So I think there are 4 Types. static return / do the same thing no mater the args. examples getKeyboard(), getMap().isMinimapLocked(), getBot().isMirrorMode() 1 class many methods with diffent args types examples equip, most RS2Widget methods ... its a long list muiltple classes all with same method that need casting examples use , get, getHeight muiltple classes all with same static/ do the one thing no mater the args examples isopen, close, getInterfaceChildId Type 1. DEF("EDGEVILLE", c, 0, (x, y, z) -> { return Banks.EDGEVILLE; }); Type 2 can take a class but off of context it not needed. Because there are no other methods called that in any other class. Type 3 need to cast to get make object usable with method type Type 4 alot of method with the same name but no need to cast. Thanks.
-
I just finshed writing 15000 lines of code that implements every method and class once in the osbot api. I want to make something like "OSRS Script Factory" after Im doing writing my implementation of scheme in java. Only problems is I have 15000 lines of untested code. Any and all ideas on how to legitment test every method and class in the api are welcome. And how much memory is too much memory for one bot? I know it caps out at 4 gp but what is max you would goto.
-
If batch files are not your thing or your on linux like me. You could make the pogram in java Runtime.getRuntime().exec("java -jar ~/Bot/OSBot.jar "+account.info); just need to make a class that holds account info and a loop that loops though all the accounts.