Jump to content

been here for a few weeks.


chrismac1991

Recommended Posts

annnd so here i am , hey everyone!

im really new to scripting but im looking through all the tutorials and stuff now and yeah

im confused as all hell but im trying my best!

if anybody wants to talk on skype and learn with me or teach me or anything similiar let me know!

will post a script if i ever manage to get one working!

Edited by chrismac1991
Link to comment
Share on other sites

annnd so here i am , hey everyone!

im really new to scripting but im looking through all the tutorials and stuff now and yeah

im confused as all hell but im trying my best!

if anybody wants to talk on skype and learn with me or teach me or anything similiar let me know!

will post a script if i ever manage to get one working!

 

hello,

 

Glad to see people who are trying to learn how to script :)

Goodluck

 

Khal

Link to comment
Share on other sites

haha yeah thanks, i was using the beginner tutorial for a tea thiever and tried to convert it into a woodcutting starter.
i dont think i did to well because, although it mostly worked, it kept spam clicking and i am now way to tired to try and fix it at 4 am lol
im sure its something simple. anyway here is what ive completed, im gonna get back at it all tomorrow and look at more tutorial stuff.

will check back when i wake up smile.png

ps. sorry for not knowing how to shorten this post with the "spoiler" tag thingy

 

 

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

import java.awt.*;

@ScriptManifest(author = "Chris", info = "Chops and Drops Trees Lumbridge", name = "Level3TreeKiller", version = 0.1, logo = "")
public class FuckYouTrees extends Script {

    @Override
    public void onStart() {
        log("Kill All The Trees!");
        }

    private enum State {
        CHOPPING_LOGS, DROPPING_LOGS, SEARCH_FOR_TREE
    };

    private State getState() {
        Entity tree = objects.closest("Tree");
        if (!inventory.isEmpty())
            return State.DROPPING_LOGS;

        if (tree != null)
            return State.CHOPPING_LOGS;  // all good as far i know

        else
            return State.SEARCH_FOR_TREE;
    }

    @Override
    public int onLoop() throws InterruptedException {
        switch (getState()) {
        case DROPPING_LOGS:
            log("Dropping Shit");
            inventory.dropAll();
            break; // drops first,and immediately after acquiring logs
                    // and i want it to collect a full backpack and drop all upon
                    // full inventory.(gives trees more than enough
        case CHOPPING_LOGS: // time to reset
            log("Work Work");
            Entity tree = objects.closest("Tree");
            if (tree != null) {
                if (!myPlayer().isAnimating()) // /constantly spam clicks and im confused and tired sad.png
                    if (tree.isVisible()) {
                        {
                        }
                        tree.interact("Chop Down");

                        break;

                    }
            }
        case SEARCH_FOR_TREE: // Switches to case temporarily but does nothing
                                // but spam click.
            log("Looking for a new tree");
            Entity newtree = objects.closest("Tree");
            if (newtree != null)
                camera.toEntity(newtree);
            newtree.interact("Chop Down");
            break;
        }
        return random(200, 300);
    }

    @Override
    public void onExit() {
        log("Done Already?");
    }

    @Override
    public void onPaint(Graphics2D g) {

    }

}


 

 

Edited by chrismac1991
Link to comment
Share on other sites

  • 2 weeks later...
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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