Jump to content

Lemons

Lifetime Sponsor
  • Posts

    620
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    100%

Posts posted by Lemons

  1. 12 minutes ago, sirskitzo said:

    Someone is coding me a private script and I don't want the pain of downloading the new jar everytime he codes an update for me and then go and replace it with the old version. I just want it to be ready(up to date).

    If your using Dropbox, just make a link to the jar in the Dropbox folder. If it updates the link will point to the new version.

    On windows: https://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/

    On linux/mac: https://www.cyberciti.biz/faq/creating-soft-link-or-symbolic-link/

    • Like 1
  2. You can only write/read from %userprofile%/OSBot/Data for windows, or ~/OSBot/Data for *nix systems. Sounds like your making an auto-updater, make it an external application if you want to save to ~/OSBot/Scripts.

    Also if you want to get the user directory in a Script, use Script.getDirectoryData()

    • Like 2
  3. As for how many you can run, go to https://www.cpubenchmark.net/ and look up your current CPU (or use a google search like "i7 7700k site:cpubenchmark.net"). Then, run the bot your planning on running, and get the % of CPU usage for the bot. Say its 5% of your current cpu and your CPUs benchmark on that site is 5000. 5000*0.05 = 250. So an i7 would roughly run 48 bots as its CPU benchmark is 12000. Also let the bots run a little while before taking a reading, java optimizes code as it runs so you'll want to let that stabilize before you take a reading. This again is a rough estimate of what you can expect. Also only server mobos support dual CPU configurations, so dual i7s are not gonna happen unless you have 2 machines. You'll want to look into server hardware if you want something like that but more hardware isn't bad (most server companies now use multiple cheap servers vs one massive expensive server, which is actually closer to a real life "super computer").

    As for the dedi prices, CPU would need to be included as for me at least that tends to be the limiting factor.

    • Like 1
  4. 5 minutes ago, sudoinit6 said:

    That makes perfect sense. Thanks again for your help.

    No problem, you can always add me on skype or discord (handles in profile) if you want to shoot questions at me. Always willing to help someone who is willing to learn :)

  5. the issue here is this:

    if (ResponseCode.isDisabledError(18) || ResponseCode.isDisabledError(4) ) {

    is basically equivalent to this:

    if ((4 == 4 || 4 == 18) && (18 == 4 || 18 == 18)) {

    Because ResponseCode.isDisabledError is (most likely) just:

    public static boolean isDisabledError(int responseCode) {
    	return responseCode == ResponseCode.DISABLED_ACCOUNT || responseCode == 18;
    }

    So your mistake is thinking ResponseCode.isDisabledError knows the response code. It does not, it only checks the given response code (and your always giving 4 and 18, so its always true on any response code). Simple misunderstanding, those have bit all of us in the ass at some point.

    As for individual response codes, just allows you to fine tune responses to different types of connection issues. If you use them or not, that is up to you.

    • Like 1
  6. 19 minutes ago, sudoinit6 said:

     

    Yes, the "Disabled or locked" statement will triggered on account disable, so you could just touch the file you need in that statement. I think your issue before was misunderstanding how ResponseCode.isDisabledError(int) works.

    LoginResponseCodeListener should work with osbots login handler for this situation. Just make sure you add the listener in the scripts onStart and all should be good. Also, connection errors could be for a multitude of reasons, look at @Chris's post to handle specific values (just compare responseCode to the # of the error for those).

  7. Not sure if I'm misunderstanding or not, but you need to make a response code listener to use them. You seem to just be compared them against a static integer. Sorry if I misunderstood.

    getBot().addLoginListener(new LoginResponseCodeListener() {
    	@Override
    	public void onResponseCode(int responseCode) throws InterruptedException {
    		if (ResponseCode.isDisabledError(responseCode)) {
    			// Disabled or locked
    		} else if (ResponseCode.isConnectionError(responseCode)) {
    			// Connection error, if custom login handler sleep or w/e
    		}
    	}
    });

    Also, response codes can be returned on DC, such as when locked/banned.

    • Like 1
  8. Browser was downloading a cached version of the client it seems, my bad. Newest version works perfect for me, thanks for the fix!

    Just now, nosepicker said:

    Should probably mention that I'm testing on Ubuntu 16.04.3 LTS 

    I'm running 16.04.3 as well and it works perfect. Make sure your browser isn't caching the download as mine was.

    • Like 1
  9. 6 minutes ago, Alek said:

    Confusing but I'm toying around with the account selector and timeout - both of which are unrelated but for some reason are correlated. 

    Edit: Are you starting up with -bot through CLI? That timeout only gets triggered then.

    Yeah this was through CLI, launched with only debug flag and it still doesn't load right away. I'll report back with the logs once the client shows up.

    • Like 1
  10. The exceptions related to Add Account and Options are fixed now on my end. Still takes a while to load tho (I assume this is your timeout):

    Picked up JAVA_TOOL_OPTIONS: -XX:-OmitStackTraceInFastThrow
    Debug enabled on port 5432
    Setting memory at 1000MB
    Starting OSBot in low cpu mode
    Starting local script with name: nope
    [DEBUG][01/25 02:52:29 PM]: Injected 2 field list filters
    [DEBUG][01/25 02:52:29 PM]: Injected 2 field filters
    [DEBUG][01/25 02:52:29 PM]: Injected 2 method list filters
    [DEBUG][01/25 02:52:29 PM]: Injected 3 method filters
    In debug mode!
    Picked up JAVA_TOOL_OPTIONS: -XX:-OmitStackTraceInFastThrow
    Listening for transport dt_socket at address: 5432
    Stealth injection class-filter enabled!
    Successfully loaded OSBot!
    [INFO][01/25 02:56:54 PM]: Loaded 7 RS accounts!
    [INFO][01/25 02:56:56 PM]: Welcome to OSBot 2.4.156!
    [INFO][01/25 02:56:56 PM]: Updated injection hooks for client revision : 161!
    [DEBUG][Bot #1][01/25 02:56:56 PM]: Initializing stealth injection bot...
    [INFO][Bot #1][01/25 02:56:58 PM]: Downloading latest RS2 old-school client parameters...

    But the game loads right away once the client shows now, instead of before where the client showed and took 40 minutes to load the game.

    • Like 1
  11. The dev version doesn't show the client window for me, tho the process continues to run in the background (from CLI and GUI). With 2.4.155, I noticed after I left my client open for 40 minutes the game loaded:

    [DEBUG][01/25 11:49:50 AM]: Injected 2 field list filters
    [DEBUG][01/25 11:49:50 AM]: Injected 2 field filters
    [DEBUG][01/25 11:49:50 AM]: Injected 2 method list filters
    [DEBUG][01/25 11:49:50 AM]: Injected 3 method filters
    In debug mode!
    Picked up JAVA_TOOL_OPTIONS: -XX:-OmitStackTraceInFastThrow
    Listening for transport dt_socket at address: 5432
    Stealth injection class-filter enabled!
    Successfully loaded OSBot!
    [INFO][01/25 12:29:00 PM]: Loaded 7 RS accounts!
    [INFO][01/25 12:29:06 PM]: Welcome to OSBot 2.4.155!
    [INFO][01/25 12:29:07 PM]: Updated injection hooks for client revision : 161!
    [DEBUG][Bot #1][01/25 12:29:07 PM]: Initializing stealth injection bot...
    

    Everything worked fine after that.

    • Like 1
  12. I don't really understand what you mean by "other tile" and all that, but usually these issues occur because distance checks are done with ints. So if its at an angle, the distance is 1.41~ which as an int is rounded to 1. So a tile south 1 tile and east 1 tile is the "same" distance as one just south of you, due to the rounding. Then its just a matter of which NPC is first/last in the internal entity list.

    Also, you should sleep after interacting until the player is animating/interacting, with a max time (see ConditionalSleep or the other implementations around the forums). Also you can check if the spot exists still using currentSpot.exists(), once the fishing spot is gone exists() will return false.

    • Like 2
  13. These flags are what the client uses to calculate pathing. Basically, getTileFlags() returns a int[104][104] that contains the local regions "collision" data. Since OSRS is tile based, its pretty simple in the fact a tile is either blocked via walls or is blocked entirely (solid objects). You can also check if you can cast a spell or shoot a projectile through a wall. Lets look at an example "flag":

    l8TlzES.png

    Now it is an int, but to understand how it works we need the binary representation. 10000000 is the binary representation of 128, but we are looking at the "flags", aka a single bit. This flag has the 8th bit as 1, which we can compare with Region Flags. WALL_WEST is 0x80 in hex form which is 128, so this is our match. But what if multiple flags are flipped? This is where we use the bitwise AND operator:

    flags[localX][localY] & 128 == 0

    What this does is takes the first integer, and 0's out all bits that are not 1 in the second integer (and only the 8th bit is 1 for 128). So this check tests if the 8th bit is 1 (it'll return 128, not 1) or 0 (which returns 0 because all other bits are 0'd). From here we can do this for all the different flags, which you can find using the link in the previous paragraph. Once you can test if there is a wall between nodes, you can connect them. Note that there are no walls surrounding solid objects, so you also need to test if that tile is walkable.

    Xceho7N.png

    This shows a generated "web" of tiles in game, generated from the tile flags. You'll notice there is a bunch of "web" in the open air space too, as this web is just generated by going through every tile and connecting it to its neighbors. All those tiles are not marked "UNWALKABLE" as in your example, and therefore would incorrectly return as reachable. For this use getMap().canReach(Position), which basically does a flood fill of the local region to see what you can get to from the current position.

    • Like 6
  14. Should just have to check if any players are interacting with the NPC:

    public boolean isSplashed(NPC npc) {
    	return !getPlayers().filter(p -> p.isInteracting(npc)).isEmpty();
    }

    Will return true if someone is interacting/splashing the NPC.

    • Like 1
  15. If I'm not mistaken, the highest pitch is 67. So if you wanted to be 100% sure, you could do:

    if (getCamera().getPitchAngle() < 67) {
        getCamera().toTop();
    }

    That being said, the Camera.toTop() method most likely already does this check.

  16. The way I handle this is to eat when food will be 100% effective or if the character is under or at a certain threshold (I set this to monsters max hit). So say you eating trout, it heals 7 hp. If we have 25 hp, we heal at 18 hp or less. This keeps us near full HP which is generally what is wanted with food but won't waste food with %s. But say we were fighting something with a max hit of 5, we'd have a minimum threshold of 5 HP, so in case the monster hits us for max damage we can still live.

    • Like 1
  17. 7 minutes ago, Alek said:

    You want to donate VIP to someone?

    Sure, give it to @Prozen. This is what I got for positions also:
     

    // On ship, near gangplank
    BRIMHAVEN = new Position(2763, 3238, 1),
    CATHERBY = new Position(2792, 3417, 1),
    PORT_KHAZARD = new Position(2674, 3141, 1),
    MUSA_POINT = new Position(2957, 3158, 1),
    PORT_SARIM = new Position(3038, 3189, 1),
    // Off ship, near gangplank
    DOCK_BRIMHAVEN = new Position(2760, 3238, 0),
    DOCK_CATHERBY = new Position(2792, 3414, 0),
    DOCK_PORT_KHAZARD = new Position(2674, 3144, 0),
    DOCK_MUSA_POINT = new Position(2954, 3158, 0),
    DOCK_PORT_SARIM = new Position(3038, 3192, 0),

    Rest you'll need someone who has an account that can access them.

    • Like 2
    • Boge 1
  18. I created this dump so I could calculate best equipment. It was created using a scrapper from the osrs wikia site, so the data isn't 100% accurate. Please let me know of any errors and I will fix them :)

     

    Format of armor (everything but weapons):

    THIRD_AGE_FULL_HELMET("3rd age full helmet",
    	new CombatBonus(0, 0, 0, -5, -2),
    	new CombatBonus(47, 49, 43, -3, 48),
    	new OtherBonus(0, 0, 0, 0),
    	true, true, 1, CombatType.MELEE, EquipmentSlot.HAT, 
    	new SkillRequirement()
    		.add(Skill.DEFENCE, 65))

    And weapons:

    THIRD_AGE_BOW("3rd age bow",
    	new CombatBonus(0, 0, 0, 0, 80),
    	new CombatBonus(0, 0, 0, 0, 0),
    	new OtherBonus(0, 0, 0, 0),
    	true, true, false, true, 1.5, 6, CombatType.RANGED,
    	new SkillRequirement()
    		.add(Skill.RANGED, 65)
    	new CombatStyle("Accurate", AttackType.RANGED, AttackStyle.RANGED_ACCURATE),
    	new CombatStyle("Rapid", AttackType.RANGED, AttackStyle.RANGED_RAPID),
    	new CombatStyle("Longrange", AttackType.RANGED, AttackStyle.RANGED_LONGRANGE))

     

    All enums can be found here:

    https://github.com/Lem0ns/QuantumAPI/tree/master/src/rip/quantum/enums/equipment

    • Like 9
    • Boge 1
×
×
  • Create New...