triblion 56 Posted September 12, 2016 I cannot get the script to bank, I have got a banking method set up and once its inventory is full it just sits there. I also cant get it to not run away from a rock if it isnt finished mining, after a set amount of time it will just leave it wether its done or not, I tried using animations to get it to stay there until its animation is stood still again. I also can't figure out how to get the bot to not mine Iron, I want it to mine copper and tin but it will mine iron, I can't find the API to get it to search for Irons ID and not mine that. I have tried w.getID c.getID and just getID, but non of them seem to be a thing any help would be much appreciated. CODE: http://pastebin.com/gsvAgEvG
Hopewelljnj 46 Posted September 12, 2016 I cannot get the script to bank, I have got a banking method set up and once its inventory is full it just sits there. I also cant get it to not run away from a rock if it isnt finished mining, after a set amount of time it will just leave it wether its done or not, I tried using animations to get it to stay there until its animation is stood still again. I also can't figure out how to get the bot to not mine Iron, I want it to mine copper and tin but it will mine iron, I can't find the API to get it to search for Irons ID and not mine that. I have tried w.getID c.getID and just getID, but non of them seem to be a thing any help would be much appreciated. [\quote] A. You have it set to run to mining area when inventory is not full. This should not be there. B. You never tell it to walk to bank area. Do this in the bank method in a similar way you walked to the mining area. I think these should solve the problems.
triblion 56 Author Posted September 12, 2016 I cannot get the script to bank, I have got a banking method set up and once its inventory is full it just sits there. I also cant get it to not run away from a rock if it isnt finished mining, after a set amount of time it will just leave it wether its done or not, I tried using animations to get it to stay there until its animation is stood still again. I also can't figure out how to get the bot to not mine Iron, I want it to mine copper and tin but it will mine iron, I can't find the API to get it to search for Irons ID and not mine that. I have tried w.getID c.getID and just getID, but non of them seem to be a thing any help would be much appreciated. [\quote] A. You have it set to run to mining area when inventory is not full. This should not be there. B. You never tell it to walk to bank area. Do this in the bank method in a similar way you walked to the mining area. I think these should solve the problems. Hahaha, thanks I edited it to walk to the banking area I accidentally put miningArea instead of Bankingarea in the banking method. Do you know how I can get it to stop running away from ore and not mine iron?
Hopewelljnj 46 Posted September 12, 2016 Hahaha, thanks I edited it to walk to the banking area I accidentally put miningArea instead of Bankingarea in the banking method. Do you know how I can get it to stop running away from ore and not mine iron? Its running away because you have it walking to bank area at all times. Any time the inventory isnt full
triblion 56 Author Posted September 12, 2016 Its running away because you have it walking to bank area at all times. Any time the inventory isnt full But it does not run to the bank it runs away from the ore to mine another ore
Mad 86 Posted September 13, 2016 GameObject rock = getGameObjects().closest(GameObject -> GameObject != null && GameObject.getName().equals(nameOfRock)); ur nameOfCock is set to "Rocks", so of course its gonna mine iron, since the name of it is Rocks, you can do getID == blah blah
triblion 56 Author Posted September 13, 2016 GameObject rock = getGameObjects().closest(GameObject -> GameObject != null && GameObject.getName().equals(nameOfRock)); ur nameOfCock is set to "Rocks", so of course its gonna mine iron, since the name of it is Rocks, you can do getID == blah blah I knew that it would mine Iron because it's called rocks. I didnt know how to use getID() as every time I used it it would say cannot be used with an int. I will try this thank you. EDIT: It still says whenever I try getID() in any form it will tell me you cant use this with an int Ones I have tried if(getID() == 7895) { !mineRock(); } if(GameObject.getId() == 7895 { !mineRock(); } if(GameObect.getId(==7895) { !mineRock(); } if(GameObject.getID(7895) { !mineRock(); } if(GameObject.getID(==7895) { !mineRock(); } if(GameObject.getID(=7895) { !mineRock(); }
Mad 86 Posted September 13, 2016 I knew that it would mine Iron because it's called rocks. I didnt know how to use getID() as every time I used it it would say cannot be used with an int. I will try this thank you. EDIT: It still says whenever I try getID() in any form it will tell me you cant use this with an int Ones I have tried if(getID() == 7895) { !mineRock(); } if(GameObject.getId() == 7895 { !mineRock(); } if(GameObect.getId(==7895) { !mineRock(); } if(GameObject.getID(7895) { !mineRock(); } if(GameObject.getID(==7895) { !mineRock(); } if(GameObject.getID(=7895) { !mineRock(); } Well you aren't writing the code correctly, t hat syntax is wrong lol. Before you start writing script, look up some basic java syntax and watch a few videos on it.
slasso 27 Posted September 13, 2016 GameObject rock = getGameObjects().closest(obj -> obj != null && obj.getId() != 12345); // insert iron ore ID here, you can use the debugger I believe to find the id. or just have a log statement to get the ID of it.
triblion 56 Author Posted September 14, 2016 GameObject rock = getGameObjects().closest(obj -> obj != null && obj.getId() != 12345); // insert iron ore ID here, you can use the debugger I believe to find the id. or just have a log statement to get the ID of it. I shall try this when I get home thank you, just needed the syntax for it because I couldnt find it anywhere
Recommended Posts
Archived
This topic is now archived and is closed to further replies.