Welcome!

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

Sign up now!

Question making loopscript

Joined
May 27, 2016
Messages
745
I feel I have got everything down this time and I dont get any errors on my scripts but it wont print the Hello World for me after pressing play button on intellij it launches th development runemate window up and I see my tutorial bot so I boot that up and I get this error printed on intellij down below:


error log
JavaScript:
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]436 - Tutorial Bot]
    at nul.iIiIIIiiiiIi.for(pqb:138)
    at com.runemate.game.api.hybrid.Environment.getGameType(emb:160)
    at com.runemate.game.api.hybrid.Environment.isRS3(emb:194)
    at nul.iiIIIIiIiiii.for(nab:75)
    at nul.iiIIIIiIiiii.validate(nab:143)
    at com.runemate.game.api.script.framework.LoopingBot.run(wxa:96)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
JavaScript:
java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
[Debug] RuneMate Version: 2.4.18
[Debug] Java Version: 8u121 x86 (Oracle Corporation)
[Debug] Operating System: Windows 10 x64
Checking for a new game client every second for two minutes or until one is found.
Attempting to start official client. If it does not open shortly please do so manually.
Found a new game instance after 4 seconds.
java.lang.UnsupportedOperationException: Only a Thread within a bot's ThreadGroup may eavesdrop on the game client. Current Thread=Thread[pool-3-thread-1,2,[t-g]436 - Tutorial Bot]
    at nul.iIiIIIiiiiIi.for(pqb:138)
    at com.runemate.game.api.hybrid.Environment.getBot(emb:71)
    at nul.iiiIiIiiiIii.run(pbb:147)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
SDK mode is intended for active bot development only. As such, there is a three hour runtime limit while in SDK mode for users who are not Bot Authors. If you are an aspiring Bot Author, please continue on and best of luck! The moment you publish your first bot this limit will be removed. If you are an end user please contact your bot provider and ask them to publish the bot via the Bot Store, so it can be reviewed for safety. For more information please visit <a href="https://www.runemate.com/community/threads/restrict-sdk-runtime-for-end-users.4277/">the discussion thread</a>.
00:00:00 [ DEBUG ] Logger Initialised - this log file can be found at C:\Users\Chris\RuneMate\logs\02-15  2 08 34 - Tutorial Bot.txt
[Caution: Performance Issue] Tutorial Bot is using the default loop delay of [200,400].
[Caution: Continued] It is HIGHLY suggested that you change this value within onStart(String... args) to prevent lag, resource waste, and to make your bots have more unique timings.
[Caution: Limited API usage] You're only using a small portion of the api, we recommend you look into some of our EventListeners such as the InventoryListener.
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]436 - Tutorial Bot]
    at nul.iIiIIIiiiiIi.for(pqb:138)
    at com.runemate.game.api.hybrid.Environment.getGameType(emb:160)
    at com.runemate.game.api.hybrid.Environment.isRS3(emb:194)
    at nul.iiIIIIiIiiii.for(nab:75)
    at nul.iiIIIIiIiiii.validate(nab:143)
    at com.runemate.game.api.script.framework.LoopingBot.run(wxa:96)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)



script for hello world

JavaScript:
package com.chris121.bots.tutorial_bot;

import com.runemate.game.api.script.framework.LoopingBot;

/**
* Created by Chris on 15/02/2017.
*/
public class TutorialBot extends LoopingBot {
    private String output; //Declare our string

    @Override
    public void onLoop() {

        setOutput("Hello World!"); //Assign the string a value using the below method
        System.out.println(getOutput()); //Print the value of the string

        setLoopDelay(1000);

    }

    public void setOutput (String string){
           output = string;
        }

        public String getOutput(){
            return output;
        }

    }





Manifest


JavaScript:
<manifest>
    <main-class>com.chris121.bots.tutorial_bot.TutorialBot</main-class>
    <name>Tutorial Bot</name>
    <description>This is a test bot it test tests</description>
    <version>.0.0.1</version>
    <compatibility>
        <game-type>RS3</game-type>
    </compatibility>
    <categories>
        <catagory>MINING</catagory>
    </categories>
</manifest>
 
Last edited:
Client Developer
Joined
Oct 12, 2015
Messages
3,781
play button on intellij boots spectre

start your bot like normal from spectre

collect sheckles
 
Java Warlord
Joined
Nov 17, 2014
Messages
4,906
Chris there are so many basic tutorials on how to get started with development, you should really follow them instead of making a new thread for every challenging problem you may encounter. :)
 
