Jump to content

A Beginners Guide to Writing OSBot Scripts (where to get started!) by Apaec


Apaec

Recommended Posts

Did you export it like I showed, into the correct folder? Ensure its a Jar file, not a runnable jar file too. 

 

It needs to go in users/osbot/scripts, and ensure that there are no osbot1 local scripts in that folder as they cannot co-exist.

 

apaec

 

I did all of the such, ill paste my code into here, nd and I did make sure its not an executable as I heard that would cause problems.

I will also delete the contents of my script folder real quick, and retry the export and post the situtation that occurs with a picture.

 

package com.embah.PowerMiner;

import java.awt.Graphics2D;

import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

@ScriptManifest(author = "Boyyo11", info = "Simple powerminer", name = "PowerMiner", version = 0, logo = "boobs")
public class PowerMiner extends Script{
    private static final int rock_id = 14864;
    private static final int ore_id = 438;
    
    @Override
    public void onStart() {
        log("Starting Embah Powermine, please enjoy.");
    }

    @Override
    public int onLoop() throws InterruptedException {
        if(!myPlayer().isAnimating()){
            if(inventory.isFull()){
                inventory.dropAll(ore_id);
            }
            Entity rocks = objects.closest(rock_id);
            if(rocks != null){
                rocks.interact("Mine");
                sleep(random(25, 30));
            }
        }
        return random(200, 300);
    }

    @Override
    public void onExit() {
        log("Thanks for using Embah Powermine, have a great day.");
    }

    @Override
    public void onPaint(Graphics2D g) {
            
    }
}

 

Umm very weird, seems now after I redeleted, and recompiled and exported that it seemed to work once I downloaded the newest client and ran it, maybe I was just having a problem while it was up, it didnt want to refresh. Thank you so much, im sure ill be back for more little api help, hopefully sooner in the script release part of the forums.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Due to a (bug?) with the forums to do with following posts timing , sometimes I don't get a notification if you reply here. If I do not respond, feel free to PM me or like the original post - both of which will give me notifications.

 

Happy scripting!

 

thanks apaec! Through your enhanced skele i was able to make a working(pretty awful) powercutting script and i appreciate the work you put in to making this thread. I have lots more questions but i'm going to do what i can through searches on the forum before i come crawling back to you guys for assistance! (:

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

I might not need help by the time some one replies but I'm trying to learn myself a few things and so far this guide is awesome I understand like 80% I want to know what the different coloured text means. Like the yellow blue and green. 

Thanks.

edit: assuming you mean the way that the forum displays pasted code

Edited by Isolate
Link to comment
Share on other sites

Yea I noticed that after I posted. Why even take the time to point that out? how does that answer my question?

I was going to add something then realized i'd never even thought about why it colors it that way.

I did edit it from a question though, it would have mode more sense for me to leave original post

then edit in under it what i changed it to :D

Blue appears to be when it's anything callable.

Red/pink is the color of strings.

green appears to be initializing words.

and yellow seems to be @'s and numbers

Link to comment
Share on other sites

  • 3 weeks later...

Thank you dude.

Also if someone could explain this simply that would rule Y7WzV8h.png

 

Hi, sorry for the incredibly late reply lol, for some reason I got unfollowed from the thread so I didnt get a notification when you posted.

 

Anyway, that's importing. When you see those black symbols infront of the error when u hover over it, that just means you're trying to access something which isnt in your code unless you link it to your code, so you have to import it. For things which you got from the API (runescape things), its the osbot import (second one down).

 

Apaec

Link to comment
Share on other sites

Hi, sorry for the incredibly late reply lol, for some reason I got unfollowed from the thread so I didnt get a notification when you posted.

 

Anyway, that's importing. When you see those black symbols infront of the error when u hover over it, that just means you're trying to access something which isnt in your code unless you link it to your code, so you have to import it. For things which you got from the API (runescape things), its the osbot import (second one down).

 

Apaec

Why eclipse over IntelliJ?

Link to comment
Share on other sites

  • Alek unpinned this topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...