Navigation

    CCBlueX Forum

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

    How Can I Check If A Script Is Running

    Scripts
    3
    13
    81
    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?

      Stfwissue 1 Reply Last reply Reply Quote 1
      • Stfwissue
        Stfwissue @yLetzter last edited by

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

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

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

          Stfwissue 1 Reply Last reply Reply Quote 1
          • Stfwissue
            Stfwissue @yLetzter last edited by Stfwissue

            @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 @Stfwissue 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

              Stfwissue 1 Reply Last reply Reply Quote 1
              • Stfwissue
                Stfwissue @yLetzter last edited by

                @yletzter

                Are you using Core?

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

                  @ali00035 yes

                  1 Reply Last reply Reply Quote 0
                  • yLetzter
                    yLetzter @Stfwissue 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

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

                      @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 @Stfwissue last edited by

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

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

                          @yletzter Edited the post

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

                            @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