-
Posts
56 -
Joined
-
Last visited
-
Feedback
0%
Posts posted by xlDino
-
-
Would this fix wilderness ditch warning with webwalking? or do i need my own handler
-
40 minutes ago, bobdough said:
banned as well, i think CZAR scripts are more likely to get banned i should have stuck with Khal
Not true.
Post amazon prime bot cleanup day
- 1
-
All thoughts or improvements are welcome!
1. initStages(): This method initializes the stages of the bot. It creates an array of "Stage" objects and assigns it to the "stages" variable. In this example, there are two stages defined: StageOne and StageTwo.
2. nextStage(): This method determines the next stage that should be executed based on the current stage. It searches for the index of the current stage in the "stages" array and returns the stage at the next index. If there are no more stages, it returns null, indicating that the script has completed.
3. onStart(): calls the initStages() method to initialize the stages and assigns the first stage to the currentStage variable upon bot startup.
4. onLoop(): Inside this method, the current stage is checked, and if it exists, its logic is executed by calling the `execute()` method of the current stage. After executing the logic, the isCompleted() method of the current stage is checked to determine if the stage is completed. If the stage is completed, the next stage is transitioned to by calling the nextStage() method. If there are no more stages, the script restarts by re-initializing the stages and assigning the first stage to the currentStage variable. The method returns an integer value that represents the delay between iterations of the loop.
import java.awt.Graphics2D; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(name = "MyScript", author = "YourName", version = 1.0, info = "", logo = "") public class Main extends Script { boolean debugMode = true; private Stage previousStage; private Stage currentStage; private Stage[] stages; private void debug(String message) { if(debugMode){log("[DEBUG] " + message);} } private interface Stage { void execute() throws InterruptedException; boolean isCompleted(); } private void initStages() { stages = new Stage[]{ new StageOne(), new StageTwo() }; } private Stage nextStage() { int currentIndex = -1; for (int i = 0; i < stages.length; i++) { if (stages[i] == currentStage) { currentIndex = i; break; } } if (currentIndex != -1 && currentIndex + 1 < stages.length) { return stages[currentIndex + 1]; } return null; // No more stages, script completed } public void onStart() { // Initialize stages initStages(); // Start with the first stage currentStage = stages[0]; } public void onExit() { // Cleanup code } public void onPaint(Graphics2D g) { } public int onLoop() throws InterruptedException { if (currentStage != null) { boolean stageChanged = currentStage != previousStage; if (stageChanged) { debug("[StageHandler] Current Stage: " + currentStage); previousStage = currentStage; } currentStage.execute(); if (currentStage.isCompleted()) { currentStage = nextStage(); previousStage = null; // Reset previousStage when transitioning to a new stage } } if (currentStage == null) { debug("Stage is null! Restarting stages..."); initStages(); currentStage = stages[0]; previousStage = null; // Reset previousStage when restarting stages } return random(500, 1000); // Set a delay between iterations } private class StageOne implements Stage { public void execute() throws InterruptedException { } public boolean isCompleted() { // Stage One completion condition return false; } } private class StageTwo implements Stage { public void execute() throws InterruptedException { // Stage Two execution logic } public boolean isCompleted() { // Stage Two completion condition return false; } } }
An example StageOne that checks if the player is moving, and completes if they are:
private class StageOne implements Stage { public void execute() throws InterruptedException { // Check if the player is moving if (!myPlayer().isMoving()) { debug("Player is not moving..."); } else { debug("Player is moving..."); } } public boolean isCompleted() { // Completion condition: Player is moving return myPlayer().isMoving(); } }
-
dynamic ip + VM's
-
2 hours ago, Khaleesi said:
You can simply check the rotation of a player, might be easier than checking it like that
myPlayer().getRotation()
If you enable myPlayer debug in the debug tab, it will be included.
If interacting with an entity these values sometimes shift a little bit.
0 = South
256 = South-West
512 = West
768 = North-West
1024 = North
1280 = North-East
1536 = East
1792 = South-East
Found this out after hahahahaha
- 1
-
This method finds what direction the player is facing based on the previous tile, and assigns it to the 'direction' string.
private void checkPlayerDirection() { int currentX = myPlayer().getX(); int currentY = myPlayer().getY(); int deltaX = currentX - previousX; int deltaY = currentY - previousY; if (deltaX == 0 && deltaY == 0) { direction = previousDirection; // Use the previous direction when not moving } else if (deltaX == 0) { direction = deltaY > 0 ? "North" : "South"; } else if (deltaY == 0) { direction = deltaX > 0 ? "East" : "West"; } else if (deltaX > 0) { direction = deltaY > 0 ? "North-East" : "South-East"; } else { direction = deltaY > 0 ? "North-West" : "South-West"; } if (!direction.equals(previousDirection)) { log("Player is facing: " + direction); previousDirection = direction; } }
onStart
previousX = myPlayer().getX(); previousY = myPlayer().getY();
onLoop
checkPlayerDirection(); previousX = myPlayer().getX(); previousY = myPlayer().getY();
Variables
int previousX; int previousY; String direction; String previousDirection;
Usage
if(direction == "North") { //do something }
-
-
public void projectilePrayerSwitch() { for (Projectile p : projectiles.getAll()) { if (p.getId() == 2176) { log("NPC attacked with magic!"); prayer.set(PrayerButton.PROTECT_FROM_MAGIC, true); } else if (p.getId() == 2178) { log("NPC attacked with ranged!"); prayer.set(PrayerButton.PROTECT_FROM_MISSILES, true); } } }
and animations
public void animationPrayerSwitch() { // Iterate over all NPCs for (NPC npc : npcs.getAll()) { // Get the current animation ID of the NPC int animationId = npc.getAnimation(); // Check if the NPC is attacking with magic if (animationId == 711) { log("NPC attacked with magic!"); // Activate Protect from Magic prayer.set(PrayerButton.PROTECT_FROM_MAGIC, true); } // Check if the NPC is attacking with ranged else if (animationId == 249 || animationId == 250) { log("NPC attacked with ranged!"); // Activate Protect from Missiles prayer.set(PrayerButton.PROTECT_FROM_MISSILES, true); } } }
- 1
- 2
-
-
1 hour ago, faketesco said:
There's streamers that do tick methods for longer than that lol
Yea, not the average rs player. Bot to simulate the average player, not the top 0.1% and your bans WILL decrease
-
5 hours ago, GOD said:
Welcome to botting
5 hours ago, madibo said:This is hilarious... I got banned the next day after doing 2:50 Hours of Agility with a paid script.
First time i bot on this account and on this internet connection and on this computer. so how the hell..
Currently 70+ agility on multiple accounts. Bans are at an all time low using stealth mode + new mouse. If botting agility you should babysit and only bot 20-30mins at a time, with frequent breaks. Would you sit and do 3 hours of agility irl?
-
trial plz
-
Any chance to add family crest for goldsmith gauntlets?
-
48 minutes ago, Fruity said:
Rune pouch yes, Ibans I’m working on it.
I use to have super anti poisons but then people were dying outside the lair due to not taking enough and drinking them every few attacks. I may add them again with a big alert saying to keep an eye out
—-
just a heads up for everyone I’m going to try keep up with maintainable but my laptop is currently away for repair (turns out laptops and lemonade don’t mix well)
Got it figured out, script is running flawlessly now! Not using ibans
- 1
-
Long term user here, I'm looking to make a script. It will be fully open source, and community lead.
So for starters, are there any niche's that could be filled? What would be a good start that's not been done to death?
Hopefully this is the start of something great!
-
No support for ibans staff/rune pouch?
-
Does script support the agility shortcut?
- 1
-
Script is taking a long time to startup. Wont show correct XP gained in combat skill, and wont alch cause it thinks im out of nature runes (they're in my rune pouch)!
Just thought i'd let you know
-
Could I get a trial please?
- 1
-
can i get a trial please?
-
1 hour ago, Czar said:
done enjoy! Wintertodt is beta atm which will be going back to store soon, so gave you extended auth. lemme know what you think - I urge you to give as harsh feedback/constructive criticism as possible
Oh sweet, I'll report back here in a few days!
- 1
-
-
-
Title says it all! willing to use a middleman
looking for $25 CAD
pm me on discord
xlDino#8544
Advice on structuring large scripts?
in Scripting Help
Posted
this might help you get started, PM with any questions