MidnightBlue
Members-
Posts
10 -
Joined
-
Last visited
-
Feedback
0%
Profile Information
-
Gender
Male
MidnightBlue's Achievements
Newbie (1/10)
1
Reputation
-
Here's the new script skeleton you will be using, please import the class files down below as these are not in the OsBot API. In the scriptStart method, add your class, or classes that extend my custom Node class. (Example shown below) package ca.midnightblue.scripts.wc; import java.awt.Graphics2D; import org.osbot.rs07.script.ScriptManifest; import ca.midnightblue.scripts.wc.nodes.Idling; @ScriptManifest(name = "Custom Script Skeleton", author = "Midnight Blue", version = 1.0, info = "", logo = "") public class Core extends CustomScript { @Override public void scriptStart() { add(Woodcut.class, Walk.class, Bank.class); } @Override public void scriptStop() { } @Override public void loop() { } @Override public void paint(Graphics2D g) { } } Now in your classes that extend Node, which will contain the back bone aka the script functionality, the function "loop" that returns an integer is where you want to put what the bot does during that loop, you will return the amount of time you want the bot to sleep, by default it sleeps a random interval of 10 to 100MS. Your validate method will return when you want this script to activate. (You don't want to run all of your scripts at the same time) And lastly, your getStatus method should return a string with a brief description of what the bot is doing at the moment. Example: If your bot is banking return "banking". Here's an example of how to use my new script skeleton package ca.midnightblue.scripts.wc.nodes; import org.osbot.rs07.script.Script; public class Idling extends Node { private long then; public Idling(Script script) { super(script); then = System.currentTimeMillis(); } @Override public int loop() { long now = System.currentTimeMillis(); if(now - then <= 300000L) { //every 5 minutes then = now; //open tabs or something } return 0; } @Override public boolean validate() { return !script.myPlayer().isMoving(); } @Override public String getStatus() { return "Idling"; } } Node.java CustomScript.java Hope you enjoy! :-) Please comment if you like this noob-friendly node snippet I made!
-
So when the inventory tab is open, I want to draw a rectangle around a certain slot. here's my code if(Tab.INVENTORY.isOpen(null)) { Rectangle slot = client.getInventory().getDestinationForSlot(1); g.drawRect(slot.x, slot.y, slot.width, slot.height); } isOpen requires a paramater of the type RS2InterfaceChild, I've got no clue as to what to put for the parameter. Can somebody help me?
-
So I'm using this custom type method because the built in type method uses delay. So I want to simulate hitting the enter key but it won't work, I think I have to add some delay between hitting the keys and hitting enter but I don't know if you can. Can somebody please check out my code? public void test(String message) throws InterruptedException { for(char c : message.toCharArray()) { bot.getKeyboard().typeKeyEvent(c, 0); } bot.getKeyboard().typeKeyEvent((char) KeyEvent.VK_ENTER, 0); }
-
I'm making a private price checker bot for my clan chat, here's the code I'm using. client.typeString("/" + args[1] + " - " + (price == 0 ? "not tradable" : price)); Is there a way I can set the typing speed or the interval in milliseconds per character, such as: client.setTypingSpeed(7); If there's any possible way to do this, it would be greatly appreciated if you could help me out. Thanks in advanced. (: