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.

Sending file to FTP server

Featured Replies

Hey guys :) so i'm in the process of creating an auto muler for private use yet could do with some help.

I've currently tried:

  • Starting another client by running a batch file from a script (Doesn't work as OsBot won't allow the execution of a batch file)
  • Sending a .txt file to a ftp which I will then read from, enabling my bots to communicate with each other.

 

I'm using an FTP from a minecraft server I used to run (So I may not have permission to change everything but can still add/delete files)

 

The problem is when I try to connect to the FTP to move a file I get this error

image.png.a22f5bbd982966a0e05d0b4da1efcdd5.png

 

I've added a grant to java.policy (Still no luck)

 

grant {
    permission java.net.SocketPermission "localhost:0", "listen,resolve";
};

My current code is

		if (progress == 0) {	
			log ("Attempting to call muleaaaa");
			String ftpUrl = "ftp://%s:%s@%s/%s;type=i";
			String host = "";
			String user = "";
			String pass = "";
			String filePath = "file:/C:/Users/admin/OSBot/data/test.txt"; 
			String uploadPath = "logs/test.txt";			
			ftpUrl = String.format(ftpUrl, user, pass, host, uploadPath);
			log("Upload URL: " + ftpUrl);

			try {
			    URL url = new URL(ftpUrl);
			    URLConnection conn = url.openConnection();
			    OutputStream outputStream = conn.getOutputStream();
			    FileInputStream inputStream = new FileInputStream(filePath);

			    byte[] buffer = new byte[5];
			    int bytesRead = -1;
			    while ((bytesRead = inputStream.read(buffer)) != -1) {
			        outputStream.write(buffer, 0, bytesRead);
			    }

			    inputStream.close();
			    outputStream.close();

			   log("File uploaded");
			} catch (IOException ex) {
			    ex.printStackTrace();
			    logger.error(ex);
			}

 

As you can probably tell i'm not the most experienced in networking.

 

Was just looking if anyone else has had this error (I've tried googling)

 

If this is due to OsBot is a webserver (I'd have to look into how to do that) the next best way to set up an auto mule script?

Thankyou!

 

Edited by archiebaker

It'd be a lot simpler and cleaner to use PHP and mySQL to communicate - OSBot is blocking the sockets you're trying to use.

  • Author

I'm a complete noob at both of them. So i'll have some learning to do!

Would I still be able to use the same FTP to host the database on?

On 25/09/2017 at 1:12 PM, archiebaker said:

I'm a complete noob at both of them. So i'll have some learning to do!

Would I still be able to use the same FTP to host the database on?

You probably won't be able to host a mySQL server on the FTP server. I agree with Night, a mySQL server is probably the best solution. You can get a basic web hosting package which will have a mySQL database and run php scripts for $2 a month at loads of places.

 

Alternatively, if you want to stick to your method with an FTP server, it might be a good idea to use a 3rd party ftp library such as apache commons http://commons.apache.org/proper/commons-net/

 

Another method I used to use was by reading a pastebin text file. I'd just get my script to check the paste every few minutes and if it contained a number and a username, it would go to that world in lummy and trade over all the supplies to the account with that username. I'd do all the trades then edit the paste to be blank again.

Edited by Diclonius

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.