Grundyr 19 Share Posted November 7, 2016 hello there, so i just tried tomake my first script for picking up ashes at the GE, ive copied the cabage picker script and tried to implement some things of my own, i know it is shit but dont be to hard on me :/ /** * Created by Gundyr on 7-11-2016. */ import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.map.Area; import org.dreambot.api.methods.map.Tile; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.ScriptManifest; @ScriptManifest(name = "ash picker", description = "Picks ashes in grand exchange", version = "1.0", category = "other") public class main extends AbstractScript{ area Grandexchange = new Area (3147, 3476, 3180,3504); area Bank = new Tile(3167, 3489); GameObject = Ashes; GameObject = Bank; }public int onLoop() {if (!getInventory().isFull()) { if (Grandexchange.contains(getLocalPlayer())) { Ashes = getGameObjects().closest(a -> a != null && a.getName().equals("Ashes") && a.hasAction("Pick")); Ashes.interact("Pick"); sleepUntil(() -> getLocalPlayer().getAnimation() == 882, Calculations.random(328, 412)); } else { getWalking().walk(Grandexchange.getRandomtile()); sleep(Calculations.random("1334,1586")); } } else{ if(Bank.distance(getLocalPlayer()) <= 3) { if (getBank().isOpen()); { getBank().depositAllItems(); } else{ if (getBank().distance(getLocalPlayer()) <= 5) { if (getBank().isOpen()) { getBank().depositAllItems(); } else { Bank = getGameObjects().closest(b -> b != null && b.getName().equals("Banker") && d.hasAction("Bank banker")); Bank.interact("Deposit"); sleepUntil(() -> getBank().isOpen(), Calculations.random(743, 1694)); } else{ getWalking().walk(Bank); sleep(Calculations.random(1638, 2584)); } } return Calculations.random(362, 625); } } { } i cant compile it and i dont know what i did wrong. Link to comment Share on other sites More sharing options...
triblion 56 Share Posted November 7, 2016 hello there, so i just tried tomake my first script for picking up ashes at the GE, ive copied the cabage picker script and tried to implement some things of my own, i know it is shit but dont be to hard on me :/ /** * Created by Gundyr on 7-11-2016. */ import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.map.Area; import org.dreambot.api.methods.map.Tile; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.ScriptManifest; @ScriptManifest(name = "ash picker", description = "Picks ashes in grand exchange", version = "1.0", category = "other") public class main extends AbstractScript{ area Grandexchange = new Area (3147, 3476, 3180,3504); area Bank = new Tile(3167, 3489); GameObject = Ashes; GameObject = Bank; }public int onLoop() {if (!getInventory().isFull()) { if (Grandexchange.contains(getLocalPlayer())) { Ashes = getGameObjects().closest(a -> a != null && a.getName().equals("Ashes") && a.hasAction("Pick")); Ashes.interact("Pick"); sleepUntil(() -> getLocalPlayer().getAnimation() == 882, Calculations.random(328, 412)); } else { getWalking().walk(Grandexchange.getRandomtile()); sleep(Calculations.random("1334,1586")); } } else{ if(Bank.distance(getLocalPlayer()) <= 3) { if (getBank().isOpen()); { getBank().depositAllItems(); } else{ if (getBank().distance(getLocalPlayer()) <= 5) { if (getBank().isOpen()) { getBank().depositAllItems(); } else { Bank = getGameObjects().closest(b -> b != null && b.getName().equals("Banker") && d.hasAction("Bank banker")); Bank.interact("Deposit"); sleepUntil(() -> getBank().isOpen(), Calculations.random(743, 1694)); } else{ getWalking().walk(Bank); sleep(Calculations.random(1638, 2584)); } } return Calculations.random(362, 625); } } { } i cant compile it and i dont know what i did wrong. The action for picking up items is called "Take" not pick so in your case it would be a.hasAction("Take"); Also the banking method would be banker.hasAction("Bank"); you don't need the banker part in there As for banking you can just do getBank.DepositAllItems(); and it will just dump the entire inventory insteal of Bank.interact("Deposit"); Also the complile have you set it up as an artifact and then added the module output to that? (What IDE do you use) As far as copying the cabbage picker script I wouldn't paste it I would follow it through and make a cabbage picking script instead, you also need to read through the script and make sure it's all right where I mentioned "Pick" that would be from the cabbage script that you need to change to "Take", also Ashes would be a ground object since they are on the ground as a pose to cabbage which would be a game object. Good luck ask if you need any more help Link to comment Share on other sites More sharing options...
Dreamlicker 750 Share Posted November 7, 2016 I would look into learning how Java works first. There are a lot of errors that are a result of not knowing that. This is a decent intro https://www.codecademy.com/learn/learn-java Link to comment Share on other sites More sharing options...
Grundyr 19 Author Share Posted November 7, 2016 i've already followed that java clas.... Link to comment Share on other sites More sharing options...
Dreamlicker 750 Share Posted November 7, 2016 i've already followed that java clas.... Are you using an IDE to make the program? (Something like Eclipse or IntelliJ) If not, you should. They will help you out a lot when you're beginning. For example, This bracket that is underlined is closing your class already. Your variables aren't defined correctly "area" for the class that they are and "GameObject = Bank" / "GameObject = Ashes" both are not valid. Link to comment Share on other sites More sharing options...
Grundyr 19 Author Share Posted November 7, 2016 i am using IntelliJ ah now i see where i went wrong. i think i will stick to a woodcutter and after that progress to something else. Link to comment Share on other sites More sharing options...
Mad 86 Share Posted November 7, 2016 this is a troll right Link to comment Share on other sites More sharing options...
triblion 56 Share Posted November 7, 2016 i am using IntelliJ ah now i see where i went wrong. i think i will stick to a woodcutter and after that progress to something else. Follow a video tutorial that will help a lot this is a troll right Everyone has to start somewhere Link to comment Share on other sites More sharing options...
None 227 Share Posted November 7, 2016 hello there, so i just tried tomake my first script for picking up ashes at the GE, ive copied the cabage picker script and tried to implement some things of my own, i know it is shit but dont be to hard on me :/ ashes on the ground would be groundItems not gameobjects, most likely the action would be to Pick-up not just pick. you do no need to define a banker to be able to bank but if you choose to do so, they are an NPC not a gameObject, unless you want to interact with the bank booth. generally you would say if in certain distance to bank. getBank().open() Link to comment Share on other sites More sharing options...
rokaHakor 171 Share Posted November 7, 2016 ashes on the ground would be groundobjects not gameobjects, most likely the action would be to Pick-up not just pick. you do no need to define a banker to be able to bank but if you choose to do so, they are an NPC not a gameObject, unless you want to interact with the bank booth. generally you would say if in certain distance to bank. getBank().open() GroundItem* but yeah just do everything none says. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.