Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Moving camera at random


    anirus

    Recommended Posts

    Hello, I am new to scripting and have just started programming my first script. I have little Java experience but my script works, however I want to implement a piece of code which moves the camera at different times without interrupting the whole script. I set up a variable that randomly switches between two numbers, depending on what number it'll move the camera to a new position, however I dont want the camera to be moving 24/7. I want this to occur maybe somewhere between 10-60 secs. I tried adding a sleep in but then the whole script would sleep. Any way to implement a sleep into a while loop that doesn't effect the rest of the script? 

    Link to comment
    Share on other sites

    Sounds like what you're looking for is a thread.

    If you don't want to go with this approach, you can use a timer object to handle this in the main loop.

    Link to comment
    Share on other sites

    19 hours ago, Man16 said:

    Sounds like what you're looking for is a thread.

    If you don't want to go with this approach, you can use a timer object to handle this in the main loop.

    To use a thread would I have to create a new class within the program? Also thank you.

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.