Jump 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.

StyxAfker [Free]

Featured Replies

d69IFDq.png

This is a simple afker script. The script clicks between inventory and skill tabs at random intervals to prevent logout. The intervals are 3-4,5 minutes.

Put the jar file to C:\Users\USERNAME\OSBot\Scripts and the script should appear on your script list in the client.

Download: StyxAfker.jar v1.01

xy7Uxx8.png

Source:

Spoiler

import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import java.awt.Color;
import java.awt.Graphics2D;
import org.osbot.rs07.api.ui.Tab;

@ScriptManifest(
        author = "styxa", name = "StyxAfker", version = 1.01, info = "Afks; clicks inventory and skill tabs to prevent logout.", logo = "https://i.imgur.com/d69IFDq.png"
)

public class StyxAfker extends Script {
        private String scriptName;
        private String scriptAuthor;
        private double scriptVersion;
        private long startTime;
        private long afkTimer;
        private int afkLimit;
    
        public void onStart() {    
            scriptName =  getName();        
            scriptAuthor = getAuthor();
            scriptVersion = getVersion();                    
            log("Welcome to " + scriptName + " v"+scriptVersion+"! Script author: "+scriptAuthor);    
            log("This script clicks between inventory and skill tabs in random intervals to prevent logout.");    
            startTime = System.currentTimeMillis();        
            afkTimer = System.currentTimeMillis();
            afkLimit = random(180000, 270000); //180000ms = 3min, 270000ms = 4,5min         
        }
        
        public enum State {
            WAIT, OPEN_TAB
        }
        
        private State getState() {                    
            if (System.currentTimeMillis() - afkTimer >= afkLimit){    
                afkTimer = System.currentTimeMillis();//reset afkTimer
                afkLimit = random(180000, 270000);//generate new afkLimit
                return State.OPEN_TAB;
            }                    
            return State.WAIT;    
        }
        
        public int onLoop() throws InterruptedException {        
            switch (getState()) {    
                case WAIT:
                    sleep(random(1000, 2000));
                    break;                    
                case OPEN_TAB:
                    openTab();
                    break;
            }        
            return random(300, 600);        
        }
        
        public void onPaint(Graphics2D  g) {
            g.setColor(new Color(0, 0, 0, 95));
            g.fillRect(4, 240, 140, 50);            
            g.setFont(g.getFont().deriveFont(14.0f));
                
            //script name and version
            g.setColor(Color.decode("#004d66"));
            g.drawString(scriptName+" v"+scriptVersion, 11, 261);
            g.setColor(Color.decode("#1ac6ff"));
            g.drawString(scriptName+" v"+scriptVersion, 10, 260);
                    
            //time ran
            final long runTime = System.currentTimeMillis() - startTime;
            g.setColor(Color.decode("#006600"));
            g.drawString("Time ran: "+formatTime(runTime), 11, 281);
            g.setColor(Color.decode("#00ff00"));
            g.drawString("Time ran: "+formatTime(runTime), 10, 280);
                    
            //script author
            g.setColor(Color.gray);
            g.setFont(g.getFont().deriveFont(10.0f));
            g.drawString("script by "+scriptAuthor, 690, 10);    
        }
        
        public final String formatTime(final long ms){
            long s = ms / 1000, m = s / 60, h = m / 60, d = h / 24;
            s %= 60; m %= 60; h %= 24;

            return d > 0 ? String.format("%02d:%02d:%02d:%02d", d, h, m, s) :
                   h > 0 ? String.format("%02d:%02d:%02d", h, m, s) :
                   String.format("%02d:%02d:%02d",h, m, s);
        }
                
        void openTab() {
            if (getTabs().getOpen().equals(Tab.INVENTORY)) {//if inventory is open, open skills 
                if(getTabs().open(Tab.SKILLS));            
            } else if (getTabs().getOpen().equals(Tab.SKILLS)){//if  skills is open, open inventory
                if(getTabs().open(Tab.INVENTORY));    
            } else {//if some other tab is open, open inventory
                if(getTabs().open(Tab.INVENTORY));    
            }
        }    
}

 

Credits:
Thanks to Apaec for the beginners guide on OSBot scripting: A Beginners Guide to Writing OSBot Scripts (where to get started!) by Apaec

Thanks to Explv for the paint tutorial: Explv's Dank Paint Tutorial

 

changelog:

Spoiler

v1.01 (2018-02-15):
-runtime paint now includes days if ran for over 24 hours

v1.0 (2018-02-11):
-released v1.0

 

edit history:
edit2: uploaded v1.01, new screenshot with 23h runtime, updated source , added changelog
edit1: fixed typo, uploaded a new screenshot with longer runtime

 

Edited by styxa

Tyvm, just registered for this! Do you mind if I copy the source and make a few tiny adjustments? I won't reupload it here or elsewhere or distribute it in any way. 

  • Author
6 hours ago, The Donald said:

Tyvm, just registered for this! Do you mind if I copy the source and make a few tiny adjustments? I won't reupload it here or elsewhere or distribute it in any way. 

No, I don't mind. I'm glad the source can be of some help! :)

nice gj mate looking forward to see more^^

  • 1 month later...

I wonder if afk'ing the G.E. limit off is safer than using a free 7qp script, since there really isn't much interaction here at all as opposed to the super repetitive interaction in the 7qp scripts. Thanks for sharing the source man, and for linking the tutorials you referenced.

Source code behind this is a bit messy, missing a few key stuff like

  • Player movement
  • Entity interactions
  • Chat input
  • Emote performing

Stuff like that make it more realistic, although Jagex won't look to ban someone to afk botting for whatever reason that may even be.

Good job on your efforts, hope your code gets cleaner as you go along.

Edited by Kid Lethal

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

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.