Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Bug Very frustrating bug. All help is appreciated

Joined
Sep 27, 2017
Messages
16
Hi, I'm getting a very frustrating bug and would appreciate any help solving it.

Code:
[Debug] Java Home: C:\Program Files (x86)\Java\jre1.8.0_171
[Debug] Java Version: 8u171 x86 (Oracle Corporation)
[Debug] Maximum Heap Size: 990MB
[Debug] RuneMate Version: 2.84.3
[Debug] Operating System: Windows 10 x64
[Clouse] Downloaded 999 human mouse movements selected for you by Clouse.
java.lang.IllegalStateException: [CLIENT ERROR] The bot is not running on a designated bot thread.
        at com.runemate.game.api.script.framework.AbstractBot.start(uub:17278)
        at nul.IiiIiIiiiIiiI.run(mkc:127)
java.lang.UnsupportedOperationException: Only a Thread within a bot's ThreadGroup may eavesdrop on the game client. Current Thread=Thread[pool-4-thread-1,5,[t-g]2224 - botFinal]
        at nul.IiiiIIiiIIiii.break(qqc:75)
        at nul.IIIiIIiiIIiii.break(pic:24)
        at nul.IIIiIIiiIIiii.break(pic:154)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

I get this error when I run a bot on RuneMate. It is a bot I wrote, and I've had this error with 3 different bots (all that I have written). In fact, I don't think I've ever run a bot I've written on this PC without it sometimes crashing due to this error. I think it only happens for bots I've written/local

I have changed from windows 7 to windows 10 due to this issue and it still occurs.
I was using Java version 8.0_153 and updated to 8.0_171 and still get this error.
Also I have another machine where I can run these bots and never have this error.

I'm also quite sure that opening an osrs client after opening runemate or through runemate does not help.

The exact occurrence is as follows:
- I use the scroll boxes to pick a bot, account and client in that order.
- After clicking start instance the loading circle takes an abnormally LONG time, 3 minutes+
- From here there is maybe a 50% chance the bot will run and the green sdk message will appear in RuneMate. The rest of the time the loading ends and the bot running panel shows, but there is no sdk message. After about a minute there will be a error that terminates the bot giving this stack trace.

Thanks in advance...
 
Really need help with this. Is this stack trace usable for a bug fix @Arbiter? Or perhaps there's something else I can try?
 
cuppa.drink(java);
Joined
Mar 13, 2018
Messages
7,095
You're only getting this on bots you wrote? There's most likely something wrong with your code. I don't know exactly what the error is, but maybe if you post your code/at least your main method/initializations, someone might be able to spot something. If you're comfortable with that.
 
Joined
Jan 28, 2017
Messages
492
Only a Thread within a bot's ThreadGroup may eavesdrop on the game client.

> Do you generate any seperate threads? (Could be from UI calls)
 
cuppa.drink(java);
Joined
Mar 13, 2018
Messages
7,095
Or if you're trying to integrate with some 3rd party API to do some fancy stuff it may be messing up your threads.
 
Joined
Sep 27, 2017
Messages
16
You're only getting this on bots you wrote? There's most likely something wrong with your code. I don't know exactly what the error is, but maybe if you post your code/at least your main method/initializations, someone might be able to spot something. If you're comfortable with that.

Okay, I'll confirm that the error occurs with one of the bots and then post the code. Thanks for the response

Only a Thread within a bot's ThreadGroup may eavesdrop on the game client.

> Do you generate any seperate threads? (Could be from UI calls)

There's no ui, so I don't believe so no...
 
@CuppaJava @Negrita Here's a simple bot I wrote that encounters the error I described above. Just to clarify as far as I'm aware there is no issue when I build this in intellij and then run it from rm. However, when I take these files to another pc and then run the code there is a 30-50% chance that it will not run, citing the error above.
 

Attachments

  • buggedCode.zip
    3.8 KB · Views: 2
cuppa.drink(java);
Joined
Mar 13, 2018
Messages
7,095
Okay, I'll confirm that the error occurs with one of the bots and then post the code. Thanks for the response



There's no ui, so I don't believe so no...
 
@CuppaJava @Negrita Here's a simple bot I wrote that encounters the error I described above. Just to clarify as far as I'm aware there is no issue when I build this in intellij and then run it from rm. However, when I take these files to another pc and then run the code there is a 30-50% chance that it will not run, citing the error above.

Lool. Okay, I think I see what's happening here.

So what you sent us is a zip of the bin folder right? It's a zip with the class file and XML. First of all, we can't (easily) read the class file since it's a compiled Java file. If you want someone to read your code, send them the .java file(s).

