1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question making loopscript

Discussion in 'Developer Support' started by chris121, Feb 14, 2017.

  1. chris121

    Joined:
    May 27, 2016
    Messages:
    745
    Likes Received:
    126
    I feel I have got everything down this time and I dont get any errors on my scripts bots 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
    Code (Javascript):
    1. 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]
    2.    at nul.iIiIIIiiiiIi.for(pqb:138)
    3.    at com.runemate.game.api.hybrid.Environment.getGameType(emb:160)
    4.    at com.runemate.game.api.hybrid.Environment.isRS3(emb:194)
    5.    at nul.iiIIIIiIiiii.for(nab:75)
    6.    at nul.iiIIIIiIiiii.validate(nab:143)
    7.    at com.runemate.game.api.script.framework.LoopingBot.run(wxa:96)
    8.    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    9.    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    10.    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    11.    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    12.    at java.lang.Thread.run(Thread.java:745)
    Code (Javascript):
    1. java.util.prefs.WindowsPreferences <init>
    2. WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
    3. [Debug] RuneMate Version: 2.4.18
    4. [Debug] Java Version: 8u121 x86 (Oracle Corporation)
    5. [Debug] Operating System: Windows 10 x64
    6. Checking for a new game client every second for two minutes or until one is found.
    7. Attempting to start official client. If it does not open shortly please do so manually.
    8. Found a new game instance after 4 seconds.
    9. 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]
    10.    at nul.iIiIIIiiiiIi.for(pqb:138)
    11.    at com.runemate.game.api.hybrid.Environment.getBot(emb:71)
    12.    at nul.iiiIiIiiiIii.run(pbb:147)
    13.    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    14.    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    15.    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
    16.    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    17.    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    18.    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    19.    at java.lang.Thread.run(Thread.java:745)
    20. 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>.
    21. 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
    22. [Caution: Performance Issue] Tutorial Bot is using the default loop delay of [200,400].
    23. [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.
    24. [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.
    25. 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]
    26.    at nul.iIiIIIiiiiIi.for(pqb:138)
    27.    at com.runemate.game.api.hybrid.Environment.getGameType(emb:160)
    28.    at com.runemate.game.api.hybrid.Environment.isRS3(emb:194)
    29.    at nul.iiIIIIiIiiii.for(nab:75)
    30.    at nul.iiIIIIiIiiii.validate(nab:143)
    31.    at com.runemate.game.api.script.framework.LoopingBot.run(wxa:96)
    32.    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    33.    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    34.    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    35.    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    36.    at java.lang.Thread.run(Thread.java:745)


    script bot for hello world

    Code (Javascript):
    1. package com.chris121.bots.tutorial_bot;
    2.  
    3. import com.runemate.game.api.script.framework.LoopingBot;
    4.  
    5. /**
    6. * Created by Chris on 15/02/2017.
    7. */
    8. public class TutorialBot extends LoopingBot {
    9.     private String output; //Declare our string
    10.  
    11.     @Override
    12.     public void onLoop() {
    13.  
    14.         setOutput("Hello World!"); //Assign the string a value using the below method
    15.         System.out.println(getOutput()); //Print the value of the string
    16.  
    17.         setLoopDelay(1000);
    18.  
    19.     }
    20.  
    21.     public void setOutput (String string){
    22.            output = string;
    23.         }
    24.  
    25.         public String getOutput(){
    26.             return output;
    27.         }
    28.  
    29.     }
    30.  
    31.  




    Manifest


    Code (Javascript):
    1. <manifest>
    2.     <main-class>com.chris121.bots.tutorial_bot.TutorialBot</main-class>
    3.     <name>Tutorial Bot</name>
    4.     <description>This is a test bot it test tests</description>
    5.     <version>.0.0.1</version>
    6.     <compatibility>
    7.         <game-type>RS3</game-type>
    8.     </compatibility>
    9.     <categories>
    10.         <catagory>MINING</catagory>
    11.     </categories>
    12. </manifest>
     
    #1 chris121, Feb 14, 2017
    Last edited: Feb 14, 2017
  2. Party

    Party Client Developer

    Joined:
    Oct 12, 2015
    Messages:
    3,708
    Likes Received:
    1,606
    play button on intellij boots spectre

    start your bot like normal from spectre

    collect sheckles
     
  3. Savior

    Savior Java Warlord

    Joined:
    Nov 17, 2014
    Messages:
    4,906
    Likes Received:
    2,748
    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. :)
     
  4. chris121

    Joined:
    May 27, 2016
    Messages:
    745
    Likes Received:
    126
    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 (Text):
    1. java.util.prefs.WindowsPreferences <init>
    2. WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
    3. [Debug] RuneMate Version: 2.4.18
    4. [Debug] Java Version: 8u121 x86 (Oracle Corporation)
    5. [Debug] Operating System: Windows 10 x64
    6. Checking for a new game client every second for two minutes or until one is found.
    7. Attempting to start official client. If it does not open shortly please do so manually.
    8. Found a new game instance after 4 seconds.
    9. 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]
    10.     at nul.iIiIIIiiiiIi.for(pqb:138)
    11.     at com.runemate.game.api.hybrid.Environment.getBot(emb:71)
    12.     at nul.iiiIiIiiiIii.run(pbb:147)
    13.     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    14.     at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    15.     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
    16.     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    17.     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    18.     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    19.     at java.lang.Thread.run(Thread.java:745)
    20. 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>.
    21. 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
    22. [Caution: Performance Issue] Tutorial Bot is using the default loop delay of [200,400].
    23. [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.
    24. [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.
    25. 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]
    26.     at nul.iIiIIIiiiiIi.for(pqb:138)
    27.     at com.runemate.game.api.hybrid.Environment.getGameType(emb:160)
    28.     at com.runemate.game.api.hybrid.Environment.isRS3(emb:194)
    29.     at nul.iiIIIIiIiiii.for(nab:75)
    30.     at nul.iiIIIIiIiiii.validate(nab:143)
    31.     at com.runemate.game.api.script.framework.LoopingBot.run(wxa:96)
    32.     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    33.     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    34.     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    35.     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    36.     at java.lang.Thread.run(Thread.java:745)
    37.  
     
  5. Savior

    Savior Java Warlord

    Joined:
    Nov 17, 2014
    Messages:
    4,906
    Likes Received:
    2,748
    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.
     
  6. chris121

    Joined:
    May 27, 2016
    Messages:
    745
    Likes Received:
    126
    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.
     
    #6 chris121, Feb 14, 2017
    Last edited: Feb 14, 2017
  7. qverkk

    Joined:
    Sep 22, 2015
    Messages:
    1,603
    Likes Received:
    381
    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
     
    Wet Rag likes this.
  8. chris121

    Joined:
    May 27, 2016
    Messages:
    745
    Likes Received:
    126
    no that wasnt it. I just restarted it and now it works


    [​IMG]
     
    #8 chris121, Feb 15, 2017
    Last edited: Feb 15, 2017
  9. Wet Rag

    Wet Rag easily triggered ✌

    Joined:
    Dec 31, 2015
    Messages:
    4,452
    Likes Received:
    1,694
    make sure to add the method @Override onStart(); and then Stop(); right below that
     
  10. chris121

    Joined:
    May 27, 2016
    Messages:
    745
    Likes Received:
    126
    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
     
  11. qverkk

    Joined:
    Sep 22, 2015
    Messages:
    1,603
    Likes Received:
    381
    If you are running runemate via intellij, each compile you need to restart the bot
     
    chris121 likes this.

Share This Page

Loading...