Jump to content

My first script/setup


duvetvem

Recommended Posts

Hello, im trying out my simple wcbot here, but sadly im stuck even getting it to run :(
I have 0 errors i my code, and there is 0 errors when compiling, after compiling i have my script in a .jar file and i copy it and paste it in the scripts folder of osbot folder.
Below is the screenshot of what i thought i needed for the script to work.
Could anyone please help me so i atleast can get it to run properly?

I copied the logs of osbot below aswell.
Thanks!

image.png.0a2de7077765edadce5b2640de6b89bb.png

[ERROR][06/30 06:23:18 PM]: Failed to load local script : org/osbot/Fg.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : org/osbot/GH.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : org/osbot/Mf.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : org/osbot/SF.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : org/osbot/th.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : org/osbot/zf.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/thoughtworks/xstream/converters/reflection/CGLIBEnhancedConverter$ReverseEngineeredCallbackFilter.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/AbstractCatchingFuture$AsyncCatchingFuture.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/AbstractCatchingFuture$CatchingFuture.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/AbstractCatchingFuture.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/AbstractFuture$TrustedFuture.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/AbstractFuture.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/AbstractTransformFuture$AsyncTransformFuture.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/AbstractTransformFuture$TransformFuture.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/AbstractTransformFuture.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/AggregateFuture.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/AggregateFutureState.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/CollectionFuture$ListFuture.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/CollectionFuture.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/CombinedFuture.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/FluentFuture$TrustedFuture.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/FluentFuture.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/ForwardingFluentFuture.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/Futures$InCompletionOrderFuture.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/Futures$NonCancellationPropagatingFuture.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/GwtFluentFutureCatchingSpecialization.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/ImmediateFuture$ImmediateCancelledFuture.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/ImmediateFuture$ImmediateFailedFuture.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/MoreExecutors$ScheduledListeningDecorator$NeverSuccessfulListenableFutureTask.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/SettableFuture.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/TimeoutFuture.class
[ERROR][06/30 06:23:18 PM]: Failed to load local script : com/google/common/util/concurrent/TrustedListenableFutureTask.class
[INFO][06/30 06:23:19 PM]: Script list refreshed and loaded 0 scripts.

Link to comment
Share on other sites

12 minutes ago, ExtraBotz said:

In your artifacts you can also setup your script to export directly to your scripts folder so you don't have to manually move it over each time.

In this instance it looks like your script failed to load into the script list. Have you used the script template? I would recommend posting your code as well.

Hello,

Thank you for replying! 

So i think i fixed the output you talked about?
Also the code below, tho it does not seem the code itself is producing the error, since i cant even find it in the osbot client, hence the error messages in the first post. Any ideas?
image.png.aa11e0e56609a90cb91b834e050ac3a8.png

 

import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.utility.ConditionalSleep;

import java.util.concurrent.ThreadLocalRandom;

public class Wcbot extends Script {

private static final String TREE_NAME = "Tree";
private static final int RANDOM_MIN = 500;
private static final int RANDOM_MAX = 800;

@Override
public int onLoop() {
if (!myPlayer().isAnimating()) {
chopTree();
}
return ThreadLocalRandom.current().nextInt(RANDOM_MIN, RANDOM_MAX);
}

private void chopTree() {
RS2Object tree = getObjects().closest(TREE_NAME);
if (tree != null) {
if (!tree.isVisible()) {
getCamera().toEntity(tree);
} else if (tree.interact("Chop down")) {
new ConditionalSleep(3000, 500) {
@Override
public boolean condition() {
return myPlayer().isAnimating();
}
}.sleep();
}
}
}

@Override
public void onStart() {
log("Starting Woodcutting Bot");
}

@Override
public void onExit() {
log("Stopping Woodcutting Bot");
}

public static void main(String[] args) {
Wcbot bot = new Wcbot();
bot.start();
}

private void start() {
}
}
Link to comment
Share on other sites

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