Jester87's Bot Tutorial For Newbies

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

Moderator: Phades

Re: Jester87's Bot Tutorial For Newbies

Postby Pascal666 » Sun Mar 04, 2012 4:18 pm

I can't get it to work, help is greatly appreciated.

It also does not work with javaw ( start javaw -cp groovy-1.7.5.jar -Xms256m -Xmx512m -jar haven.jar moltke.seatribe.se ).
javaw does show up at processes, but closes shortly after that starting...

Exception in thread "Haven main thread" java.lang.UnsatisfiedLinkError: C:\Users
\Pascal\Desktop\groovy-bot\jogl.dll: Can't find dependent libraries


Code: Select all
C:\Program Files\Java\jre6\bin\java.exe" -Dj
ava.library.path="C:\Users\Pascal\Desktop\groovy-bot" -cp groovy-1.7.5.jar -Xms2
56m -Xmx512m -jar haven.jar moltke.seatribe.se


Code: Select all
C:\Users\Pascal\Desktop\groovy-bot>"C:\Program Files\Java\jre6\bin\java.exe" -Dj
ava.library.path="C:\Users\Pascal\Desktop\groovy-bot" -cp groovy-1.7.5.jar -Xms2
56m -Xmx512m -jar haven.jar moltke.seatribe.se
Exception in thread "Haven main thread" java.lang.UnsatisfiedLinkError: C:\Users
\Pascal\Desktop\groovy-bot\jogl.dll: Can't find dependent libraries
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(Unknown Source)
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.loadLibrary0(Unknown Source)
        at java.lang.System.loadLibrary(Unknown Source)
        at com.sun.opengl.impl.NativeLibLoader.loadLibraryInternal(NativeLibLoad
er.java:189)
        at com.sun.opengl.impl.NativeLibLoader.access$000(NativeLibLoader.java:4
9)
        at com.sun.opengl.impl.NativeLibLoader$DefaultAction.loadLibrary(NativeL
ibLoader.java:80)
        at com.sun.opengl.impl.NativeLibLoader.loadLibrary(NativeLibLoader.java:
103)
        at com.sun.opengl.impl.NativeLibLoader.access$200(NativeLibLoader.java:4
9)
        at com.sun.opengl.impl.NativeLibLoader$1.run(NativeLibLoader.java:111)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.opengl.impl.NativeLibLoader.loadCore(NativeLibLoader.java:109
)
        at com.sun.opengl.impl.windows.WindowsGLDrawableFactory.<clinit>(Windows
GLDrawableFactory.java:60)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at javax.media.opengl.GLDrawableFactory.getFactory(GLDrawableFactory.jav
a:106)
        at javax.media.opengl.GLCanvas.chooseGraphicsConfiguration(GLCanvas.java
:520)
        at javax.media.opengl.GLCanvas.<init>(GLCanvas.java:131)
        at javax.media.opengl.GLCanvas.<init>(GLCanvas.java:90)
        at haven.HavenPanel.<init>(HavenPanel.java:65)
        at haven.MainFrame.<init>(MainFrame.java:144)
        at haven.MainFrame.main2(MainFrame.java:267)
        at haven.MainFrame.access$100(MainFrame.java:40)
        at haven.MainFrame$7.run(MainFrame.java:358)
        at java.lang.Thread.run(Unknown Source)
Pascal666
 
Posts: 48
Joined: Thu Jan 14, 2010 8:12 pm

Re: Jester87's Bot Tutorial For Newbies

Postby Pascal666 » Sun Mar 04, 2012 4:23 pm

I have replaced jogl.dll/jogl_awt.dll with ender 's jogl.dll, and it works now.
Can this cause a conflict in any way?
Pascal666
 
Posts: 48
Joined: Thu Jan 14, 2010 8:12 pm

Re: Jester87's Bot Tutorial For Newbies

Postby tarvil » Sun Mar 11, 2012 7:19 am

***SOLVED***
Hi,

When attempting to run the log gathering script from the main post I get the following error message in the CMD window:

Exception in groovy script engine:
groovy.lang.MissingMethodException: No signature of method: lamber.?import() is applicable for argument types: (java.lang.Class) values: [class haven.CharWnd]
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:54)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:78)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)
at lamber.run(lamber.groovy:1)
at groovy.util.GroovyScriptEngine.run(GroovyScriptEngine.java:515)
at haven.hhl.hhl_main.ParseScript(hhl_main.java:70)
at haven.hhl.hhl_thread.run(hhl_main.java:89)

