Jump to content

archiebaker

Members
  • Posts

    30
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by archiebaker

  1. 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!

     

  2. Hey guys!

    I've started learning scripting (Have made quite a few scripts of my own for personal use which work dynamically and pretty well)

     

    I was wondering from the more experienced scripters among the community, what are tips and tricks you learnt that made scripting more enjoyable, less time consuming, or just generally changed your way of doing something.

     

    Just thought I'd ask something about thought inspiring as well as having a thread new and aspiring scripters can look at for tips from more experienced scripters :)

     

     

    Thankyou guys for all your replies 

  3. Hey! Congrats man! It felt so rewarding when my first script finally started to run flawlessly. 

     

    Forgot to mention it above, but if you wanted to take a look at other people's .jars on here then it would be a good idea to download a Java decompiler. I've been using JD GUI and it's a piece of cake to use

     

     
     

    Thankyou :D

     

    JD-GUI is what is used with Eclipse right? If so, how does one work that? 

  4. I literally have no idea how to even withdraw, i've looked through some open source code on here but it just seems to parse an error whenever I stick it in my IDE

     

    EDIT: I think I understand how to withdraw now. 

    However i'm not quite sure how the timer works [More how to set it up]

     

    Or just conditional sleep as that seems easier to use. Yet i'm not sure how use that either xD

  5. osbot.org/forum/topic/58775-a-beginners-guide-to-writing-osbot-scripts-where-to-get-started-by-apaec/

     

    should hopefully cover the very basics! smile.png

     

    apa

    I literally went over this about 5-10 minutes after writing this post! The guide was really informative! Its more the fact I don't understand how to open banks reliably (Without spam clicking) etc which is more where I'm trying to learn stuff from. 

     

    I've been looking at the API and picked up a bit but some of it still confuses me because not that many of them have understandable examples D:

     

    Also any idea why this isn't working? I guess i forgot to define its class (Or whatever its called) at  the top of the project?

    post-55295-0-04523400-1452959844_thumb.png

    • Like 1
  6. If you have some programming experience you can download Core Java Volume 1, which is a nice introduction to java imo. Then just read some of the open source scripts and use the api docs and you should be fine.

    Sorry if this is naive but are local scripts and open source the same thing? Can i decompile them to get the 'raw' code?

  7. So its more the syntax, i've coded in various languages such as visual basic, pascal/delphi and others. I'm fairly familiar with programming concepts and study A2 computing.

     

    The real question is where to start coding java for bots? Ideally I just want to make a simple bot to say, enchant jeweley with a reliable-ish antiban. Sorry if I may need spoonfeeding at first but I figured its best to make my own stuff than always use everyone else's and maybe even give back to the community if i become experienced enough

×
×
  • Create New...