Joined
May 27, 2016
Messages
745
well I think I worked out what you mean so here is my error log

any help to sort thi shit out would be much appreciated thanks

Code:
java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
[Debug] RuneMate Version: 2.4.18
[Debug] Java Version: 8u121 x86 (Oracle Corporation)
[Debug] Operating System: Windows 10 x64
Checking for a new game client every second for two minutes or until one is found.
Attempting to start official client. If it does not open shortly please do so manually.
Found a new game instance after 4 seconds.
java.lang.UnsupportedOperationException: Only a Thread within a bot's ThreadGroup may eavesdrop on the game client. Current Thread=Thread[pool-3-thread-1,2,[t-g]436 - Tutorial Bot]
    at nul.iIiIIIiiiiIi.for(pqb:138)
    at com.runemate.game.api.hybrid.Environment.getBot(emb:71)
    at nul.iiiIiIiiiIii.run(pbb:147)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
SDK mode is intended for active bot development only. As such, there is a three hour runtime limit while in SDK mode for users who are not Bot Authors. If you are an aspiring Bot Author, please continue on and best of luck! The moment you publish your first bot this limit will be removed. If you are an end user please contact your bot provider and ask them to publish the bot via the Bot Store, so it can be reviewed for safety. For more information please visit <a href="https://www.runemate.com/community/threads/restrict-sdk-runtime-for-end-users.4277/">the discussion thread</a>.
00:00:00 [ DEBUG ] Logger Initialised - this log file can be found at C:\Users\Chris\RuneMate\logs\02-15  2 08 34 - Tutorial Bot.txt
[Caution: Performance Issue] Tutorial Bot is using the default loop delay of [200,400].
[Caution: Continued] It is HIGHLY suggested that you change this value within onStart(String... args) to prevent lag, resource waste, and to make your bots have more unique timings.
[Caution: Limited API usage] You're only using a small portion of the api, we recommend you look into some of our EventListeners such as the InventoryListener.
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]436 - Tutorial Bot]
    at nul.iIiIIIiiiiIi.for(pqb:138)
    at com.runemate.game.api.hybrid.Environment.getGameType(emb:160)
    at com.runemate.game.api.hybrid.Environment.isRS3(emb:194)
    at nul.iiIIIIiIiiii.for(nab:75)
    at nul.iiIIIIiIiiii.validate(nab:143)
    at com.runemate.game.api.script.framework.LoopingBot.run(wxa:96)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
 
Java Warlord
Joined
Nov 17, 2014
Messages
4,906
huh

so press play on intellij which I did.

start your bot like normal from spectre what?

collect sheckles ahahahahahaha scream!!!!!!!!!!!!!!!!!!!!
 


I am activly using a coding academy website as well as runemate
 



part is only one here that is easier to follow, I just dont get why it wont repeat hello world when there is no error
Because you are not starting the bot probably. As i said, there are many guides on how to setup a testing environment for your local bots.
 
Joined
May 27, 2016
Messages
745
Because you are not starting the bot probably. As i said, there are many guides on how to setup a testing environment for your local bots.

alright well I figured out what you mean and I ran the bot from spectre i posted error log above.

And I looked in developer tutorials and cant find any guides on how to set up a testing environment for your local bots
sorry if they do exisit obvously I am not intelligent enough lul which we all know here anyway.
 
Last edited:
Joined
Sep 22, 2015
Messages
1,613
I think that you should set "setLoopDelay(1000);" within an onStart argument, as this is the value that you don't want to change each loop, you set it once. Try doing this and it should work (i think) :D
 
Joined
May 27, 2016
Messages
745
I think that you should set "setLoopDelay(1000);" within an onStart argument, as this is the value that you don't want to change each loop, you set it once. Try doing this and it should work (i think) :D

no that wasnt it. I just restarted it and now it works


2a12ro.png
 
Last edited:
Joined
May 27, 2016
Messages
745
make sure to add the method @Override onStart(); and then Stop(); right below that

i dident do any of that it it works anyway i just restarted it for some reason it works lul

we dident want it to stop we wanted it to loop spam every second
 
Joined
Sep 22, 2015
Messages
1,613
i dident do any of that it it works anyway i just restarted it for some reason it works lul

we dident want it to stop we wanted it to loop spam every second
If you are running runemate via intellij, each compile you need to restart the bot
 
Top