Banker 175 Share Posted September 30, 2016 Hey, so i have managed to create my dicebot (previous thread) but i am having an issue keeping it logged in, as it only chats it simply logs out after a certain amount of time. I dont really want the bot to walk around so how would i make it rotate the camera a random amount every so often in the onLoop to keep it logged in? Thanks. Link to comment Share on other sites More sharing options...
Hashtag 8670 Share Posted September 30, 2016 You want to have a timer and a long called nextRotate. Timer timer; long nextRotate; @Override public void onStart() { timer = new Timer(); } And in your onLoop method @Override public int onLoop() { if (timer.elapsed() > nextRotate) { getCamera.rotate(); //I am not sure what the method is called but look it up nextRotate = timer.elapsed() + 10 * 60 * 1000; //Rotate the camera in 10 minutes } return 200; } Link to comment Share on other sites More sharing options...
Banker 175 Author Share Posted September 30, 2016 You want to have a timer and a long called nextRotate. Timer timer; long nextRotate; @Override public void onStart() { timer = new Timer(); } And in your onLoop method @Override public int onLoop() { if (timer.elapsed() > nextRotate) { getCamera.rotate(); //I am not sure what the method is called but look it up nextRotate = timer.elapsed() + 10 * 60 * 1000; //Rotate the camera in 10 minutes } return 200; } Would doing this keep the bot logged in also? @Override public int onLoop() { getCamera().mouseRotateTo(rand.nextInt(100), rand.nextInt(100)); return Calculations.random(3500,7500); } Link to comment Share on other sites More sharing options...
Hashtag 8670 Share Posted September 30, 2016 Would doing this keep the bot logged in also? @Override public int onLoop() { getCamera().mouseRotateTo(rand.nextInt(100), rand.nextInt(100)); return Calculations.random(3500,7500); } Yes it does the same thing. Using that method you really can not do anything else in your onLoop but I guess you do not need anything in your onLoop because it is a dicing script. Link to comment Share on other sites More sharing options...
Banker 175 Author Share Posted September 30, 2016 Yes it does the same thing. Using that method you really can not do anything else in your onLoop but I guess you do not need anything in your onLoop because it is a dicing script. Ahh, okay, thanks for your help anyway Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.