Also I'm assuming that's why you're getting an exception. I assume you're putting that zip onto your other computer and trying to run it using the class file, which won't work properly since java files are each complied for their own environment. You need to either push your bot to SVN with the manifest marking it private (there's other guides for this on RM), or copy the .java files and compile them on the other PC. I think there's also a way to properly export/compile so it'll work on other computers but I forget that.

Case closed bring in the dancing lobsters (y)(y)
 
Joined
Sep 27, 2017
Messages
16
Lool. Okay, I think I see what's happening here.

So what you sent us is a zip of the bin folder right? It's a zip with the class file and XML. First of all, we can't (easily) read the class file since it's a compiled Java file. If you want someone to read your code, send them the .java file(s).

Also I'm assuming that's why you're getting an exception. I assume you're putting that zip onto your other computer and trying to run it using the class file, which won't work properly since java files are each complied for their own environment. You need to either push your bot to SVN with the manifest marking it private (there's other guides for this on RM), or copy the .java files and compile them on the other PC. I think there's also a way to properly export/compile so it'll work on other computers but I forget that.

Case closed bring in the dancing lobsters (y)(y)

Thanks for replying, ur a legend. So I do actually know that i need to send .java files. I'm an idiot dunno why I sent the class.

But anyway you may have hit the nail on the head regarding how I have been running the bots. I just copy the bin folder/class+manifest files to the next computer. I'd very much like to try another way to see if that's the problem. I looked into SVN a bit, seems like there's a bit to it. Just to see if this is the problem I am very interested in the other option u mentioned:

or copy the .java files and compile them on the other PC. I think there's also a way to properly export/compile so it'll work on other computers but I forget that.

Do you know any way I could get more information on this, I do not have the IDE on the other computer so not really sure how to compile without it....

Thanks again!
 
cuppa.drink(java);
Joined
Mar 13, 2018
Messages
7,095
Thanks for replying, ur a legend. So I do actually know that i need to send .java files. I'm an idiot dunno why I sent the class.

But anyway you may have hit the nail on the head regarding how I have been running the bots. I just copy the bin folder/class+manifest files to the next computer. I'd very much like to try another way to see if that's the problem. I looked into SVN a bit, seems like there's a bit to it. Just to see if this is the problem I am very interested in the other option u mentioned:



Do you know any way I could get more information on this, I do not have the IDE on the other computer so not really sure how to compile without it....

Thanks again!
No problem! Glad I could help. The easiest way would probably be to copy over the java files and compile using command line (plenty of tuts, just google it). You can also export as a .jar usually with java, but I don't think RuneMate supports exported jars since SDK mode is basically just intended for developers.

Unless I'm mistaken, a quick command line compile on the PC you're running it is your best/only option.
 
Joined
Jan 28, 2017
Messages
492
why not just publish it to the store (as a private bot). Then you don't need to move files from PC-A to PC-B
 
Joined
Sep 27, 2017
Messages
16
No problem! Glad I could help. The easiest way would probably be to copy over the java files and compile using command line (plenty of tuts, just google it). You can also export as a .jar usually with java, but I don't think RuneMate supports exported jars since SDK mode is basically just intended for developers.

Unless I'm mistaken, a quick command line compile on the PC you're running it is your best/only option.

Awesome man looked into it and so far so good. Dealing with a few other issues atm, and since you've been so helpful might ask ur opinion too.I'm battling with 2 issues, one where rm frequently crashes when loading in at the loading circle, and the other where bots take a long time to load, often 3+ minutes. Do you have any suggestions for how to deal with these? I thought maybe allocating more ram to rm, however due to 32-bit jre I am unable to allocate more than 1G. Thinking of trying out 64-bit tho I recall having trouble in the past....

why not just publish it to the store (as a private bot). Then you don't need to move files from PC-A to PC-B

Yes, now that I am aware this is the issue I will be looking to setup SVN and doing this way. Thanks for ur help.
 
cuppa.drink(java);
Joined
Mar 13, 2018
Messages
7,095
Awesome man looked into it and so far so good. Dealing with a few other issues atm, and since you've been so helpful might ask ur opinion too.I'm battling with 2 issues, one where rm frequently crashes when loading in at the loading circle, and the other where bots take a long time to load, often 3+ minutes. Do you have any suggestions for how to deal with these? I thought maybe allocating more ram to rm, however due to 32-bit jre I am unable to allocate more than 1G. Thinking of trying out 64-bit tho I recall having trouble in the past....



Yes, now that I am aware this is the issue I will be looking to setup SVN and doing this way. Thanks for ur help.

Those I don't have an answer for, never faced them. I didn't personally change the allocation of memory for RM or anything, and I wouldn't swap to 64 bit, 32 bit is recommended for RM.

I guess again I'd ask if it's a problem you're having with all bots or just yours?
 
Top