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.

Stupid coding errors I CANT fix!?

Featured Replies

I've spent ages writing my first script in java but for nearly all my methods I get these errors (example):

 

C:\Users\xxx\Documents\JCreator Pro\MyProjects\1main.java:107: error: illegal start of expression
public void deposit() //throws InterruptedException
       ^
C:\Users\xxx\Documents\JCreator Pro\MyProjects\1\main.java:107: error: ';' expected
public void deposit() //throws InterruptedException
 
 
the start of this method is what is causing the errors as well as the other methods in the class.
public void deposit() throws InterruptedException
{
    Entity bank1 = objects.closest("Bank booth");
    if (bank1 != null)
    {
        while(!this.bank.isOpen())
        {
        bank1.interact("Bank");
        sleep(random(100, 220));
        }    
        if (this.bank.isOpen())
        {
            this.bank.depositAllExcept(995);
            sleep(random(50, 160));    
            this.bank.withdrawAll(xxxx);
            sleep(random(50, 160));    
        }
    }
}

It just doesn't make any sense and I can't find the issue... 

 

Moreover, will this deposit method successfully deposit and withdraw? 

 

Any advice is highly appreciated thank you!

 

as stated by mysteryy

 

try
{
    this will execute, if there are any errors that would normally quit the application/script/whatever, it will go to the catch
}
catch(Exception ex)
{
   //this is what happens when try gave an error
}

Your method wont work that well, because you are never closing the bank.

Conditional sleeps work good with this ive noticed.

public void deposit() throws InterruptedException
{


        if(!bank.isOpen(){
        bank.open()
        new ConditionalSleep(3000) {
            @Override
	    public boolean condition() throws InterruptedException {
		return bank.isOpen();
	    }

        }.sleep();
         }
       bank.depositAllExcept("Coins");
       sleep(random(150,300));
       bank.close();

           
       
    }
}

Also, your class name is a bit weird

 

 

 

1main.java?

 

Rename is to main.java, youl have to rename the class inside the code as well from

public 1main to public main near the top.

 

I think this is just a convention, but you should still do it.

Edited by Mykindos

The error is not located in the provided code; most probably something above it

 

EDIT: throwing interruptedexception should not be the issue

Edited by FrostBug

  • Author

I've fixed it. turns out I had a missing } somewhere in my getcase method. Thanks for your help nonetheless.

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.