Jump to content

slazter

Members
  • Posts

    52
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by slazter

  1. If you want good foundations with Java i recommend, University of Helsinkis, Mooc course on java - http://mooc.fi/courses/2013/programming-part-1/ there's 2 parts - with over 100 exercises... spent over 6 weeks for each part.
  2. Might be true, i rarley play genuine, except for like pking, or questing once in a while etc.. yeh exactly. I had less bans running it like a madman than just running it for 4-5hours a day with breaks in between. Did some diffrent testings to what would yield the biggest ROI, due to bond cost, and turned out, that botting for longer periods without breaks, gave me better. However that's mabye not the optimal strategy if i'd never wanted to get banned on the accounts, such as the case with OP and a 2k+ account. These are strictly money makers, and here the ROI is better with botting longer
  3. Don't know why, but i've never gotten a temp ban for 2 days, always permanent, so keep that i mind before you bot. Also about taking breaks and boting at certain places, Not quite sure how much i belive that anymore.. Been botting an alt at a single spot for a week straight, from like 10am, to 10pm, without any breaks, whilst having my other bots running a mini gold farming operation, and while they do get banned, this alt never get touched, also i've had days where i've botted maximum 4-5 hours at these goldfarming bots, and getting banned, now i've been running this bot from 10am to 5a, without breaks, for 3 days straight and no ban, ON an Ip which've had atleast 20 bans+ so far... Not telling your it doesn't help, but in my experience, not boting 4-5 hours and then having 60-90 min breaks seem to actually help me not getting banned, atleast on these lvl 3's..
  4. Hey guys, im back again. So since my last thread in this part of the forums https://osbot.org/forum/topic/126653-trying-to-make-banking-class-errors/ i've taken the advice and started to read up on OO practices and design patterns. So the first pattern in the book Head first - Design patterns which im currently reading talks about the "Strategy Pattern". Simply a pattern to encapsulate what varies, code towards supertypes/interfaces and not towards implementation, aswell as using Composition, rather than Inheritance. So i made a couple of simple Strategy patterns with System.out.Println's. and it all worked well, however now when i try to apply my newfound abilitys to try and make something of it, mabye an AIO-Agility to learn good OO practices i get stuck, I get a nullPointerException - even though im pretty sure it's not like the last time, since this time I extend MethodProvider aswell as pass the bot with exchangeContext(bot). So anyways i'll post the Scripts, and mabye you guys can help me figure out where i went wrong, Since i know i could just use a single class that extends MethodProvider, then use exchangeContext on a reference variable of that class, but that wouldn't really help me benefiting from pattern designs, so anyways heres the codes: Main Agility script, This one is gonna be the main class that all the courses inherits from, atm no other methods, since i can't get first to work, but probably some eat(), pickUpMarksOfGrace() etcetc.. Also atm i don't need to extend MethodProvider, but if i have a eat() method, im gonna need it, therefore i extended it, unless im supposed to compose this entire Script then i guess i don't need to extend it. package Agility; import org.osbot.rs07.script.MethodProvider; /** * Created by Martin on 2017-08-04. */ public abstract class Agility extends MethodProvider{ //HAS-A Interface, so we can use composition IRunToCourse runToCourse; //delegates the runToCourse so char run to Position public void executeRunToCourse(){ runToCourse.runToCourse(); } } Interface, so i can use Composition, rather then coding to an implementation. package Agility; /** * Created by Martin on 2017-08-04. */ public interface IRunToCourse{ public void runToCourse(); } Class that implements IRunToCourse; I,e where the method is for doing this type of runToCourse, might have another for RunToDraynor, RunToAlKharid etc - thinking these could be nice, as i guess i could reuuse some of these classes and interface in other scripts that need the same spots aswell. anyways heres the code: package Agility; import org.osbot.rs07.api.map.Position; import org.osbot.rs07.script.MethodProvider; /** * Created by Martin on 2017-08-04. */ public class RunToGnomeCourse extends MethodProvider implements IRunToCourse { @Override public void runToCourse() { //Teletab to Cammy getWalking().webWalk(new Position(2461,3382,0)); //manage dialogue for doors //Walk to Course } } The GnomeCourse Class, ie the subclass of Agility, to do what's needed for doing GnomeCourse, needs the runCourse() obviously, but not sure if best as composition or inheriterd methods so only one thing in constructor so far. Probably gonna have DraynorCourse, AlKharidCourse, VarrockCourse etcetc... package Agility; /** * Created by Martin on 2017-08-04. */ public class GnomeCourse extends Agility{ public GnomeCourse () { runToCourse = new RunToGnomeCourse(); } } and then obviously the last part of the Design pattern, the script that makes all this run, the one that extends Script, this would be the AIO script, where a GUI could popup and ask which course etc.. package Agility; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; /** * Created by Martin on 2017-08-04. */ @ScriptManifest(author = "Slazter", name = "AgilityTest", version = 1, info = "", logo = "") public class AIOAgility extends Script { Agility gnomeCourse = new GnomeCourse(); public void onStart(){ gnomeCourse.exchangeContext(bot); } public int onLoop(){ gnomeCourse.executeRunToCourse(); return random(200,300); } } I know i could script to work with: RunToGnomeCourse runToGnomeCourse = new RunToGnomeCourse(); runToGnomeCourse.exchangeContext(bot); runToGnomeCourse.runToCourse(); But this would just defeat the entire purpose of Composition. So any clues why nullPointerException with the previous scripts that i Posted? It's just a single method im trying to do. Also any input regarding if this is a good practice or if i should look into another designpattern?
  5. This, already answered, and the reason why aswell with other words, final NPC spot = npcs.closest("Fishing spot"); final NPC banker = npcs.closest("Banker"); can't be placed like that.
  6. Wow didn't expect this much positive response that quickly, thanks alot for the kind words everyone, made me smile irl! I have a few questions for anyone reading, would you rather that i post updates in the main post, or as a new reply? What do you guys think about the format, anything that should be added? From tomorrow i'll probably use my KLOK2, (Scheduling software) to know how much time i spent on various parts of my day for further data, think i'll add that to the posts aswell.
  7. Okay so after a few months lurking around, and the last month being more active, reading up on tutorials, Java in general, posting questions to learn more etc i've decided to start my own thread for my own Progress goal. Some bakground: I'm a 24 year old guy from Sweden, started gaming at like the age of 8 or 9, and since then my computer has always been my number 1 joy in life, it's kinda crazy how much i actually enjoy spending time on my computer lulz, anyways. I used to play alot of Poker, NLHE, made my way onto 2.5/5 stakes, climbed to 5/10 some times aswell on the swedish site SVS, made a decent profit, but eventually got kinda demotivated as poker is dying out as a whole, due to fish (term for bad players) not coming into the game with the same influx that it used to, aswell as not really being able to se myself as pokerplayer 5->10-15 years from now on, by other words, it was a nice way for me to earn money at the computer, while also improving my math skills, logical thinking and self reflection. But the emotional stress it caused, litterary made me punch a hole through my desk. After changed were made to the site, changed their shitty GUI to an even worse GUI that didn't allow HM, (program for data tracking, HUD of stats etc) i decided to call it quits, poker had been great but there was no real future for me. All in all it was a great year, with me spending the summer infront of the computer with my best friend, smoking weed the entire day, chasing fishes until 5am, passing out, waking up at 11am, W&B-> hit the gym-> join the tables -> repeat. So where to go from here: So since i've always loved to actually strive and work towards goals, my natural tendency was to search for something else, something which had a future, something which would have me develop skills that i would benefit from for the rest of my life, so many times have i thought to myself, "Shit i should've started doing that earlier", or "Shit i shouldn't have quit that". There's no redoing in life, What's done is done, therefore and i attribute that alot to poker, i really tend to try to envision everything super longterm, aswell as having a process oriented focus, rather than a results based, (Try having a results based thinking in poker, and you'll go mental within a couple of days lulz). I've tried youtube, i've tried poker, i've tried writing, i've tried webb developing, i've tried so many thing, but what have always been my foundation has been that i want to have a job that let's me work from anywhere in the world, aslong as there's internet connection, No boss supervision(I really despise the thought of me working for someone and me only earning x amount of % of what i produce, rather than me earning the full 100% of my production means) And that it allows me to make BANK irl. Therefore you'll probably see that all these kind of "Jobs" i decided to try out, actually follows this pattern. Anyways so after a semester of maths and physics course in my community college, i started to develop a love for simpifying my homework with equations and formulas by programming my calculator Ti-84 to do all the calculations, and just prompting the values. It was also super helpful due to the fact that it forced me to work with the equations, rather than just mindless numbercrunching and to understand how to reorganize the formulas to get the correct answer. And that's where i started to get into programming. So at the Mid of june (when the courses ended) i decided to try and develop real programming skills, rather than just programming formulas into my calculator. A few years ago while still in high school i took a course in C#, and i distinctly remember hating object orientation, angle brackets, Classes and all there was to it. But this time my mindset was diffrent, First of all i strongly belive there is no such thing as funny, or boring - Cause what is really something objectivly boring? or objectivly funny? There is nothing, right. It's all subjective feelings that we apply, and if somethings subjective that essentially means that WE get to choose how we feel about it and that is a crazily fucking powerful thing, Of course every task is going to have different feelings that is conditioned to it with neurons, but neuroplasticity makes it not being permanent, it's going to take time, but it's never permanent, and that's the key! Shit i've changed feelings about tasks so many times it's dumb, i've even come to love the constant rain in the swedish summer for it allows me to spend the time inside at my computer to learn more about programming. The second thing is that i felt that there were some actual areas where i could apply my programming (Rs07) while still learning and that really helped me to push through the mental barriers which i previously had while trying to learn Java(i've tried to learn it sooo many times, for a couple of days, and then just end up leaving it due to the high learning curve i felt it had, and the time it would take for me to actually learn it) So this time i've actually pushed through for what i belive to be was the(for now) hardest part, as i've got most of the fundamentals down, which was what i struggled with the most while trying to learn Java. At the time of writing this i've written about, 10-15 scripts that for the most part gets the job done, (1-2 that i feel are decent enough to actually publish for others to use someday, still using these as my personal money makers, and can pretty much run these without problems). I've read, 277 pages in Head first Java, and pretty much all of the tutorials in tutorial section, i've read countless script help post to se common problems, solutions, aswell as reading many of the posts in the Snippets section to try and se how others write their script, and solutions to problems that i face. So my current short term goals atm are: *Learn more about OOP - strictly speaking - Inheritance, and implementation of it to being able to make use of Object orientation more smoothly. Scheduled to spend Today -> 5th or 6th of August on it. *Learn more about State Logic - Sometimes i feel i have troubles formulating the correct , if and else statements to make for good code, and i think this is what @Alek meant when he told me it'd be a good steping stone. *Learn more about GUI - Haven't spend more than 5 minutes trying to learn it, so all my scripts are without a GUI, and while the scripts work, it'd be nice to have a GUI for some scripts, to mabye get xp/h etc without having to do manual calculations each time. * Figure out some more ways to bot gold - currently have a few, one with like 800k gp/h without much reqs, but require a shitton of gold, aswell as being pretty caped, but with pretty much 0 banrate, aswell as one with 350kgp/h without any reqs but semi high banrate... I can bot for like 5-6/h a day without bans, but any more than that and the bots gets taken out, which kinda sucks, aswell as not really super scaleable. My mid term goals are: * Learn all the foundations in Java, threads, exceptions, GUI's, Lambdas, Collections, Streams, anonymous classes etc etc. * Have a botfarm of atleast 5bots running 24/7 with atleast 500kgold/h. And yeh here i'll probably have 15 bots, that each run 8h/day, and rotate between them. * Make an AIO questing script, Release version of all F2P quests to Osbot for free - Mostly to learn good OO practices * Make a progressive Slayer Script for leveling accounts and semi decent money maker. My long term goals are: *Become alot more proefficent at Java *Build a new computer, or possibly even server, strictly for botting use. * Make a personal raid script - I remember the old dungeonering script, so should be doable with enough experience *Start selling gold So yeh i guess this was my introduction post, these goals are going to be edited, and added whenever i figure something new out that i'd want to learn, but atm im pretty tired, so these will have to do for now. So for now im going to be working on my OOP Skills, I'll post the links of the stuff that i use and probably a summary of what i've learnt from it, so in the case i have understood something wrong you guys can correct me. Also, I love feedback, it's pure gold to me, so whenever you se something which is wrong, or information that can be added to what i've written, ALWAYS feel free to correct me or add infomation that i've might've missed or not learnt correctly. PS. i munch Notropics like a motherfucker!! Jokes aside i've tried Piracetam, Noopept, Idra-21, Phenylpiracteam, Oxiracetam, Aniracetam, PRL-8-53, NSI-189, Adrafinil and much more, so if you're interested in that kind of stuff, feel free to ask about it, or post your experiences, as i find this stuff really fascinating, but Longecity can be a bit boring. Day 1 Progress: Day 2-3 Progress:
  8. Wow this is pure gold!! Now i start to understand the OOP your talking about, aswell as why u don't use task based scripts, you just make sure your OOP is super clean instead! Laying in bed on mobile but gonna spend entire day tomorrow going through it more thoroughly nice to se the exchangeContext used in a proper script, guess i should be placing my initializing of it in the onStart aswell. I do have a few questions though from spending 20ish mins reading this code, 1) How much programming experience did you have previously to coding this? 2) You said that you'd want to clean some things up if you had the time, so if you were to rewrite this script today what would be your bigest changes and why? Anyways thx for release, it really is super nice to have this kind of code available to learn from!
  9. Yeh same, i tried to start up bots with CLI, but as it starts multiple clients, i found it actually uses less CPU if i run all bots in the same client.
  10. Yeh i had some troubles with that aswell, got a I7-4790k, 4.0Ghz, and 16Gb ram, yet still what i noticed bottlenecked me was the CPU while runing 5 bots, i ran at 100% CPU. In the Osbot client u have 2 options, Low cpu mode, aswell as disable client rendering, i don't run low CPU mode as that would fuck up the method that im bothing atm, but Disable client rendering makes my cpu run at 30-40% with 4 bots, that otherwise might run 70-80% without it.
  11. @Explv, Bro your a lifesaver, once again you come to the rescue to save my ass with your vodoo So trying to connect this code that you wrote, with what Alek said, to see if i understand correctly, We're extending the Methodprovider, as to go up in the inheritance tree, so that the Script can inherit it, otherwise, if we we were to extend Script, it'd be on the same "level" in the inheritance tree as the current Script, therefore not being able to acess it. Therefore we have to go up to MethodProvider, but we could go even higher aswell, is that a fair assumption? WOW i just think i figured it out.. xD Thanks alot, in swedish we say "Poletten trillade ner" xD I think you just made me understand that i kinda missunderstod Aleks post. To itterate my current understanding of what Alek said and from what you've posted. The correct way to make our methods available to other classes is to pass the bot. We accomplish that by first extend our class to Methodprovider, Then we use exchangeContext on the referece variable, to pass the actual bot as a argument, with exchangeContext(getbot) My first understanding was that we, Pass the bot - didn't get a clue about how to send an entire class to another class x) Extend Methodprovider - easy Then use exchangeContext(getbot) - didn't understand on what. So it's not 3 steps, it's actually 2 steps. Would this be a correct understanding? Also, yeh I'll put that on my list of things to read up on! That currently contain: Anonyma Inner Classes Streams Collections Lists GUI Lambdas State logic Object Orientering, med inheritance Arrays - Speciellt multipla, med Loopar Threads xDD Any specific tutorial, book or video you had in mind that you feelt we're worth recommending or just read up on it in general?
  12. Anyone know how i can download my local scripts to Debian? whenever i use wget - on the website i upload to, it just downloads the entire webpage as a html file. And why is there no like web browser i can use to download my shit with? Tried wget - all diffrent chrome options, google-chrome-stable etc, but it won't work So anyone know how to get local scripts working on this debian?
  13. Hmm so if my understanding is correct, what we're trying to do with that snippet is: 1)Making a Object from the Banking class in my main main script that extends Script. 2)Have the banking methods be sent to the MethodProvider, via a constructor and because Scripts extend MethodProvider(therefore pseudo adding them i guess you could call it?) we should now have acess to those methods in the main script that extends Script? Is this understanding somewhat correct? I tried the snippet, but didn't work, didn't work if i put this. pre or after, aswell as both removing, or adding more "()". aswell as having the banking class itself extend either Script or Methodprovider. Think im gonna have to look into what you've said about static variables/functions work vs member variables and functions. I feel my understanding of that is really lackluster, haven't gotten to that part in my Java book yet. Also yeh, i'll probably look into Task based programming later on, i'm kinda intrigued by it, as i saw it requires abstract classes, which i think would be a good practice to learn more about making abstract classes, which hopefully leads help me to understand on how to write interfaces, then functional interfaces, and then some sick lambdas Hmm so exchanging content and not passing the script instance.. is what i'd be doing in the previous part, where i send my object to Methodprovider a passing of the script instance? Hmm okay so let me se if i understand correctly, i'm supposted to pass bot to a new class, and have that class extend MethodProvider. Would that be something like this? Banking banking = new Banking(bot); and in my Banking class, have it extend Methodprovider. Cause i tried this, and it won't work, so i think im passing wrong, so i googled on how to pass variables to classes. https://stackoverflow.com/questions/18194661/java-pass-variable-from-class-to-class and i could use Getters and Setters, so i made methods for getters and setters in bot classes, still didn't work, think im gonna have to read up on, passing objects to other classes, and not just instance variables.. Regarding "this", yeh okay noted And regarding Node and Task based, im super intrigued by the making of them, it seems to make alot of sense, and then i guess i could have my banking methods as a Node, and make the onLoop, super fkn clean But yeh i'll keep that in mind from now on, even in the scripts i write atm, so as not to have the same condition checked twice, i guess that logic applies for things like: if(!myPlayer.isMoving()) aswell even if i don't search for the object, i guess it still takes some processing to go through it if it's a part of both my getState, and the method for what's supposed to happen in that state. And yeh your probably right, i did try to get some fundamental understanding of a state machine from the States vs tasks discussion, Where Tom said, "What if I told you they are the same thing, just one is more of an object oriented approach and reflects better practice. End result = State Machine" I guess the first thing i'll start on doing right now is understanding State logic better, Thanks for the Help!
  14. @Tom taught me trick to use !exists() to complement ==null, so all credits to him for teaching me this trick. So in my super simple powerminer i wrote something like this, if (skills.getStatic(Skill.MINING)>=15 && iron != null && !inventory.isFull()) { if (!myPlayer().isAnimating()) { if (iron.interact("Mine")) { Sleep.sleepUntil(() -> iron == null || !iron.exists(), 5000); } } } And that solved the problem for me with the bot not recognizing if the rock was depleted. edit, Also you should be looking to use the Sleep class that @Explv made available in his tutorial post, it's really dope!, And make conditional sleeps much easier to write. You can find it in,
  15. Hmm okay i understand then, constructors are for initializing values, and not to run code itself, got it . Would it make any sense to have the same banking class, but instead of having it made as constructors, have them made as methods? I mean shouldn't there be some sense in having a banking class as to not having to type the same methods all over everytime i want to do some generic banking in my scripts? Also, "you are not passing the Script object from your main class" would you care to explain further?, wouldn't me extending the script, or mabye methodProvider mean that i can inherit the banking methods in another class that also extends Script, and therefore are able to use them? Ohh nice an answer from @Apaec, i've read your guide countless of times!! Really sparked my drive to learn Java! Okay so function of classes contained inside the body, and initializing variable and setting for constructors, got it! " I would suggest that you try a project where the concept of object orientation fits well with the script, for example an AIO or multi-mode script of some sort. ". Yeh spot on, that's the end plan but i figured since i use the technique you provided, getState, and then switch between states, it'd make for even more easy to read and manageable code if i we're to have like a banking class, a walking to Position class, Eating in certain generic conditions and such. Now i often have duplicate methods in many of my scripts, (like banking, which could be made more generic and then @overriden right?) which feels kinda dumb. Isn't there some sort of way i can "add" methods, to like the methodprovider, that all classes can use, without having to use interfaces, which would kinda defeat my purpose of rewritting the same code all over? also, when you say Multi-mode or AIO could u give me some example? Not the code but perhaps some of the structure? Cause that's exactly what i want to do, but don't think i understand how to extend correctly? Cause my understanding of this is something like this, Say i want to do a progressive Slayer script, Then mabye i'd want to have acess to banking methods, so i need a banking class(bank loot, restock etc) ,i want walking methods so i need a walking class(to masters,monsters), fighting methods so, Fighting class(fighting monsters) etc, Then say bank class extends script, walking extends banking, fighting extends walking, and then the Slayer script extends walking, to inherit all those methods? Otherwise i'd run into the deadly diamond of death. But this feels wrong because they don't pass the IS-A test, fighting isn't a walking... and neither is walking a banking. And i know im supposted to be able to do something like this, cause in this post, he ussd task based script, which i felt kinda were almost the same thing as using enums for States, and then switch between states, Please correct me if im wrong. So i know i somehow should be able to have my scripts being able to inherit methods without having to retype it. What would be a correct way to go about thinking about this kind of thing? Sorry if i've made myself unclear somewhere , I'm still reading the Heads on Java book, and reading guides.
  16. Okay so i've been trying to learn more about overloading constructors, the "this" keyword, and to actually initialize values in constructors. I figured since many of my scripts contain some banking elements, why not try to make a Banking class, where i initialize what i want to withdraw, and amount in the constructor, to practice and make it stick better. However i ran into some major troubles, I keep getting nullPointerException whenever i try to create an object and initialize the values in my script, and it won't even work even in the banking class itself. Im pretty clueless on what to do, so any help would be greatly appreciated. I'll post the code, and yes atm it's far from great, but i can't really improve it unless i even get it to run, so i'll just post here and any help or fingers pointing me in the right direction would be greatly appreciated. also, the object was supposed to be place inside a method, to only have the object available when i want and not during entire script duration when i don't need it, but for testing purposes i thought i could stick it in the onLoop(). import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; /** * Created by Martin on 2017-07-26. */ @ScriptManifest(author = "slazter",logo = "",version = 0.1,name = "Banking-Test",info = "BankingClass") public class Banking extends Script{ boolean depositPre; //no arg constructor supposed to deposit all public Banking() throws InterruptedException { if(!getBank().isOpen()){ getBank().open(); } else if(getBank().isOpen()){ getBank().depositAll(); } } //Suppoted to withdraw the string, and amount public Banking(String withdraw,int amount) throws InterruptedException { if(!getBank().isOpen()){ getBank().open(); } else if(getBank().isOpen() && !depositPre && !inventory.contains(withdraw) && getBank().contains(withdraw)){ getBank().withdraw(withdraw,amount); } else{ getBank().close(); } } //Supposed to deposit all, then withdraw the string, and amount public Banking(String withdraw,int amount,boolean depositPre) throws InterruptedException { if(!getBank().isOpen()){ getBank().open(); } else if(getBank().isOpen() && depositPre && !inventory.contains(withdraw) && getBank().contains(withdraw) ){ if(getBank().depositAll()){ if(inventory.isEmpty()){ getBank().withdraw(withdraw,amount); } } } else{ getBank().close(); } } //Supposed to withdraw the items in stringarray, and amount public Banking(String[] withdraws, int amount) throws InterruptedException { if(!getBank().isOpen()){ getBank().open(); } else if(getBank().isOpen() && !depositPre && !inventory.contains(withdraws) && getBank().contains(withdraws)){ if(!getInventory().contains(withdraws)){ for(String d : withdraws){ getBank().withdraw(d,amount); } } } else{ getBank().close(); } } //Supposed to deposit all, then withdraw the items in stringarray, and amount public Banking(String[] withdraws, int amount, boolean depositPre) throws InterruptedException { if(!getBank().isOpen()){ getBank().open(); } else if(getBank().isOpen() && depositPre && !inventory.contains(withdraws)&& getBank().contains(withdraws)){ if(getBank().depositAll()){ if(getInventory().isEmpty()){ if(!getInventory().contains(withdraws)){ for(String d : withdraws){ getBank().withdraw(d,amount); } } } } } else{ getBank().close(); } } @Override public int onLoop() throws InterruptedException { return random(200,300); } } and to try to initialize my values in the constructor i thought i could pass the values like this, import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(author = "Slazter", name = "TestClass", info = "TestClass", version = 0.1, logo = "") public final class TestClass extends Script { @Override public final int onLoop() throws InterruptedException { Banking banking = new Banking("Amethyst arrow",5); return random(150, 250); } }
  17. Holy shit bro, your like a wizard, keep poping up with all sorts of magic! Thank you very much for this!
  18. Okay so a few days ago, i tried to make a timer based on my player moving or animating, it worked fine, also, thx for the snippet @dreameo, So today i was thinking that it would be fun to try to add some kind of inventory check to see if inventory has changed, in that case i don't want the Idle timer to go of aswell.. I read the forums and someone said to cache the inventory (I don't know what that is, i read up on it and it said, to save some kind of temporary data in the memory to more easily acess it?) I don't know how to do that though, so any input regarding that would be very helpful, but apart from that i tried to implement some kind of check, before looting and then after, then comparing them to eachother, which i would assume would work but didn't. So i'll post my code down below, and would be super glad for any help regarding how to solve this problem. public final int onLoop() throws InterruptedException { GroundItem toLoot = getGroundItems().closest(i->i.getName().contains(x) && getMap().canReach(i) && i.isVisible()); if(toLoot!=null){ int slotCount = getInventory().getEmptySlotCount(); log("Slotcount 1: " +slotCount); if(toLoot.interact("Take")){ Sleep.sleepUntil(()-> toLoot==null || !toLoot.exists(),5000); int slotCount2=getInventory().getEmptySlotCount(); log("Slotcount 2: "+ slotCount2); } } if(idleFor(20000)){ log("Idle for to long"); getWalking().walk(Banks.EDGEVILLE); } return random(150, 250); } private boolean idleFor(long millis){ if(myPlayer().isAnimating() || myPlayer().isMoving() || slotCount!=slotCount2) { timeSinceAction = System.currentTimeMillis(); log("Not counting"); } else if(!myPlayer().isMoving()) { timeSinceIdle = System.currentTimeMillis(); log("Counting"); } //return true, return timeSinceAction + millis < timeSinceIdle; }
  19. Guys this happends pretty much everytime there's a major update........, if i'm not mistaken, it's something about hooks or smth needing to be fixed, it'll be fixed in a few hours exactly as usual...
  20. Hmm this was actually very neat, im gonna go ahead and save this snippet, thanks!
  21. Managed to solve it with something kind of what @Explv suggested, if(myPlayer().isMoving() || myPlayer().isAnimating()){ time = System.currentTimeMillis(); } else if(!myPlayer().isAnimating() && !myPlayer().isMoving()){ timeToMove=System.currentTimeMillis(); if(timeToMove>time+5000){ //Code } } } Mabye not the most elegant solution, but i gets the job done while i think of a better Solution
  22. Is there any way to check how long the bot has been in Idle for? Say that i want my bot to do certain things, but in case it idles for say 7sec+ for etc, i want it to move position?
  23. You do realize that the most of us that use other methods that you consider worse, do it because we're unaware that this is superior or exist at all right?
  24. Okay so i live in Sweden, and i called my ISP to ask if they give me a static or dynamic IP, they said they give Dynamic. I typed into cmd, ipconfig /all and it said DHCP enabled. So since i've gotten banned twice now i thought of resetting my IP, therefore i went to http://whatismyipaddress.com/ to make sure it was gonna change. Then i went back to CMD and typed ipconfig /release followed by ipconfig /renew - as it was supposed to renew my IP, however it still shows up as the same IP, I also tried rebooting my router for like 5 mins, but still same IP. Is this supposed to happen or am i supposted to do something else?
×
×
  • Create New...