CCBlueX Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    How Can I Check If A Script Is Running

    Scripts
    3
    13
    180
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • yLetzter
      yLetzter last edited by

      I want to make a if function which checks if a Script of mine is running. How can I do this?

      Ali00035 1 Reply Last reply Reply Quote 1
      • Ali00035
        Ali00035 Banned @yLetzter last edited by

        @yletzter Like checking if a module is enabled or not?

        yLetzter 1 Reply Last reply Reply Quote 0
        • yLetzter
          yLetzter @Ali00035 last edited by

          @ali00035 yes I want a script which turns another IF running

          Ali00035 1 Reply Last reply Reply Quote 1
          • Ali00035
            Ali00035 Banned @yLetzter last edited by Ali00035

            @yletzter

            mhm, here is something that checks the state of the scaffold module, prints "Ok" if it returns true

            var Scaffold = moduleManager.getModule("Scaffold");
            
            if (Scaffold.getState()) { 
            	Chat.print("Ok"); 
            	} 
            

            im on mobile rn

            yLetzter 1 Reply Last reply Reply Quote 0
            • yLetzter
              yLetzter @Ali00035 last edited by

              @ali00035 thank but is there a way to make a timeout on this? I already know how I can use timeouts (timeout(750, function () CODE) but I dont know how I can timeout a IF

              Ali00035 1 Reply Last reply Reply Quote 1
              • Ali00035
                Ali00035 Banned @yLetzter last edited by

                @yletzter

                Are you using Core?

                yLetzter 2 Replies Last reply Reply Quote 0
                • yLetzter
                  yLetzter @Ali00035 last edited by

                  @ali00035 yes

                  1 Reply Last reply Reply Quote 0
                  • yLetzter
                    yLetzter @Ali00035 last edited by

                    @ali00035 de68728b-88dc-4ce8-8e77-10c899bd50ba-image.png I tried this but it isnt working. I want that after 750ms the IF is runned

                    Ali00035 CzechHek 2 Replies Last reply Reply Quote 0
                    • Ali00035
                      Ali00035 Banned @yLetzter last edited by Ali00035

                      @yletzter

                      Uh, instead of the timeout function, you can use MSTimer

                      Here is a simple code:

                      var Timer = new MSTimer(); 
                      
                      if (KOTL_A.getState()) {
                      	if (Timer.hasTimePassed(750)) { 
                      		Chat.print("lol");
                      		} 
                      		}
                      

                      fuck quickedit

                      yLetzter 1 Reply Last reply Reply Quote 0
                      • yLetzter
                        yLetzter @Ali00035 last edited by

                        @ali00035 I have no Idea what the MSTimer is... could you maybe tell me the finished code?

                        Ali00035 2 Replies Last reply Reply Quote 0
                        • Ali00035
                          Ali00035 Banned @yLetzter last edited by

                          @yletzter Edited the post

                          1 Reply Last reply Reply Quote 0
                          • Ali00035
                            Ali00035 Banned @yLetzter last edited by Ali00035

                            @yletzter MSTimer stands for Mili-Second Timer

                            1 Reply Last reply Reply Quote 0
                            • CzechHek
                              CzechHek @yLetzter last edited by CzechHek

                              @yletzter this trick only works in instances like

                              function () X = true
                              

                              and does the same thing as

                              function () {
                                  return X = true
                              }
                              

                              It is unique to Nashorn.

                              In this case you need to write

                              function () {
                                  if (module.state) print("xd") 
                              }
                              

                              or

                              function () module.state && print("xd") 
                              

                              But if you check for it in onLoad then all scripts should already be loaded and you don't have to timeout.

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post
                              About
                              • Terms of Service
                              • Privacy Policy
                              • Status
                              • Contact Us
                              Downloads
                              • Releases
                              • Source code
                              • License
                              Docs
                              • Tutorials
                              • CustomHUD
                              • AutoSettings
                              • ScriptAPI
                              Community
                              • Forum
                              • Guilded
                              • YouTube
                              • Twitter
                              • D.Tube