I get this message no matter what I name the file.

I have a bit of experience with script code, but after doing some poking at the code I hav not been able to fix this error (just make more >_<)

Some extra info:

I replaced all of the code in the original "lamber.groovy" with the code from the main post.
I am running Windows 7 64bit useing Java 32-bit to run the client.
lamberjack.groovy works without any trouble (with the code from the main post).
Renameing the file makes no difference.
Standing on my head while typing in the command didn't help either (tho it did hurt, my friend lied!).

Any information, either pointing me in the right direction to fix this, or an actual fix, or some other info that is helpful will be greatly apreciated.

Thank You


I fixed this problem. It seems that when I copied the data an invisible character appeared at the begining of the file. I couldn't delete the character or remove it in anyway, so I copied the lamberjack.groovy file and used the import section from that file with the rest of the code from the lamber script.
tarvil
 
Posts: 8
Joined: Thu Mar 24, 2011 8:05 pm

Re: Jester87's Bot Tutorial For Newbies

Postby zann0 » Thu Mar 15, 2012 12:40 pm

Can somone Post all known commands to bot-writing I am reading the scripts to find them but I don't get anything from this (cos code is wiiten without any graphic order )

I want the script that :
1 plow in one place
2 drink water
3 check the water in flask if epty refill from bucket
4 check the water from bucket if empty refil from nearby barrel
4check hunger if hunger <= 25% (very hungry ) log out, else repeat 1 2 3 4

I have died accidentaly I have lots of food but don't have much time playing recently so this bot would be freaking useful anyone can help me
zann0
 
Posts: 58
Joined: Mon Feb 14, 2011 2:02 pm

Re: Jester87's Bot Tutorial For Newbies

Postby Leny-m » Thu Mar 15, 2012 2:47 pm

zann0 wrote:Can somone Post all known commands to bot-writing I am reading the scripts to find them but I don't get anything from this (cos code is wiiten without any graphic order )

I want the script that :
1 plow in one place
2 drink water
3 check the water in flask if epty refill from bucket
4 check the water from bucket if empty refil from nearby barrel
4check hunger if hunger <= 25% (very hungry ) log out, else repeat 1 2 3 4

I have died accidentaly I have lots of food but don't have much time playing recently so this bot would be freaking useful anyone can help me


Hunger <= 25 is starving, 50 is threshold for starvation.

Nearly the exact same script can be found on Arksu forums, you can use most of the code and finish it (repair it) yourself. I've done exactly the same and it works like charm (anti-lag measures). The only thing that can kill it is exception generated by the script engine itself.
Image Image Image Image Image
Leny
User avatar
Leny-m
 
Posts: 109
Joined: Sat Dec 17, 2011 8:04 pm

Re: Jester87's Bot Tutorial For Newbies

Postby zann0 » Thu Mar 15, 2012 3:49 pm

Leny-m wrote:
zann0 wrote:Can somone Post all known commands to bot-writing I am reading the scripts to find them but I don't get anything from this (cos code is wiiten without any graphic order )

I want the script that :
1 plow in one place
2 drink water
3 check the water in flask if epty refill from bucket
4 check the water from bucket if empty refil from nearby barrel
4check hunger if hunger <= 25% (very hungry ) log out, else repeat 1 2 3 4

I have died accidentaly I have lots of food but don't have much time playing recently so this bot would be freaking useful anyone can help me


Hunger <= 25 is starving, 50 is threshold for starvation.

Nearly the exact same script can be found on Arksu forums, you can use most of the code and finish it (repair it) yourself. I've done exactly the same and it works like charm (anti-lag measures). The only thing that can kill it is exception generated by the script engine itself.



Sorry but Im really noob and don't have the slighest idea what can be wrong with this code

Code: Select all
void main (){
  if (have_inventory("Inventory") == 0) open_inventory();
  set_inventory("Inventory");
  while (Hungry>30){
    plow ();
    drinkWater ();
    fillFlask ();
  }
  print ("finish");
  map_click (0,0,3,0);
}

void plow (){
  print ("plow");
  while (!HourGlass){
    send_action ("plow");
    map_click (0,0,1,0);
    sleep (600);
  }
  waitAction ();
}

