Jump to content

Scripts Wont shop up?


hero3128

Recommended Posts

Show up****

 

The local script i made will correctly show up on my desktop osbot. But when i try to transfer it to my laptop OSBot. It will not work. They dont show up. Any help?

 

Script is in spoiler.

package net.hero3128;


import org.osbot.rs07.api.ui.Tab;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;


import java.awt.*;
import java.util.concurrent.TimeUnit;


@ScriptManifest(name = "hAFK", author = "Hero3128", version = 1.0, info = "AFK's 24 hours", logo = "")
public final class hAFK extends Script {

    private long timeBegan;
    private long timeRan;
    private long newStartTime = 0;// new start time
    private long newSleepTime = 0;// Time till next
    private long timeTillNext = 0;

    public int ACTIONS = 0;
    private static Tab[] Tabs = {Tab.ATTACK, Tab.INVENTORY, Tab.CLANCHAT, Tab.EMOTES, Tab.EQUIPMENT,
            Tab.FRIENDS, Tab.IGNORES, Tab.LOGOUT, Tab.MAGIC, Tab.MUSIC,
            Tab.PRAYER, Tab.QUEST, Tab.SETTINGS, Tab.SKILLS};


    private State state = State.Idle;

    @Override
    public void onStart() {
        timeBegan = System.currentTimeMillis();
        newSleepTime = random(60000, 180000);
        log("hAFK Started");
    }

    @Override
    public void onExit() {
        log("hAFK has stopped!");

    }


    @Override
    public int onLoop() throws InterruptedException {
        switch (state = whatDo()) {
            case Idle:
                return 100;
            case Action:
                if (tabs.open(Tabs[random(Tabs.length)])) {
                    ACTIONS++;
                    newStartTime = System.currentTimeMillis();
                    newSleepTime = random(60000, 180000);
                    return 100;
                } else return 100;


        }
        return 100;
    }

    private State whatDo() {
        if (System.currentTimeMillis() - newStartTime > newSleepTime) return State.Action;


        return State.Idle;
    }

    @Override
    public void onPaint(Graphics2D g) {
        //START: Code generated using Enfilade's Easel
        timeRan = System.currentTimeMillis() - timeBegan;
        timeTillNext = newSleepTime - (System.currentTimeMillis() - newStartTime);

        final Color color1 = new Color(153, 153, 153);
        final Color color2 = new Color(0, 0, 0);
        final Color color3 = new Color(255, 255, 255);

        final BasicStroke stroke1 = new BasicStroke(1);

        final Font font1 = new Font("Comic Sans MS", 1, 10);


        //Graphics2D g = (Graphics2D)g1;
        g.setColor(color1);
        g.fillRect(282, 4, 236, 115);
        g.setColor(color2);
        g.setStroke(stroke1);
        g.drawRect(282, 4, 236, 115);
        g.setFont(font1);
        g.setColor(color3);
        g.drawString("Time Running: " + ft(timeRan), 288, 20);
        g.drawString("State: " + state, 288, 40);
        g.drawString("Actions Done: " + ACTIONS, 288, 60);
        g.drawString("Time Till Next Action: " + ft(timeTillNext), 288, 80);
        g.drawString("hAFK By Hero3128", 412, 116);


        //END: Code generated using Enfilade's Easel
    }


    private enum State {
        Idle("Idling..."),
        Action("Changing Action");

        State(String name) {
            this.name = name;
        }

        private final String name;

        @Override
        public String toString() {
            return name;

        }
    }


    private String ft(long duration) {
        String res = "";
        long days = TimeUnit.MILLISECONDS.toDays(duration);
        long hours = TimeUnit.MILLISECONDS.toHours(duration)
                - TimeUnit.DAYS.toHours(TimeUnit.MILLISECONDS.toDays(duration));
        long minutes = TimeUnit.MILLISECONDS.toMinutes(duration)
                - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS
                .toHours(duration));
        long seconds = TimeUnit.MILLISECONDS.toSeconds(duration)
                - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS
                .toMinutes(duration));
        if (days == 0) {
            res = (hours + ":" + minutes + ":" + seconds);
        } else {
            res = (days + ":" + hours + ":" + minutes + ":" + seconds);
        }
        return res;
    }
}
 
Edited by hero3128
Link to comment
Share on other sites

He means, did you seperately download them on your laptop and placed them in your script folder (extra on your laptop) ?

Yes, i put them on my flashdrive and threw them into OSbot/scripts

 

I tried it with the class files and building a .jar both of which work on my desktop, but my laptop they dont show up to run

Edited by hero3128
Link to comment
Share on other sites

Yes, i put them on my flashdrive and threw them into OSbot/scripts

 

