-
Posts
11137 -
Joined
-
Last visited
-
Days Won
88 -
Feedback
100%
Everything posted by Apaec
-
Can you explain what happened? I don't stake and not sure what's going on in this photo!
-
Base code is looking good, nice work The health checking needs some work still...! The idea of the case based structure is to make the code more readable and easier to debug. It also makes adding additional functions to the script a little bit easier. As you rightly guessed, we are going to need a new state, which you've called HEALTHCHECK. Perhaps would be better to call this state RUN_FROM_COMBAT or something similar, as the state determines the 'action' code rather than the check. Additionally, you're messing around with global variables and relying on these values in other functions. While this is perfectly valid, in this situation it's somewhat unnecessary - you can simply do the health checking in the getState() function (after all, that's what it's there for!). Finally, it would be alot cleaner and universal if you were to use hp percentage thresholds rather than straight hp thresholds. While i'm not a fan of giving code straight up, I feel that in this case it's important that you get this right to continue your journey! I'll show you how you can go about solving this issue. Here's a simple way to go about the issue which follows the initial state based structure: > Note that i've changed the state name to RUN_FROM_COMBAT and the calculations are done in the getState() function. (Also, i've written this all in the reply box and haven't tested it, so there may well be typos / errors. Sorry!) import org.osbot.rs07.api.map.Position; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; @ScriptManifest(author = "Jacareverde", info = "My first script", name = "Woodcutting", version = 0, logo = "") public class main extends Script { public int hpThreshold = 30; // Percent! @[member='Override'] public void onStart() { log("Welcome to Jacareverde's Woodcutter!"); log("If you experience any issues while running this script please report them to me on the forums."); } private enum State { CUT, BANK, WAIT, RUN_FROM_COMBAT }; public State getState() { Entity tree = objects.closest("Tree"); int hpPercentage = (getSkills().getDynamic(Skill.HITPOINTS) * 100) / getSkills().getStatic(Skill.HITPOINTS); if (hpPercentage < hpThreshold) return State.RUN_FROM_COMBAT; if (inventory.isFull()) return State.BANK; if (tree != null) return State.CUT; return State.WAIT; } @[member='Override'] public int onLoop() throws InterruptedException {; int HP = (getSkills().getDynamic(Skill.HITPOINTS)); boolean lowHealth = (HP <= 7); switch (getState()) { case CUT: Entity tree = objects.closest("Tree"); if (tree.exists()) { tree.interact("Chop down"); while (tree.exists()) { sleep(random(500, 700)); } } break; case BANK: if (getBank().open()) { getBank().depositAll("Logs"); getBank().close(); } if (!getBank().open()) { getBank().open(); } getWalking().walk(new Position(3101, 3246, 0)); break; case WAIT: sleep(random(500, 700)); break; case RUN_FROM_COMBAT: if (lowHealth == true) { getWalking().walk(new Position(3096,3241,0)); } break; } return random(200, 300); } @[member='Override'] public void onExit() { log("Thanks for running my Woodcutter!"); } @[member='Override'] public void onPaint(Graphics2D g) { } } Let me know if that does/doesn't work, and good luck!! ~apa
-
I've just enabled your 24h trial, hopefully I wasn't too late!! ~apa
-
I will replace the cursor in the next version, sorry about that!
-
Ah, thanks for letting me know. I will extend the path! apa
-
Unfortunately you can only use one potion at the moment. Multiple potions are on the to-do list, but it's not a particularly small change based on the current structure of the code. For now i'd suggest using standard combat potions, or supers if you can afford. Sorry about that! ~apa
-
I will be looking into ammo looting as there is another similar bug tied in with looting + pathwalking. Cheers! Please like the corresponding threads and you should automatically receive a trial!
-
Very odd... no error messages in the console?
-
Murgee Auto Clicker? Or anything else recommended?
Apaec replied to dicktaco's topic in Botting & Bans
As you said, this idea of the client handling everything for you does bring up a few issues, notably all scripts have similar interactions and there's more scope for things to go wrong which cannot be fixed by the scripter, however these issues make scripting alot more accessible, so it's certainly worth it. As for the model script, there's no set way to write one, and I don't have a good example as i'm not particularly happy with how some of my own scripts are written. However what I did when I started out was look around here: http://osbot.org/forum/forum/288-downloadablelocal-scripts/ and decompile some scripts ~apa -
Ah, I apologies then. I thought the issue with the mirror client was fixed though... Do other scripts work just fine?
-
Awesome progress! And yes, if you "suicide" bot (just leave it running) you will get banned no matter what As for dialogues, take a look at the API http://osbot.org/api/ , specifically http://osbot.org/api/org/osbot/rs07/api/Dialogues.html Hopefully the suite of methods available there should suffice for your needs! apa
-
Probably due to the update today then. Hopefully will be fixed soon with the next client version!
-
I believe the client may be having issues due to the update today. Perhaps try other SDN scripts - if they don't work either then this is probably the case!
-
Not sure. Could be a result of todays update - Have you tried re-booting the bot?
-
I wouldn't say this was easy. Just a different difficult to what you're used to @OP especially like the doritos D
-
Sick paint ;) I'd be curious to know what pAnti-Ban does tho 1!
-
Go into options > debug > entity hover debug, and hover over the tile in question ~apa
-
Hey, I'm sorry to hear that. Unfortunately bans are one of those things that you can't predict and are given out somewhat randomly, but to prevent this happening again, be sure to check out a guide on preventing bans: osbot.org/forum/topic/45618-preventing-rs-botting-bans/ Most importantly i'd say botting in moderation is paramount - even 2 hours seems too long, unless spread throughout the day! Having said that, i've not recieved any bans and have cumulatively used the script for hundreds of hours. It really is just luck of the draw. What's more, as sand crabs is such a high traffic area, it's worth taking extra care. Ofcourse if you want a refund, please visit this link to submit a request: http://osbot.org/forum/forum/150-refund-requests/ , however I believe they cannot process requests based on bans, simply because that's a risk which must be taken into consideration before botting! Cheers, Apa
-
Ah, unfortunately not How long would it take to get 100%? I hear hosidius can take a while... It is possible that I can develop it without, I just cannot guarentee I will get it right first time, that's all! Apa
-
Wew that's great! It's always a good feeling when something works. Firstly, remember that we're dealing with Java here, not JavaScript. Those are two very different things! As for making it stay in one spot, you can define an area and filter out the trees who are not in this area. That's probably your best bet. Check out here for details on areas: http://osbot.org/api/org/osbot/rs07/api/map/Area.html Good luck! let me know how you get on/if you have any more questions apa
-
So OSBuddy Lets You Run RS Through Your GPU Now...
Apaec replied to Spookz's topic in Spam/Off Topic
Unfair advantage :p I mean if i'm honest, the advantage that 3rd party 'assistant' clients already give is too much and should be against the rules anyway. -
Sure thing! Are there any requirements that I need to get on my test account before being able to use it? ~apa
-
So OSBuddy Lets You Run RS Through Your GPU Now...
Apaec replied to Spookz's topic in Spam/Off Topic
This is very cool, but should be against the rules ! -
Ah, no. Randomise break times enables a percentage deviation to your current values (I think), so you still need to enter figures. Anyhow, glad it's all sorted! apa