Doxial 0 Posted April 23, 2024 So i'm trying to get get data about the local player (I want the amount of xp they have in a skill), so I put the SkillTracker in the onStart method. However, because the player doesn't start logged in, this causes issues with initializing the SkillTracker variable. I tried putting Sleep.sleepUntil(() -> Client.isLoggedIn(), 10000); But the login solver also does not run, because I made it sleep. All that to ask, how can I get my code to wait until the program has logged in?
camelCase 317 Posted April 23, 2024 59 minutes ago, Doxial said: So i'm trying to get get data about the local player (I want the amount of xp they have in a skill), so I put the SkillTracker in the onStart method. However, because the player doesn't start logged in, this causes issues with initializing the SkillTracker variable. I tried putting dont, put it in onloop and check if its not already set and you are logged in
Luxe 87 Posted May 8, 2024 On 4/23/2024 at 5:00 PM, camelCase said: dont, put it in onloop and check if its not already set and you are logged in from my personal scripts i use this: OnStart method if (Client.isLoggedIn()) { SkillTracker.start(Skill.THIEVING); startingThievingExp = SkillTracker.getStartExperience(Skill.THIEVING); } Loop method @Override public int onLoop() { if (timer != null && timer.isPaused()) { timer.resume(); } if (!SkillTracker.hasStarted(Skill.THIEVING)) SkillTracker.start(Skill.THIEVING); if(startingThievingExp == 0) startingThievingExp = SkillTracker.getStartExperience(Skill.THIEVING); if(getSettings().shouldLoop) { return this.getRoot().onLoop(); } return 200; } BeatriceCox 1
camelCase 317 Posted May 8, 2024 8 hours ago, ImLife said: if (!SkillTracker.hasStarted(Skill.THIEVING)) SkillTracker.start(Skill.THIEVING); you still need to check if you're logged in
BeatriceCox 1 Posted June 13, 2024 (edited) On 5/8/2024 at 6:49 PM, Luxe said: from my personal scripts i use this: OnStart method if (Client.isLoggedIn()) { SkillTracker.start(Skill.THIEVING); startingThievingExp = SkillTracker.getStartExperience(Skill.THIEVING); } Loop method @Override public int onLoop() { if (timer != null && timer.isPaused()) { timer.resume(); } if (!SkillTracker.hasStarted(Skill.THIEVING)) SkillTracker.start(Skill.THIEVING); if(startingThievingExp == 0) startingThievingExp = SkillTracker.getStartExperience(Skill.THIEVING); if(getSettings().shouldLoop) { return this.getRoot().onLoop(); } return 200; } Thanks for sharing, I will try it. Edit: I tried it and it works for me. Edited July 13, 2024 by BeatriceCox Luxe 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now