I tried it with the class files and building a .jar

 

Try to just download the local .jar again on your laptop, add them to the script folder start osbot, click refresh and let me know if they appear.

 

Maybe something went wrong by transfering via flashdrive. Just try to download them ok?

Link to comment
Share on other sites

Try to just download the local .jar again on your laptop, add them to the script folder start osbot, click refresh and let me know if they appear.

 

Maybe something went wrong by transfering via flashdrive. Just try to download them ok?

uploaded it via dropbox and downloaded it. Still nothing. Then OsBot updated to the 2.3.53. Still nothing.

here ill post the script. I highly doubt anythings wrong with it though

package net.hero3128;


import org.osbot.rs07.api.ui.Tab;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;


import java.awt.*;
import java.util.concurrent.TimeUnit;


@ScriptManifest(name = "hAFK", author = "Hero3128", version = 1.0, info = "AFK's 24 hours", logo = "")
public final class hAFK extends Script {

    private long timeBegan;
    private long timeRan;
    private long newStartTime = 0;// new start time
    private long newSleepTime = 0;// Time till next
    private long timeTillNext = 0;

    public int ACTIONS = 0;
    private static Tab[] Tabs = {Tab.ATTACK, Tab.INVENTORY, Tab.CLANCHAT, Tab.EMOTES, Tab.EQUIPMENT,
            Tab.FRIENDS, Tab.IGNORES, Tab.LOGOUT, Tab.MAGIC, Tab.MUSIC,
            Tab.PRAYER, Tab.QUEST, Tab.SETTINGS, Tab.SKILLS};


    private State state = State.Idle;

    @Override
    public void onStart() {
        timeBegan = System.currentTimeMillis();
        newSleepTime = random(60000, 180000);
        log("hAFK Started");
    }

    @Override
    public void onExit() {
        log("hAFK has stopped!");

    }


    @Override
    public int onLoop() throws InterruptedException {
        switch (state = whatDo()) {
            case Idle:
                return 100;
            case Action:
                if (tabs.open(Tabs[random(Tabs.length)])) {
                    ACTIONS++;
                    newStartTime = System.currentTimeMillis();
                    newSleepTime = random(60000, 180000);
                    return 100;
                } else return 100;


        }
        return 100;
    }

    private State whatDo() {
        if (System.currentTimeMillis() - newStartTime > newSleepTime) return State.Action;


        return State.Idle;
    }

    @Override
    public void onPaint(Graphics2D g) {
        //START: Code generated using Enfilade's Easel
        timeRan = System.currentTimeMillis() - timeBegan;
        timeTillNext = newSleepTime - (System.currentTimeMillis() - newStartTime);

        final Color color1 = new Color(153, 153, 153);
        final Color color2 = new Color(0, 0, 0);
        final Color color3 = new Color(255, 255, 255);

        final BasicStroke stroke1 = new BasicStroke(1);

        final Font font1 = new Font("Comic Sans MS", 1, 10);


        //Graphics2D g = (Graphics2D)g1;
        g.setColor(color1);
        g.fillRect(282, 4, 236, 115);
        g.setColor(color2);
        g.setStroke(stroke1);
        g.drawRect(282, 4, 236, 115);
        g.setFont(font1);
        g.setColor(color3);
        g.drawString("Time Running: " + ft(timeRan), 288, 20);
        g.drawString("State: " + state, 288, 40);
        g.drawString("Actions Done: " + ACTIONS, 288, 60);
        g.drawString("Time Till Next Action: " + ft(timeTillNext), 288, 80);
        g.drawString("hAFK By Hero3128", 412, 116);


        //END: Code generated using Enfilade's Easel
    }


    private enum State {
        Idle("Idling..."),
        Action("Changing Action");

        State(String name) {
            this.name = name;
        }

        private final String name;

        @Override
        public String toString() {
            return name;

        }
    }


    private String ft(long duration) {
        String res = "";
        long days = TimeUnit.MILLISECONDS.toDays(duration);
        long hours = TimeUnit.MILLISECONDS.toHours(duration)
                - TimeUnit.DAYS.toHours(TimeUnit.MILLISECONDS.toDays(duration));
        long minutes = TimeUnit.MILLISECONDS.toMinutes(duration)
                - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS
                .toHours(duration));
        long seconds = TimeUnit.MILLISECONDS.toSeconds(duration)
                - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS
                .toMinutes(duration));
        if (days == 0) {
            res = (hours + ":" + minutes + ":" + seconds);
        } else {
            res = (days + ":" + hours + ":" + minutes + ":" + seconds);
        }
        return res;
    }
}

Edited by hero3128
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...