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.

States vs tasks?

Featured Replies

1 hour ago, liverare said:

Both have their pros and cons. You should look into trying all of them to understand them for yourself, where best they are applied and which you prefer to use.

Throughout my RS scripting life, I've gone through all the funky and wacky methods of doing stuff, but none of them have worked for me. What I've found works best for me is to just cut out all the bullshit:

spend_weekend.png

Don't program; just script.

Don't create dependencies; just duplicate them.

Can you provide some examples?

6 minutes ago, Nugaex said:

Can you provide some examples?

This is something scruffy, but the logic's structured and easy to read:

if (isAtBank()) {
	
	if (isInventoryFull()) {
		
		if (isBankOpen()) {
			
			depositLoot();
			
		} else {
			
			openBank();
		}
		
	} else if (isLowOnSupplies()) {
		
		if (isBankOpen()) {
			
			withdrawSupplies();
			
		} else {
			
			openBank();
		}
		
	} else {
		
		if (isBankOpen()) {
			
			closeBank();
			
		} else {
			
			walkToMonsters();
		}
	}
	
} else if (isAtMonsters()) {
	
	// etc.
	
}

 

What if I told you they are the same thing, just one is more of an object oriented approach and reflects better practice.

 

End result = State Machine

Edited by Tom

2 minutes ago, Tom said:

What if I told you they are the same thing, just one is more of an object oriented approach and reflects better practice.

 

End result = State Machine

True, but please don't ask for help with debugging a 10,000 line file. Thank you.

Just now, Eliot said:

True, but please don't ask for help with debugging a 10,000 line file. Thank you.

tfw all these people are bragging about there 30 line onLoops while I'm sitting here with a 4 liner

My first scripts were state based and then I discovered tasks.

 

As a noob who is shit at programming I find task based easier to troubleshoot, but really they are pretty much the same thing formatted differently.

 

Just my opinion, but I am bad at this so take it with a grain of salt.

 

 

11 minutes ago, Tom said:

tfw all these people are bragging about there 30 line onLoops while I'm sitting here with a 4 liner

Let me show you my Tut Island script and its 60+ classes, it would make you vomit!

  • Alek locked this topic
Guest
This topic is now closed to further replies.

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.