Banker 175 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.
Hashtag 9071 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; }
Banker 175 Author 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); }
Hashtag 9071 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.
Banker 175 Author 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
Recommended Posts
Archived
This topic is now archived and is closed to further replies.