void drinkWater (){
  if (have_inventory("Inventory") == 0) open_inventory();
  set_inventory("Inventory");

  print ("drink from flask");
  int flag = 1;
  do {
    if (is_item_name ("waterflask")) {
      print ("---flask founded");
      while (!HourGlass) {
        while (!ContextMenuReady) {
          item_click ("iact");
          sleep (300);
        }
        select_context_menu ("Drink");
        sleep (300);
      }
      flag=0;
    }
    if (flag) flag = next_item ();
  } while (flag);
  waitAction ();
}

void fillFlask (){
  if (have_inventory("Inventory") == 0) open_inventory();
  set_inventory("Inventory");

  print ("fill flask");
  if (have_inventory("Inventory") == 0) open_inventory();
  set_inventory("Inventory");
  int flag = 1;
  int x;
  int y;
  do {
    if (is_item_name ("bucket") && is_item_tooltip("Empty")==0) {
      print ("---bucket with water founded, take in hands");
      x = item_coord_x ();
      y = item_coord_y ();
      while (!DraggingItem){
        item_click ("take");
        sleep (200);
      }
      flag = 0;
    }
    if (flag) flag = next_item ();
  } while (flag);

  print ("---drag on flask");
  if (DraggingItem) {
    flag=1;
    set_inventory("Inventory");
    do {
      if (is_item_name ("waterflask")) {
        item_click ("itemact");
        sleep (300);
        flag = 0;
      }
      if (flag) flag = next_item ();
    } while (flag);
    print ("---put busket back to inventory");
    while (DraggingItem){
      item_drop (x,y);
      sleep (200);
    }
  } else {
    print ("Err: no busket in hand");
  }
}

void waitAction (){
  while (HourGlass) sleep (100);
}


Taken from arksu thread
zann0
 
Posts: 58
Joined: Mon Feb 14, 2011 2:02 pm

Re: Jester87's Bot Tutorial For Newbies

Postby Jester87 » Mon Mar 19, 2012 9:09 pm

zann0 wrote:
Leny-m wrote:
zann0 wrote:Can somone Post all known commands to bot-writing I am reading the scripts to find them but I don't get anything from this (cos code is wiiten without any graphic order )

I want the script that :
1 plow in one place
2 drink water
3 check the water in flask if epty refill from bucket
4 check the water from bucket if empty refil from nearby barrel
4check hunger if hunger <= 25% (very hungry ) log out, else repeat 1 2 3 4

I have died accidentaly I have lots of food but don't have much time playing recently so this bot would be freaking useful anyone can help me


Hunger <= 25 is starving, 50 is threshold for starvation.

Nearly the exact same script can be found on Arksu forums, you can use most of the code and finish it (repair it) yourself. I've done exactly the same and it works like charm (anti-lag measures). The only thing that can kill it is exception generated by the script engine itself.



Sorry but Im really noob and don't have the slighest idea what can be wrong with this code

Code: Select all
void main (){
  if (have_inventory("Inventory") == 0) open_inventory();
  set_inventory("Inventory");
  while (Hungry>30){
    plow ();
    drinkWater ();
    fillFlask ();
  }
  print ("finish");
  map_click (0,0,3,0);
}

void plow (){
  print ("plow");
  while (!HourGlass){
    send_action ("plow");
    map_click (0,0,1,0);
    sleep (600);
  }
  waitAction ();
}

void drinkWater (){
  if (have_inventory("Inventory") == 0) open_inventory();
  set_inventory("Inventory");

  print ("drink from flask");
  int flag = 1;
  do {
    if (is_item_name ("waterflask")) {
      print ("---flask founded");
      while (!HourGlass) {
        while (!ContextMenuReady) {
          item_click ("iact");
          sleep (300);
        }
        select_context_menu ("Drink");
        sleep (300);
      }
      flag=0;
    }
    if (flag) flag = next_item ();
  } while (flag);
  waitAction ();
}

void fillFlask (){
  if (have_inventory("Inventory") == 0) open_inventory();
  set_inventory("Inventory");

  print ("fill flask");
  if (have_inventory("Inventory") == 0) open_inventory();
  set_inventory("Inventory");
  int flag = 1;
  int x;
  int y;
  do {
    if (is_item_name ("bucket") && is_item_tooltip("Empty")==0) {
      print ("---bucket with water founded, take in hands");
      x = item_coord_x ();
      y = item_coord_y ();
      while (!DraggingItem){
        item_click ("take");
        sleep (200);
      }
      flag = 0;
    }
    if (flag) flag = next_item ();
  } while (flag);

  print ("---drag on flask");
  if (DraggingItem) {
    flag=1;
    set_inventory("Inventory");
    do {
      if (is_item_name ("waterflask")) {
        item_click ("itemact");
        sleep (300);
        flag = 0;
      }
      if (flag) flag = next_item ();
    } while (flag);
    print ("---put busket back to inventory");
    while (DraggingItem){
      item_drop (x,y);
      sleep (200);
    }
  } else {
    print ("Err: no busket in hand");
  }
}

