maferosrs 2 Posted June 15, 2017 Hello guys, I am new to the forum, I have basic knowledge of java, I am trying to make my first script, count of lobsters that is in the inventory, could help me, thanks package Main; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.utilities.Timer; import java.awt.*; @ScriptManifest(author = "Mafer", name = "My Fist Script", version = 1.0, description = "Testing My Script", category = Category.MONEYMAKING) public class Main extends AbstractScript { public void onStart() { log("hello"); } public void onExit() { } @Override public int onLoop() { int countLobster = getInventory().count("Lobster"); return 0; } @Override public void onPaint(Graphics graphics) { String LobsterInScreeam = countLobster; } } I want you to send a real-time message to the user of the amount of lobsters he has in his inventory
Banker 175 Posted June 15, 2017 private int countLobster; @Override public int onLoop() { countLobster = getInventory().count("Lobster"); return 100; } @Override public void onPaint(Graphics g) { g.drawString("Lobster Count: "+countLobster, 20, 40); // Will put "Lobster Count: <NumOfLobsters>" on the top left of the screen. }
Recommended Posts
Archived
This topic is now archived and is closed to further replies.