Jump to content

sudoinit6

Lifetime Sponsor
  • Posts

    353
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by sudoinit6

  1. Hey all. I am trying to put together a farming script and I was hoping to use configs to get the state of the allotments and patches, but I am a little lost. I found this (which was posted somewhere very recently so I am confident it is up to date): Which provides me with answers but also questions. It appears that the config for all patches and allotments is 529. I went to the Falador farming patch and when I get the current config for 529 it gives a number based on what has most recently changed on any of the patches/allotments. If I rake the herb patch I get 352322049, If I rake the north allotment I get 352379451. I can't seem to figure out how to query a specific patch, how do I get the state of 529(<<24) for example?
  2. Thanks for all the good advice. I am not very sophisticated as a coder so the Booleans will suit my needs for now. Baby steps. I do appreciate the replies though, this community is great.
  3. That's exactly what I was looking for. You are awesome as always. I have often said that this farming thing would be a lot easier if I knew Java!
  4. I know in Java there is no such thing as a global variable but I am looking for something similar. I am writing a script that does several things in 4 areas. I need a way to update a variable to say "section one is done, move on to section two" and then in my other classes be able to check the state of this variable. Can someone point me in a direction?
  5. I would really love to know how you did all that in 2 hours. I am not saying you didn't, I would really like to know.
  6. Shouldn't you list 30 magic and 30 attack as a requirement too due to the Dust Battlestaff?
  7. Worst case, tape the switch. This isn't a downside to botting, this is what we call at work an ID 10 T error, or a PEBKAC.
  8. So as the title says, I run linux VMs that each have 1cpu and 1.5GB RAM. After running for a bit the bot starts acting strangely. I am using a task based script and it will match the right conditions but won't execute the action properly. For example: It fails to open the exchange bank multiple times and the one time it does it returns that there are 0 coins when in fact there are several hundred thousand. And it isn't just opening the bank or counting coins, when it gets in this state it will spin it's wheels on every single action it tries to perform. I went so far as to use conditional sleeps for actions like open bank ----> cond sleep till bank is open ---> do stuff But it ignores everything and just matches the condition again and knows it is supposed to open the bank. If I kill the java process and relaunch it works fine, for awhile. Any insight? Sound drivers are installed on the system and sound is off on all the bots, so I don't think this is related to the memory leak issue that can happen on linux systems. Edit: No errors are being thrown. Edit 2: There is plenty of free CPU and RAM on the system, so it isn't a lack of system resources.
  9. It means god hates you because you touch yourself.
  10. With lemon's help I found a way to make it work without a custom login handler, at least well enough to suit my needs here is what I did: What this does is write one file if the error type is disable error but a different file if it is a connection error (although I don't really need to write the second file). Before it was executing my code on any error because I was passing thorough something that would always match. With this code it checks to see what kind of code it is, if it isn't a disabled code, it doesn't execute my instructions in the first section (which include an exit) and moves to the second. Since the second doesn't include an exit, the default login handler handles it like a normal connection error and waits 17 seconds to try again. Hopefully someone else can find use out of this. Thanks Alek and lemons!
  11. Since I run my bots on linux VMs with no GUI (command line only) I am going to say "no".
  12. That makes perfect sense. Thanks again for your help.
  13. I thank you for your response and your effort to educate me. You are probably correct, I don't understand how ResponseCode.isDisabledError(int) works. But let's see if I can learn! Here is the entirety of the code I have been using: @Override public void onResponseCode(int responseCode) throws InterruptedException { if (ResponseCode.isDisabledError(18) || ResponseCode.isDisabledError(4) ) { log("Account locked"); try { log("trying to create text file."); PrintWriter writer = new PrintWriter( "/root/OSBot/Data/lockedAccounts.txt", "UTF-8"); writer.println("locked"); writer.close(); } catch (IOException e) { log("creating text file failed"); // TODO Auto-generated catch block e.printStackTrace(); System.exit(0); } System.exit(0); } In my mind what I THOUGHT would happen would be that this code would be executed only if the login response code matched one of the two in the or statement. But it executes on ANY failure to login if you could explain to me why that is I would be grateful. And if I am understanding correctly, if I remove the above (it is in my onLoop sectin) and put this in my onStart: getBot().addLoginListener(new LoginResponseCodeListener() { @Override public void onResponseCode(int responseCode) throws InterruptedException { if (ResponseCode.isDisabledError(responseCode)) { // Disabled or locked My clunky code that writes file a } else if (ResponseCode.isConnectionError(responseCode)) { // Connection error, if custom login handler sleep or w/e My clunky code that writes file b } } }); Then I don't care what the individual response codes are because if it's disabled I start fresh and if it's anything else I wait 5 min and try to launch the bot again, correct? Once again I really appreciate the help, I have been hanging around here for a year and a half and this community has always been top notch.
  14. I thank you for your help, I don't think you are misunderstanding, I wish I were better at explaining myself but I am learning. Bear with me because I am sure this will be amateur hour for you, I am almost embarrassed to explain how my stuff works but it is the best I can do with my current level of knowledge. Currently I run each bot on it's own Linux VM(I know more about linux and VMware than I do java). My scripts are task based and in the class that extends Script (where all the tasks are listed) I have the code I originally posted. The "do suff" stuff is this: If the response code is disabled: Write a file to /root/OSBot/Data/ I have a cron job that looks in that folder for that specific file every five minutes, if it exists delete the file and start creating a new account and launch osBot all over again. The only problem is it "does stuff" on any failure to connect. So if I get a random fail to connect for some reason I lose hours on that bot. Like I said, noob but it works. Are you saying if I put your code in my class that extends Script I could have it write one file on disabled or locked or write a different file on connection error? If so that would suit my need perfectly because I could have my cron job restart the whole thing on disable/lock or just kill java and launch the bot again on connection error.
  15. I am aware of that, but if you look in my first post on any response code it does stuff, regardless of which code is returned, what I would like to do is have it do different stuff for different codes. It could be that it is possible, I'm just not using it properly. I don't really know what I am doing.
  16. It's in a post on this forum, search for Response Codes. It would be really cool if I could do different stuff depending on the code, but I haven't figured out how to make that work yet.
  17. 4 and 18 are locked or banned respectively. I will try your way and see if it works. Thanks.
  18. I am trying to set up: if (ResponseCode.isDisabledError(18) || ResponseCode.isDisabledError(4)){ do stuff } And it works, but too well. It does stuff on any kind of failure. Is there a way to make it only do stuff with these errors and do other stuff with any other error?
  19. I don't know the answer to your problem, but maybe it is because you are salty?
  20. Thanks, and DERP on my part, for some reason when I read it my mind didn't make the connection that this was exactly what I was looking for! I am too ignorant to use the RS GE API, will have to educate myself but this will work as a temp fix. As always, you are the best!
  21. I don't know how else to describe it other than the "default" price, the price that shows up by default when you offer to buy or sell in the GE. Looking at the API the onlt "GetPrice" I see is for a specific exchange box, not the offer to buy/sell interface. Is there a way to get that default price? My scripts rely on RSbuddy to get pricing information and it's been down almost 24 hours now so I need a new way of figuring out how much to buy or sell for.
  22. It is now working for me. Thanks! I guess that's a matter of perspective. Since I am employed as a unix sysadmin I find it much easier than managing windows.
  23. Nice stuff, thanks for documenting your work. I am thinking of giving it a try. Any tips other than the amazing info in this thread?
  24. Boxing, the manly sport where two almost naked guys fight for a belt and a purse...
×
×
  • Create New...