Doxial 0 Share Posted April 23 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? Link to comment Share on other sites More sharing options...
camelCase 257 Share Posted April 23 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 Link to comment Share on other sites More sharing options...
red20 0 Share Posted May 8 Isnt Client.isLoggedIn() for the status of the client, not the rs user? Link to comment Share on other sites More sharing options...
Luxe 41 Share Posted May 8 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 Link to comment Share on other sites More sharing options...
camelCase 257 Share Posted May 8 8 hours ago, ImLife said: if (!SkillTracker.hasStarted(Skill.THIEVING)) SkillTracker.start(Skill.THIEVING); you still need to check if you're logged in Link to comment Share on other sites More sharing options...
BeatriceCox 1 Share Posted June 13 (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 by BeatriceCox Luxe 1 Link to comment Share on other sites More sharing options...
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