maferosrs 2 Share 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 Link to comment Share on other sites More sharing options...
Banker 175 Share 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. } Link to comment Share on other sites More sharing options...
maferosrs 2 Author Share Posted June 18, 2017 ty ty ty Link to comment Share on other sites More sharing options...
mshackertr2 0 Share Posted March 15, 2020 Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.