nickb95x Posted April 18, 2013 Share Posted April 18, 2013 (edited) Hey, I know the bot doesn't currently support eating since there is no health support, but is there a way the bot could click an item id in the inventory after x amount of seconds so say I have inventory full of lobbies make it click a lobster after x amount of seconds and also make it log out when it's out of food (no item id left in inventory), this would be great! If anyone could help me and tell me what i need to add to my script (the exact code) that would be great! and p.s. I'd obviously want the combat script running while the script does all of this. :P Edited April 18, 2013 by nickb95x Link to comment Share on other sites More sharing options...
Speakmore Posted April 18, 2013 Share Posted April 18, 2013 (edited) Hey, I know the bot doesn't currently support eating since there is no health support, but is there a way the bot could click an item id in the inventory after x amount of seconds so say I have inventory full of lobbies make it click a lobster after x amount of seconds and also make it log out when it's out of food (no item id left in inventory), this would be great! If anyone could help me and tell me what i need to add to my script (the exact code) that would be great! There is a way to make it click yes. If this is groovy, I have the code: selectInventoryOption(spot (0-27), "action", true) Then to make it wait I guess return 30000? 30 seconds Did this help? Edited April 18, 2013 by Speakmore Link to comment Share on other sites More sharing options...
nickb95x Posted April 18, 2013 Author Share Posted April 18, 2013 There is a way to make it click yes. If this is groovy, I have the code: selectInventoryOption(spot (0-27), "action", true) Then to make it wait I guess return 30000? 30 seconds Did this help? nope I wanted it to click an item id in inventory every x seconds as in a different inventory space every time because it will be clicking food.. then when there is no more of the item id in inventory log out... this just clicks set inventory spaces witch could maybe work as long as it logs out x amount of seconds after clicking the 27th inventory space.... Link to comment Share on other sites More sharing options...
Speakmore Posted April 18, 2013 Share Posted April 18, 2013 nope I wanted it to click an item id in inventory every x seconds as in a different inventory space every time because it will be clicking food.. then when there is no more of the item id in inventory log out... this just clicks set inventory spaces witch could maybe work as long as it logs out x amount of seconds after clicking the 27th inventory space.... Make it eat spot 1, then wait xxxxx amount of time, then eat spot 2? Just copy and past teh line, but change the uhhh inven spot. Link to comment Share on other sites More sharing options...
nickb95x Posted April 18, 2013 Author Share Posted April 18, 2013 Make it eat spot 1, then wait xxxxx amount of time, then eat spot 2? Just copy and past teh line, but change the uhhh inven spot. ok how do i make it wait x amount of seconds between clicking each inv space?? you didnt post that Link to comment Share on other sites More sharing options...
Speakmore Posted April 18, 2013 Share Posted April 18, 2013 ok how do i make it wait x amount of seconds between clicking each inv space?? you didnt post that return 1000 makes it wait 1 second So I guess make it however many seconds you want it to wait. Test that, I just started scripting, so I'm not too sure if that'll work perfectly :| Link to comment Share on other sites More sharing options...
nickb95x Posted April 18, 2013 Author Share Posted April 18, 2013 return 1000 makes it wait 1 second So I guess make it however many seconds you want it to wait. Test that, I just started scripting, so I'm not too sure if that'll work perfectly :| It doesn't work. Could anyone please help me? Link to comment Share on other sites More sharing options...
zeejfps Posted April 19, 2013 Share Posted April 19, 2013 As far as I know there is no way you can do this simply... Because if I understand correctly you want it to eat every lets just say 20 seconds, but you still want the script to run normally.... However, you can try this, not guaranteed it will work but still: private final int timeToWait = 10; //In seconds;private int startTime;private int runTime; @Overridepublic void onStart(){ startTime = System.currentTimeMillis(); //Set the start time for first time..} @Overridepublic void onPaint(Graphics g){ updateInfo(); //Update the runTime every second, There might be a better way but idk what it is.} @Overridepublic int onLoop(){ if(runTime > timeToWait){ //Checks if the run time passed the wait time eatFood(); //Some method... You will have to make this I wont spoon feed you. startTime = System.currentTimeMillis(); //Resets the startTime. }} private void updateInfo(){ runTime = (System.currentTimeMillis() - startTime) / 1000; //Basicaly takes the current time and subtracts from time started then finds it in seconds.} Link to comment Share on other sites More sharing options...