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.

Whats better?

Featured Replies

Hello!

I'm looking into creating an FSM frame work for my scripts. I'm curious to see what the best way to do this is. So their are 2 options that I'm looking at:

Reflection by invoking methods. Passing the transition method name as a string which is in the main class.

Boolean supplier. Passing the transition boolean supplier method which is in the main class.

This is just a quick idea I've not full thought about this yet so it might be a little bit more complex.

 

Hey I love Finite State Machine. I have made one in my scheme project but for you i would recomend using koltin and do something like this.  You need some hacky code for loop backs on it self but I hope you can figure that out.





    val openbank : () -> () -> Any={
        getBank().open()
        if (getBank().isOpen){
            Closebank
        }else{
            quit
        }

    }
    val Closebank: () -> () -> Any ={
        getBank().close()

        if (!getBank().isOpen){
            openbank
        }else{
            quit
        }

    }

    var quit ={
        stop()
    }
    var c= openbank

    override fun onLoop(): Int {
        log("test")
        c= c.invoke() as () -> () -> Any


        return MethodProvider.random(1000,5000)
    }

or you can program in java with goto like code in a switch stament like 

 

  @Override
    public int onLoop() throws InterruptedException {
        switch (currentFuntion){
            case 0: stop(); break;
            case 1: open(); break;
            case 2: close(); break;
            
        }
        return 0;
    }
    
    public void open() throws InterruptedException {
        
        getBank().open();
        if (getBank().isOpen()){
            currentFuntion=2;
        }else {
            currentFuntion=0;
        }
    }
    public void close(){
        getBank().close();
        if (!getBank().isOpen()){
            currentFuntion=1;
        }else {
            currentFuntion=0;
        }
    }

I have other Ideas but there dumb

 

 

 

 

  • Author

Yeah nice!

I was thinking more on the lines of a modular FSM keeping almost every action in a separate state classes.

 

Looked at your project, Looks very impressive!

9 hours ago, NovaLight said:

!

For some reason Finite and Modular dont realy mix for me. (Kmaps chace super faster when remove and adding terms)

Ps (Just a a task system)

in class you can do this just follow the koltin example

public abstract class Activity{
    public abstract void doSomething();
    public abstract boolean isDone();
    public abstract Activity next()
}

 

 

 

 

Edited by Nbacon

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.