void waitAction (){
  while (HourGlass) sleep (100);
}


Taken from arksu thread


This is not in groovy format. Look at the code I posted and you can see the difference. Sorry if I can't attend this thread more, but real life calls.
User avatar
Jester87
 
Posts: 195
Joined: Mon Dec 12, 2011 8:19 am
Location: Hell

Re: Jester87's Bot Tutorial For Newbies

Postby Pascal666 » Sun Mar 25, 2012 9:12 pm

Does anyone have a script that fills a waterflask at a well?
This was the best thing I could come up with...but I don't know how to put the waterflask back in my invectory.

Also interacting the waterflask with the well is not working:
well = ark_bot.find_object_by_name("well", 100);
ark_bot.DoClick(well, MOUSE_RIGHT_BUTTON, 0);
and ark_bot.DoInteractClick(well, 0); caused the script to stop

I will post my complete script after it is finished.

Code: Select all
         int well = ark_bot.find_object_by_name("well", 100);
         pathFinder.travelTo(well);
         
         openInventory();
         ark_bot.set_inventory("Inventory");
         while(ark_bot.next_item()){
            if (ark_bot.is_item_name('waterflask')){
               ark_bot.item_click("take", 0);
               thread.sleep(500);
               break;
            }
         }
         well = ark_bot.find_object_by_name("well", 100);
         ark_bot.DoClick(well, MOUSE_RIGHT_BUTTON, 0);
Pascal666
 
Posts: 48
Joined: Thu Jan 14, 2010 8:12 pm

Re: Jester87's Bot Tutorial For Newbies

Postby DarkHairedIrish » Wed Mar 28, 2012 3:41 am

Hello, just read through this tutorial, and I'd like to say well done, well done indeed. Though, I've had my friend make a pave area script, and it doesn't work. If someone can fix it, anyone is then welcome to use it.

Code: Select all
import static sys.*
import static drunkard.*
import util.Walker

int min_Space = 0;
int workan = 0;
main();
/******************************
**     Delicious content     **
******************************/

void main()
{
    def area = selectArea("Select area to pave.")
    if (area == null)
        return;
    def walker = new Walker()
    walker.setAction(this.&tile_work)
    walker.walk(area)
}


void tile_work()
 {
   println("debug #1");
   if(getCursor() != "dig")
    {
      sendAction("stoneroad", "stone");
      waitCursor("dig");
      mapClick(0, 0, 1, 0);
      println("debug #2");
    }
   waitHourglass();
 }
 
 
/******************************
**     Stupid excess shit    **
******************************/
 
void check_Inventory()
 {
    workan = 0;
    if( countFreeSpace(waitInventory()) < min_Space) workan = 1; //check to make sure inventory not empty
    for (item in getInventory("Inventory").getItems()) //Check inventory for stones
     {
       if (item.isName("stone"))
        {
          workan = 0;
        }
     }
     
     if (workan == 1) // Go chip rock
      {
         current_X = getMyCoordX();
         current_Y = getMyCoordY();
             chip_Rock();

             Thread.sleep(500);
             mapAbsClick( current_X , current_Y , 1, 0);
             waitMove();
      }
 }
 
void chip_Rock()
 {
    doClick( findMapObject("gfx/terobjs/bumlings/03",40,0,0) ,3,0);
   
    while( countFreeSpace(waitInventory()) < min_Space)
     {
       waitContextMenu().select("Chip stone")
     }
   
DarkHairedIrish
 
Posts: 1
Joined: Wed Mar 28, 2012 3:36 am

Re: Jester87's Bot Tutorial For Newbies

Postby ydeb » Tue Apr 03, 2012 1:37 pm

Nvm my question, solved it
ydeb
 
Posts: 22
Joined: Fri Feb 10, 2012 3:12 am

PreviousNext

Return to The Wizards' Tower

Who is online

Users browsing this forum: Claude [Bot] and 0 guests