Groovy Maid is a scripting engine for H&H based on groovy, it puts at your disposal methods to automate certain tasks.
This is a complete rewrite of Groovy Bot client in a sane and easy to understand interface. It consists in an object, the maid, that tries to do everything for you. It acts as an addon to any client.
= Features =
- Runs over any client that respects the original client interfaces.
- Simple interface.
- Event based. More accurate than pinging every x seconds for a variable.
= Todo =
- Finish multi.session support. Right now for some reason switching between accounts and returning has a black window in most cases, it's a refresh issue.
- Allow access to global positioning. Right now only relative positioning is available. Global x,y keep changing, I need a way around that.
- Some methods available in Arksu's are missing due to ugly.
- Some methods available in Groovy Bot are missing due to lazy.
- Console commands.
- Comment the code!
= Download =
Binary: http://hnh-groovy-maid.googlecode.com/files/maid.jar
Dependencies: http://hnh-groovy-maid.googlecode.com/f ... encies.zip
Source: http://code.google.com/p/hnh-groovy-maid/source
= Instalation =
Groovy Maid runs over any client. Unpack the dependencies and place maid.jar where haven.jar can be found. Run maid.jar instead of haven.jar in your command:
java -Xms256m -Xmx512m -jar build/maid.jar moltke.seatribe.se
Depends on the following files:
= Usage =
- Pressing SHIFT + F1 runs the file "scripts/f1.groovy" You can have up to "scripts/f12.groovy".
- Pressing SHIFT + ESC cancels the running script.
- Using console you can invoke a certain filename :bot test will run "scripts/test.groovy" (TODO)
There is a multi-session support in beta, I do not recommend using it. WARNING BUGGY
- New session: ALT + INSERT.
- Destroying session: ALT + DELETE.
- Switching sessions back or forward: ALT + PGUP; ALT + PGDOWN.
- Switching sessions to the start or the end: ALT + HOME; ALT + END.
= ChangeLog =
2012-01-17 - Public release.
H&H Groovy Maid
Moderator: Phades
-
Momoka
- Posts: 46
- Joined: Sun Jul 17, 2011 6:21 am
H&H Groovy Maid
Last edited by Momoka on Wed Jan 18, 2012 12:38 am, edited 2 times in total.
-
Momoka
- Posts: 46
- Joined: Sun Jul 17, 2011 6:21 am
Re: H6H Groovy Maid
= Reference =
For now please refer to Maid.java to know what to do.
I will publish the apidoc next.
= Examples =
This is a very basic planting script. Don't forget to previously autosort your seeds, drop those you don't want! We could check the quality here, you are free to do anything. "scripts/f1.groovy" Press SHIFT + F1 to run. SHIFT + ESC to stop.
I will add more...
For now please refer to Maid.java to know what to do.
I will publish the apidoc next.
= Examples =
This is a very basic planting script. Don't forget to previously autosort your seeds, drop those you don't want! We could check the quality here, you are free to do anything. "scripts/f1.groovy" Press SHIFT + F1 to run. SHIFT + ESC to stop.
Code: Select all
import haven.Item;
import haven.Coord;
// How many tiles until next row.
int x = 5;
// Should we flip the x/y axis?
boolean flip = true;
def items;
// Inventory has to be open.
// get all the widgets in screen that belong to the Item class.
items = maid.getWidgets(Item.class);
// Let's check every item.
for (def i in items) {
// what's the item's name?
def n = maid.getName(i);
// If it is a Seedbag, open it!
if ("Seedbag".equals(n)) {
maid.doInteract(i);
}
}
// Let's ask the user what kind of seed wants to plant.
// Select a seed and plant it where you want to begin
def type = maid.waitForRelease();
// Where do we stand?
Coord ref = maid.getCoord();
// Oh, we got a seed, let's check the name.
def name = maid.getName(type);
// Going to retrieve all the items again because we opened those bags.
items = maid.getWidgets(Item.class);
// Let's go through every item and see if it matches our seed type.
int count = 1;
for (def i = 0; i < items.size(); i++) {
def item = items[i];
// Is the name equal? Plant it then!
def n = maid.getName(item);
if (name.equals(n)) {
// pick the item
maid.doTake(item);
// Wait so we get a server response.
maid.waitForGrab();
// Get to the planting! Relative to the first placement it is. So we get the ofsets.
// Something square, we limit ourselves to x number of tiles before we jump to the next.
int offsetx = maid.toTile(count % x);
int offsety = maid.toTile((int) (count / x));
if (flip) {
maid.doInteract(ref.add(offsety, offsetx), 0);
} else {
maid.doInteract(ref.add(offsetx, offsety), 0);
}
// Wait for server response, always important.
maid.waitForRelease();
count++;
}
}
Last edited by Momoka on Wed Jan 18, 2012 12:31 am, edited 3 times in total.
-
Momoka
- Posts: 46
- Joined: Sun Jul 17, 2011 6:21 am
Re: H6H Groovy Maid
Being a wizard in H&H is fun too! Don't let those warriors, hunters or farmers tell you how to play the game. Wizardy is a game feature itself too. You can always multiclass too.
Discussion goes here: viewtopic.php?t=24768
The output console is quite noisy right now, it helps you write scripts so it is useful to watch. I should make it optional.
This thread is for help, support and suggestions. You can always give me a hand in the documentation... pretty please?
Discussion goes here: viewtopic.php?t=24768
The output console is quite noisy right now, it helps you write scripts so it is useful to watch. I should make it optional.
This thread is for help, support and suggestions. You can always give me a hand in the documentation... pretty please?
-
Jester87
- Posts: 195
- Joined: Mon Dec 12, 2011 8:19 am
- Location: Hell
Re: H&H Groovy Maid
Why not just work in my thread?
w6: Diet Pepsi (RIP), Mountain Dew (RIP), Peppermint Bark
Bot Tutorial for Noobs - viewtopic.php?f=27&t=24881&p=307831#p307831
Mvpeh Song - viewtopic.php?f=7&t=24872
Parchir Song -viewtopic.php?f=7&t=24587
Bot Tutorial for Noobs - viewtopic.php?f=27&t=24881&p=307831#p307831
Mvpeh Song - viewtopic.php?f=7&t=24872
Parchir Song -viewtopic.php?f=7&t=24587
-
Momoka
- Posts: 46
- Joined: Sun Jul 17, 2011 6:21 am
Re: H&H Groovy Maid
It doens't use the same interface.
Scripts written there, won't work here. Same with the opposite.
Scripts written there, won't work here. Same with the opposite.
-
Jester87
- Posts: 195
- Joined: Mon Dec 12, 2011 8:19 am
- Location: Hell
Re: H&H Groovy Maid
I know, but it seems like you are reinventing the wheel. Is this bot going to offer something that the one in my thread wont?Momoka wrote:It doens't use the same interface.
Scripts written there, won't work here. Same with the opposite.
w6: Diet Pepsi (RIP), Mountain Dew (RIP), Peppermint Bark
Bot Tutorial for Noobs - viewtopic.php?f=27&t=24881&p=307831#p307831
Mvpeh Song - viewtopic.php?f=7&t=24872
Parchir Song -viewtopic.php?f=7&t=24587
Bot Tutorial for Noobs - viewtopic.php?f=27&t=24881&p=307831#p307831
Mvpeh Song - viewtopic.php?f=7&t=24872
Parchir Song -viewtopic.php?f=7&t=24587
-
sabinati
- Posts: 15527
- Joined: Mon Jul 13, 2009 4:25 am
- Location: View active topics
Re: H&H Groovy Maid
it's a scripting engine that runs over any client
-
Jester87
- Posts: 195
- Joined: Mon Dec 12, 2011 8:19 am
- Location: Hell
Re: H&H Groovy Maid
I guess thats somewhat useful. Although, the ark.su client works just fine imho.sabinati wrote:it's a scripting engine that runs over any client
w6: Diet Pepsi (RIP), Mountain Dew (RIP), Peppermint Bark
Bot Tutorial for Noobs - viewtopic.php?f=27&t=24881&p=307831#p307831
Mvpeh Song - viewtopic.php?f=7&t=24872
Parchir Song -viewtopic.php?f=7&t=24587
Bot Tutorial for Noobs - viewtopic.php?f=27&t=24881&p=307831#p307831
Mvpeh Song - viewtopic.php?f=7&t=24872
Parchir Song -viewtopic.php?f=7&t=24587
-
Momoka
- Posts: 46
- Joined: Sun Jul 17, 2011 6:21 am
Re: H&H Groovy Maid
It works. It's also an awful mess of methods and ugly hacks. That's why I am making this one. Though I can only work in it on weekends.Jester87 wrote:I guess thats somewhat useful. Although, the ark.su client works just fine imho.sabinati wrote:it's a scripting engine that runs over any client
-
krikke93
- Posts: 3313
- Joined: Tue Nov 02, 2010 7:23 pm
- Location: Belgium