Jump to content

PlumpRump

Members
  • Posts

    16
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

PlumpRump's Achievements

Newbie

Newbie (1/10)

1

Reputation

  1. public static void killByEmail(String email) { ProcessBuilder findPIDs = new ProcessBuilder("/bin/sh", "-c", "ps -ef | grep '" + email + "' | awk '{print $2}'"); try { Process findPIDsProcess = findPIDs.start(); BufferedReader in = new BufferedReader(new InputStreamReader(findPIDsProcess.getInputStream())); String line; while ((line = in.readLine()) != null) { System.out.println("Attempting to kill process " + line); ProcessBuilder killPID = new ProcessBuilder("kill", "-9", line); killPID.start(); } } catch (Exception e) { e.printStackTrace(); } } I came up with this solution, but I haven't tested it in the farm yet, just manually tested. It searches all the system's processes, finds the ones that were started with the given email, and extracts the PID for each. Then it iterates through all the processes it found and kills them. I have a way of telling if the bots are dead or not, so it's trivial to call this method whenever my system detects a bot died or failed to start.
  2. I've been experimenting with running a farm on a local computer I own and on a VPS. I've run into the issue of OSBot clients sometimes either freezing or malfunctioning due to proxy unreliability. These clients will stay open, hogging up memory and causing functioning clients to run out of memory. I currently need to manually find the broken clients and close them. For a small farm this may be somewhat feasible, but will definitely not work if I want to scale up. Does anyone know a good way to automatically close the malfunctioning OSBot clients?
  3. I think you're right, the issue is the API. I've tried randomly at different times of day and it seems to work about 25% of the time. I wonder if someone is calling it from bots.
  4. I think the "dax path" part of the map is broken. It allows me to place one point, but it won't generate a path if I click anywhere else. This was a really useful feature
  5. Interesting idea, I didn't think of that. Maybe something like: If bot is not in bank or harvest area, find closest point on path to bot location. If this location is visible, start path from that location, else webwalk. I'd still like to see answers to my other questions, but thanks for that tip.
  6. There are some cases where webwalk is unavoidable though. For example, if my script is stopped while my bot is between the harvesting location and the bank. When the script starts again, I will have to use webwalk. I want to know whether even this one call will hog up tons of memory and never let it go, rendering the switch to manual paths useless. If not, or if there's some way I can free the memory, then maybe a switch to manual paths will be worth the effort.
  7. I want to get some advice from more experienced scripters about how to reduce the RAM usage in my scripts. I am running them on a linux machine with 16gig. Usually they start at around 500mb and grow to 1200mb or higher over several hours. This is a serious problem, as I may start a certain number of scripts and then when I come back several hours later, many of them are no longer running due to memory running out. I'd like to at least stem the memory growth, and possibly reduce the overall memory use if that's possible. So far I've seen several suggestions on here, namely using cli flags like lowresource, turning off sound, and eliminating webwalk. I've done the first two, so I suspect my memory problems come down to webwalk. As far as I can tell, webwalk isn't releasing any memory, because the memory use doesn't reduce when webwalk ends. Is there any way to clear out the webwalk memory when it isn't in use? Would it be possible to replace the object(s) responsible for webwalking so that the garbage collector can free up that memory? I don't care if this increases CPU use, as memory is the current bottleneck If clearing the webwalk memory isn't possible, my only option then might be to replace webwalk with walkpath wherever possible. My concern with this is that I still need to use webwalk in certain instances, such as when the bot starts at an unknown location. I'm worried even a single call will hog up a ton of memory that it will never let go. Will simply calling webwalk once in the entire script render implementing walkpath pointless? Is it worth my time to remove most calls to webwalk without necessarily removing all of them? If nothing else works, I'm considering just having my scripts end themselves after like an hour, and then restart as a way to clear memory. Is it possible to do this within the OSBot api, or do I need to have an external program restart them? Let me know if you have any other advice on reducing memory usage/growth
  8. Everyone else in this thread is wrong. This is exactly what I was looking for. Thanks!
  9. Is there any built in way to get the login name (email) of the current bot from inside a script? I did a cursory search of the forums and API and couldn't find anything. I wrote a custom logger that writes to a new file every time a script is run. I'd like to be able to include the account email of the bot in the name of each log file so I know which account each log file is from. Also in the future, I may use the email to communicate status information about a bot to a server, and a bot's email seems like a good primary key.
  10. I just tried my exact same HopTest script I wrote earlier and it works this time. This morning when I experienced the problem, I restarted the client numerous times and even ran it on two different operating systems. I wonder if it's due to some weird widget ID shenanigans in the OSRS client. I can't think of anything else that's changed
  11. I created a bare bones script to isolate this issue package script; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import util.Sleep; import java.util.Arrays; @ScriptManifest(author = "PlumpRump", name = "HopTest", info = "", version = 0.1, logo = "") public class HopTest extends Script { private static final Integer[] F2P_WORLDS = new Integer[]{301, 308, 316, 326, 335, 379, 380, 382, 383, 384, 393, 394, 397, 398, 399, 417, 418, 425, 426, 430, 431, 433, 434, 435, 436, 437, 438, 439, 440, 451, 452, 453, 454, 455, 456, 457, 458, 459, 469, 470, 471, 472, 473, 474, 475, 476, 477, 497, 498, 499, 500, 501, 502, 503, 504}; @Override public int onLoop() throws InterruptedException { int worldToHop = nextF2pWorld(); log("HopWorld: Attempting to hop to world " + worldToHop); getWorlds().hop(worldToHop); new Sleep(() -> getWorlds().getCurrentWorld() == worldToHop && myPlayer().isVisible(), 5000).sleep(); if (getWorlds().getCurrentWorld() == worldToHop) { log("HopTest: Successfully hopped to world " + worldToHop); } else { log("HopTest ERROR: Unable to hop to world " + worldToHop); } return 1000; } private int nextF2pWorld() { int currentWorldIndex = Arrays.binarySearch(F2P_WORLDS, getWorlds().getCurrentWorld()); int nextIndex = (currentWorldIndex + 1) % F2P_WORLDS.length; return F2P_WORLDS[nextIndex]; } } This produces output Please, can anyone help? This is really a show stopper for me...
  12. I was testing a new script and I found world hopping isn't working anymore. The bot opens the world hopping interface where the list of worlds is and then just does nothing. I just tested this on an older script that I know worked and there was the same issue. I don't know when this problem started because I haven't tested a script with world hop in a couple days. I think this is a client bug, but I can't be sure. Has anyone else had this issue?
  13. Update: I've tried to run this cli command on ubuntu in a vm and it worked. I tried on two different mac computers running different versions of osx and it failed in the same way on both. It therefore seems like this is a bug, possibly os related.
  14. I am attempting to run scripts from the CLI in a unix environment. My bot accounts are F2P, so I need to switch the world to a F2P world in order for them to login. I have attempted to use the -world flag to accomplish this, but it doesn't work. The osbot client starts, and then instead of trying to change the world it just immediately goes to log in, fails because it's always a member's world, and then gives up. The CLI code I'm running is below. java -jar [my osbot jar] -login [my osbot username]:[my osbot pass] -bot [bot email]:[bot pass]:0000 -script [my script]:null -world 301 As you can see, I include the "-world 301" flag at the end. I have managed to pause the script before it tries to log in and changed the world to a F2P one and then it logs in successfully. Edit: I should also mention I'm using osbot 2.5.42.jar
×
×
  • Create New...