H&H Groovy bot

Forum for alternative clients, mods & discussions on the same.

Moderator: Phades

Vibe
Posts: 19
Joined: Fri Aug 05, 2011 8:33 pm

Re: H&H Groovy bot

Post by Vibe »

For me botting = cheat.
User avatar
MagicManICT
Posts: 18435
Joined: Tue Aug 17, 2010 1:47 am

Re: H&H Groovy bot

Post by MagicManICT »

Vibe wrote:For me botting = cheat.
Guess you probably shouldn't be playing games where botting isn't really penalized. You can really only call it cheating if there are rules against it. There are no rules against botting in HnH (mostly because J&L don't want to spend all their time trying to enforce them unsuccessfully).
Opinions expressed in this statement are the authors alone and in no way reflect on the game development values of the actual developers.
BruThoL
Posts: 392
Joined: Tue Feb 15, 2011 11:01 pm

Re: H&H Groovy bot

Post by BruThoL »

People is bot in this game.
Gathering logs, mining, making bricks, farming...
It's always the same thing. You can do it yourself, repeating again and again the same process.

You can train someone to do it. Maybe you'll teach a human how to farm. Maybe, if you have the required knowledge, you'll teach a bot how to farm.

Bots don't need to sleep, or to eat, also, they are never bored of doing things. So yes it's kind of unfair.
Bots are superior to human in many ways. But humans got the better point : intelligence.

In a game where most of tasks are repetitive and doesn't require the human superior intelligence, you can't blame people for letting dumb tasks be done by bots.

Of course it's cheating for you who doesn't know about coding.
But what if you were a developper?
User avatar
Fiyero
Posts: 32
Joined: Wed Jul 20, 2011 10:12 pm

Re: H&H Groovy bot

Post by Fiyero »

Thx Pan for such a wonderful tool.

In return, I will post some of the functions I have made so far, hope they are useful.

Code: Select all

void openContainer(String cName){
    if(cName.toLowerCase().equals("inventory")){openInventory();}
    else{
    int cID = findNearest(cName.toLowerCase());
    pathFinder.travelTo(cID);
    ark_bot.DoClick(cID, MOUSE_RIGHT_BUTTON, 0);
    }
    sleep(1200);
}

    void dropItem(){
    ark_bot.DoClick(ark_bot.MyCoord(), MOUSE_RIGHT_BUTTON, 0);
    thread.sleep(700);
    }

    void dropItem(Coord dropPlace){
    goStraightToCoord(dropPlace);
    ark_bot.DoClick(dropPlace, MOUSE_RIGHT_BUTTON, 0);
    thread.sleep(700);
    }

    int selectItem(String gob){
        int ID = 0;
        while(ID == 0){
          ID = ark_bot.input_get_object("Select the "+gob+" you want to use for this action")
          println 'selected id : ' + ID;
          if(ID==0){
             ark_bot.SlenPrint('It seems you misclicked...');
             thread.sleep(500);
          }
        }

        Gob selectedObj = ark_bot.glob.oc.getgob(ID);
        if(selectedObj.GetResName().indexOf(gob)<0){
            ark_bot.SlenPrint(selectedObj.GetResName()+" is not a "+gob+", try again: F3 stops this loop");
            sleep(1500);
            selectItem(gob);
        }
        return ID;
    }

    Coord selectDropCoord(){
        Coord point;
         ark_bot.SlenPrint("Select DropPoint");
           ark_bot.mapview.mode_select_object = true;

           while (ark_bot.mapview.mode_select_object) {
                 sleep(200);
           }
           point = ark_bot.mapview.mouse_tile;

        return point;
    }

//Equip/Unequip (only for slot#6, left hand)
    //From 0 to 15 (Left to right, top to bottom) i.e : hat, spectacles, shirt, armor, etc..
    //Remember to set ark_bot.current_equip_index=0; before calling this method.
    boolean next_eq_item(){
        ark_bot.current_item_mode=2;
        ark_bot.current_equip_index++;
        if(ark_bot.current_equip_index < 0 || ark_bot.current_equip_index > 15)return false;
        Item equippedItem = ark_bot.GetCurrentItem();
        if(equippedItem!=null)
            System.out.println("IDX="+ark_bot.current_equip_index+"->"+equippedItem.GetResName());
        else
            System.out.println("IDX="+ark_bot.current_equip_index+"->Nothing");
        return true;
   }

 boolean isEquipped(String itemN){
        ark_bot.current_equip_index=0;
        while(next_eq_item()){
           Item equipment = ark_bot.GetCurrentItem();
            if(equipment!= null && equipment.GetResName().indexOf(itemN)>=0){
                return true;
            }
        }
        return false;
    }

    void unequip(String itemN){
       System.out.println("Unequiping:"+itemN);
        ark_bot.current_equip_index=0;
        while(next_eq_item()){
            Item equippedItem = ark_bot.GetCurrentItem();
            if(equippedItem!=null && equippedItem.GetResName().indexOf(itemN)>=0){
            openInventory();
            ark_bot.equip(ark_bot.current_equip_index,"transfer");
            }
        }
    }

    void equip(String itemN){

        ark_bot.current_equip_index=6;
        ark_bot.current_item_mode=2;
        Item equippedItem = ark_bot.GetCurrentItem();
        System.out.println("Equipping:"+itemN);
        if(equippedItem!=null){
            System.out.println("Already equipped:"+equippedItem.GetResName());
            unequip(equippedItem.GetResName());
        }

        grabFromContainer(itemN,0,"Inventory");
        ark_bot.equip(6,"drop");
    }

List prepareInvList(String container){
     ark_bot.reset_inventory();
     //Open inventory window
     openContainer(container);
     ark_bot.set_inventory(getWindowName(container));

     TreeMap<Double,Item> sortedItems = new TreeMap<Double,Item>();
     for(Item listItem:ark_bot.inventory_list){
          sortedItems.put(new Double(Double.parseDouble(listItem.coord_y()+"."+listItem.coord_x())),listItem);
     }

     ArrayList<Item> sortedItemList = new ArrayList<Item>();
     for(Map.Entry<String,Item> entry : sortedItems.entrySet()){
         //System.out.println("C:"+entry.getKey()+" V:"+((Item)entry.getValue()).GetResName());
         sortedItemList.add(entry.getValue());
     }

     return sortedItemList;
    }

boolean grabFromContainer(String item,int index,String container){

     ark_bot.inventory_list=prepareInvList(container);

     def counter=0;

     while(ark_bot.next_item()){
          String itemResName = ark_bot.GetCurrentItem().GetResName();
          System.out.println(itemResName+" vs "+item+":"+index+"(Idx) vs (Cntr)"+counter);
          if (itemResName.toLowerCase().indexOf(item.toLowerCase())>=0){
             if(index==counter){
                 println('taking');
                 ark_bot.item_click("take", 0);
                 thread.sleep(100);
                 return true;
             }
              counter++;
          }
     }
     return false;
    }

//needs more filling--v

    String getWindowName(String cName){

        if("furniture/cclosed".indexOf(cName)>=0 || "furniture/copen".indexOf(cName)>=0 || "lchest".indexOf(cName)>=0){
            return "Chest";
        }
        if("Inventory".indexOf(cName)>=0){return "Inventory";}

    }

I apologize in advance if I missed publishing a function, I only put up some of the code I made.

Enjoy!
User avatar
MagicManICT
Posts: 18435
Joined: Tue Aug 17, 2010 1:47 am

Re: H&H Groovy bot

Post by MagicManICT »

BruThoL wrote: Of course it's cheating for you who doesn't know about coding.
But what if you were a developper?
Programming isn't hard. It just requires a person to do a thing that they've never actually done before in their life. Hell, I taught myself how to program at 10 (and that's when programming WAS hard). Now, you've got all of these tools that generate code automatically for you.
Opinions expressed in this statement are the authors alone and in no way reflect on the game development values of the actual developers.
Butko
Posts: 542
Joined: Tue Sep 07, 2010 10:05 am

Re: H&H Groovy bot

Post by Butko »

MagicManICT wrote:
BruThoL wrote: Of course it's cheating for you who doesn't know about coding.
But what if you were a developper?
Programming isn't hard. It just requires a person to do a thing that they've never actually done before in their life. Hell, I taught myself how to program at 10 (and that's when programming WAS hard). Now, you've got all of these tools that generate code automatically for you.
You still need to know what to do and how to use those tools. Looks like you never programmed anything hard.
User avatar
Hyrion
Posts: 92
Joined: Sun Jun 12, 2011 10:14 pm

Re: H&H Groovy bot

Post by Hyrion »

Please don't derail this post with a discussion of how "programming isnt hard" :P
Image
User avatar
Thijssnl
Posts: 2389
Joined: Fri Mar 12, 2010 9:09 pm

Re: H&H Groovy bot

Post by Thijssnl »

Hyrion wrote:Please don't derail this post with a discussion of how "programming isnt hard" :P
Talking about subject =/= derail
User avatar
SacreDoom
Posts: 2590
Joined: Tue Apr 06, 2010 3:14 pm

Re: H&H Groovy bot

Post by SacreDoom »

Thijssnl wrote:
Hyrion wrote:Please don't derail this post with a discussion of how "programming isnt hard" :P
Talking about subject =/= derail
Thijssnl wrote: Shh, underling :3

Sorry, I just couldn't resist. :)
User avatar
Thijssnl
Posts: 2389
Joined: Fri Mar 12, 2010 9:09 pm

Re: H&H Groovy bot

Post by Thijssnl »

SacreDoom wrote:
Thijssnl wrote:
Hyrion wrote:Please don't derail this post with a discussion of how "programming isnt hard" :P
Talking about subject =/= derail
Thijssnl wrote: Shh, underling :3

Sorry, I just couldn't resist. :)
Hurr?

Return to “The Wizards' Tower”