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.

Diclonius Path Walking

Featured Replies

  • Author
int a = 10, b = 6;if(a > b) {	for(int i = b; i <= a; i++) {		}} else {	for(int i = a; i <= b; i++) {		}}=int a = 10, b = 6;for(int i = Math.min(a, b); i <= Math.max(a, b); i++) {}

But then the positions could be backwards. I need fullPath to be in order. I'm not just looping through all the tiles, I'm looping from pos1 to pos2

Edited by Diclonius

using u++ but u = u-1 seriously? (u--)

Useful class btw.:)

Edited by codingstyle

  • Author

using u++ but u = u-1 seriously? (u--)

Useful class btw.smile.png

I wasn't 100% sure so I just played it safe :P

 

Also it has some trouble getting to the ends of the path, I don't know why :/.

I know that this will sound a bit fussy, but you really have to work on your java naming conventions. This will improve the readability and quality of your code so much in the long term!
things i recognised:

Objects = lowercase (Script s)

use the final keyword (final Script s, final boolean direction, ....)

Things i don't understand:
 

if(direction) {
			for(int u = 0; u < fullPath.size(); u++) {
				Position p = fullPath.get(u);
				if(S.distance(p) < 11) {
					int xOffSet = MethodProvider.random(3)-1;
					int yOffSet = MethodProvider.random(3)-1;
					return new Position(p.getX()+ xOffSet,p.getY()+yOffSet,S.myZ());
				}
			}
		} else {
			for(int u = fullPath.size()-1; u > 0; u=u-1) {
				Position p = fullPath.get(u);
				if(S.distance(p) < 10) {
					int xOffSet = MethodProvider.random(5)-2;
					int yOffSet = MethodProvider.random(5)-2;
					return new Position(p.getX()+ xOffSet,p.getY()+yOffSet,S.myZ());
				}
			}
		}

why do you have different offset based on the direction your walking?
why do you have different conditions? (S.distance(p) < 10 ...... S.distance(p) < 11)
please rework the things i told you and post again tongue.png

Edit: make Script private and rethink private/public on your methods...

Edited by codingstyle

  • Author

I know that this will sound a bit fussy, but you really have to work on your java naming conventions. This will improve the readability and quality of your code so much in the long term!

things i recognised:

Objects = lowercase (Script s)

use the final keyword (final Script s, final boolean direction, ....)

Things i don't understand:

if(direction) {			for(int u = 0; u < fullPath.size(); u++) {				Position p = fullPath.get(u);				if(S.distance(p) < 11) {					int xOffSet = MethodProvider.random(3)-1;					int yOffSet = MethodProvider.random(3)-1;					return new Position(p.getX()+ xOffSet,p.getY()+yOffSet,S.myZ());				}			}		} else {			for(int u = fullPath.size()-1; u > 0; u=u-1) {				Position p = fullPath.get(u);				if(S.distance(p) < 10) {					int xOffSet = MethodProvider.random(5)-2;					int yOffSet = MethodProvider.random(5)-2;					return new Position(p.getX()+ xOffSet,p.getY()+yOffSet,S.myZ());				}			}		}
why do you have different offset based on the direction your walking?

why do you have different conditions? (S.distance(p) < 10 ...... S.distance(p) < 11)

please rework the things i told you and post again tongue.png

Edit: make Script private and rethink private/public on your methods...

The different offsets and the 10 and 11 are just mistakes when copy and pasting between versions :P. I know my java conventions are poor, I was never tought java. I learnt it through videos and e-books so I haven't had the chance for people to point the mistakes I make so I really appreciate you doing so. Next year I plan to study computer science at uni so then I will hopefully learn these things.

Edited by Diclonius

The different offsets and the 10 and 11 are just mistakes when copy and pasting between versions tongue.png. I know my java conventions are poor, I was never tought java. I learnt it through videos and e-books so I haven't had the chance for people to point the mistakes I make so I really appreciate you doing so. Next year I plan to study computer science at uni so then I will hopefully learn these things.

http://docs.oracle.com/javase/tutorial/java/ even if you know most of the stuff there read it all again, because you may have some bad habits, which you didn't know of biggrin.png Also you will leran java naming conventions wink.png

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.