Jump to content

First Script - Hunter


Anuzolo

Recommended Posts

Hey guys, just thought I'd make a post in here to see what you guys have to offer for me. I'm going to be making a low level hunting script to catch birds like the Chrimson Swift etc. 

 

My intention is to make the script as text based as possible, rather then using ID's, so it wouldn't need much updating.

 

Basically my thoughts on where to start would be to setup a hunting "zone" class, so that I can add different variables at a later date when I move onto higher leveled Hunting. I know that this is co-ord based, but how would I go about making a radius around where the player starts, as to limit how far he can travel or where he will lay the traps?

 

My next step would be to actually lay the traps and find a way to code in detection for when the trap fails.

 

Then obviously, support for when the trap has successfully caught something. 

 

Lastly dropping the unnecessary or unwanted items, maybe adding optional bone burying too.

 

In my head, I've listed 4 different Superclasses, 2 of which will need subclasses.

 

To kick things off, can anyone point me in the right direction? :)

Link to comment
Share on other sites

What you would need to do is define a new Area:

final Area huntArea = new Area(bottom xy, top xy);

if(player.isInArea){
//lay trap etc
} else {
walk(huntArea.getRandomPoisiton(0).walkHere(this.bot);
}

This is a very simple implementation so look into your own way of doing it, Goodluck with this and i look forward to the competition ^_^

Link to comment
Share on other sites

Hey guys, just thought I'd make a post in here to see what you guys have to offer for me. I'm going to be making a low level hunting script to catch birds like the Chrimson Swift etc. 

 

My intention is to make the script as text based as possible, rather then using ID's, so it wouldn't need much updating.

 

Basically my thoughts on where to start would be to setup a hunting "zone" class, so that I can add different variables at a later date when I move onto higher leveled Hunting. I know that this is co-ord based, but how would I go about making a radius around where the player starts, as to limit how far he can travel or where he will lay the traps?

 

My next step would be to actually lay the traps and find a way to code in detection for when the trap fails.

 

Then obviously, support for when the trap has successfully caught something. 

 

Lastly dropping the unnecessary or unwanted items, maybe adding optional bone burying too.

 

In my head, I've listed 4 different Superclasses, 2 of which will need subclasses.

 

To kick things off, can anyone point me in the right direction? smile.png

Looking forward to your script mate! =)

Will it support multiple traps? :-)

Link to comment
Share on other sites

I can't help much but  think this should work... Go into your client settings, and turn on Object Info. This will tell you that your set trap is an object (so closestObjectForName, since you want text handled) and if the trap fails, you'll see that it's also an object. I noticed that while 'laying' the trap, the trap is an item until fully set, so a failed trap might be the same thing, but that's something you'll find out.

 

For dropping unwanted items, create an array with the items you want to drop (ints or names) and after you collect a trap, or whenever, cycle through this array. If an item is in the array, then:

String dropMe = itemsToDrop[i];
client.getInventory().interactWithName(dropMe, "Drop");
sleep(random(500, 1000);

Hope this helps! Would love to see a low level hunter script that supports multiple traps

Edited by thelegacy0
Link to comment
Share on other sites

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

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