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.

Connecting to database issue

Featured Replies

Ive been following the instructions here but been facing issues.

When i make the bat file as instructed like this

"C:\Program Files\Java\jre1.8.0_172\bin\java.exe" -cp "lib/*" org.osbot.Boot -debug

i get an error "Could not find or load main class org.osbot.Boot"

I can get the client open the usual way i do with adding ....bin \javaw.exe" -jar "OSbot 2.5.8.jar"  but idk if the problem is this or what ?

When i have the client open and logged in i run the script i copied and only  changed the db/locations i had to for getting into correct path in the sql. After running the script nothing happens and the client just kind of freezes. Anyone kind enough to help me out? Ive been struggling with this database setup shit for days now 😕

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.*;

import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

@ScriptManifest(author = "", info = "", logo = "", name = "SQL Test", version = 0)
public class Sqltest extends Script {

    @Override
    public void onStart() throws InterruptedException {
        
        try {
            
            String host = "localhost:3306";
            String db   = "mule";
            String user = "root";
            String pass = "";
            
            String connStr = String.format("jdbc:mysql://%s/%s?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC", host, db);
            
            Connection conn = DriverManager.getConnection(connStr, user, pass);
            
            ResultSet results = conn.createStatement().executeQuery("SELECT `name` FROM `mule`;");

            while (results.next()) {
                
                logger.debug(results.getString("name"));
            }
            
        } catch (SQLException e) {
            logger.error(e);
        }
        
    }

    @Override
    public int onLoop() throws InterruptedException {
        return 50;
    }
}

 

52 minutes ago, Zunarb said:

i get an error "Could not find or load main class org.osbot.Boot"

why don't you just launch osbot with 

java -jar osbot.jar

 

  • Author

I get this error in the debug mode when i run the sql test script. Can anyone tell me whats causing the issue ?

sqltest.PNG

50 minutes ago, Protoprize said:

why don't you just launch osbot with 


java -jar osbot.jar

 

I managed to launch the bat file now but posted the error photo here after launching the script so now have to figure that out 😅😅

8 minutes ago, Zunarb said:

I get this error in the debug mode when i run the sql test script. Can anyone tell me whats causing the issue ?

sqltest.PNG

I managed to launch the bat file now but posted the error photo here after launching the script so now have to figure that out 😅😅

You put the main code into a package but didn't declare the package I think. Try moving the file to the src folder of your project

  • Author
21 minutes ago, Protoprize said:

You put the main code into a package but didn't declare the package I think. Try moving the file to the src folder of your project

oh shit yeah i had accidentally deleted it without notice! Thank you :) Now just one more problem i gotta solve. When i play the script now i get the error:

 java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/mule?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC

Appearently it is cause its not accessing the mysql-connector-java-8.0.20 but how do i change that ? I have it in the same folder with the bat file and osbot.jar also i have it in the reference library of the sqltest.jar but seems like its still not accessing any of them?

I don't think osbot allows you to do that? If it's in your class path and doesn't work, then it won't work at all unless you're running an external program 

  • Author

If it doesnt work this way anymore this way how do people manage to connect themselves to database? Im running xampp as instructed and via that trying to access the sql.

 

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.