Skip to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Kyu's simple cannon clicker

Featured Replies


import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.*;
import java.awt.*;

@ScriptManifest(name = "Cannon Clicker", author = "Kyu", version = 1.0, info = "", logo = "") 

public class Main extends Script {
	private long startTime;
    @Override

    public void onStart() {

        //Code here will execute before the loop is started
    	startTime = System.currentTimeMillis();
    }



    @Override

    public void onExit() {

        //Code here will execute after the script ends

    }

    @Override

    public int onLoop() {
    	RS2Object cannon = getObjects().closest("Dwarf multicannon");
    	if(cannon.hasAction("Repair"))
    		cannon.interact("Repair");
    	if(cannon.hasAction("Fire"))
    		cannon.interact("Fire");
        return random(30000,40000); //The amount of time in milliseconds before the loop starts over

    }

    @Override

    public void onPaint(Graphics2D g) {
        final long runTime = System.currentTimeMillis() - startTime;
    	g.drawString(formatTime(runTime), 30, 30);
        //This is where you will put your code for paint(s)

    }

    public final String formatTime(final long ms){
    	
    	long s = ms / 1000, m = s / 60, h = m / 60;
    	s %= 60; m %= 60; h %= 24;
    	return String.format("%02d:%02d:%02d", h, m, s);
}	

}

first script be gentle

Edited by kyukyu

gl with your script

Might want to look into position checking as I assume if there's another cannon nearby your script will bug out. Cool idea for a first script though :) 

2 hours ago, Inf Zita said:

y no jar to test

Compile it yourself??

14 minutes ago, Runnwith said:

Compile it yourself??

lazy.jpg.1b69cfde56ea2310ab54578c0b404b39.jpg

 

lol just kidding, nice job man, if people want to use it they should know how to compile a .j

? what if there are two cannons next to you ?

On 2017. 09. 19. at 11:01 PM, Runnwith said:

Compile it yourself??

 

On 2017. 09. 19. at 11:19 PM, no face said:

lazy.jpg.1b69cfde56ea2310ab54578c0b404b39.jpg

 

lol just kidding, nice job man, if people want to use it they should know how to compile a .j

facepalm.jpg.8fed7c9ee7f876e7fead18df1885916e.jpg

On 2017. 09. 19. at 8:56 PM, Inf Zita said:

y no jar to test

 

On 2017. 09. 22. at 6:46 PM, ukasz said:

.jar ? 

http://www.filedropper.com/showdownload.php/cannon

i compiled it with the help of @FrostBug :feels:

it reloads very slow, if there are way too many monsters it runs out of cannonballs & it doesnt click the level up button but at least it works!

8l25H_fpQGOeh4rQQrruwg.png

Edited by gearing

  • 2 weeks later...
On ‎19‎/‎09‎/‎2017 at 11:25 PM, Chris said:

? what if there are two cannons next to you ?

Then you can shoot double.

  • Author

stand under your cannon and youll shoot yours :)

On 9/25/2017 at 5:19 AM, gearing said:

 

http://www.filedropper.com/showdownload.php/cannon

i compiled it with the help of @FrostBug :feels:

it reloads very slow, if there are way too many monsters it runs out of cannonballs & it doesnt click the level up button but at least it works!

8l25H_fpQGOeh4rQQrruwg.png

yeah those are problems that kind of come with what i was trying to do. I just wanted to replicate afk cannon behavior so the time inbetween clicks on the cannon is quite a bit long. Basically i wanted to make a script that afks for me :)

  • 1 month later...

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.