Auto DJ Script 7 posts

OP Sat Aug 22, 2015 7:38 am
User avatar
Administrator
Legendary Family Member
  • Gender: Male
  • Posts: 6285
  • Joined: Jun, 2010
  • Advertisements: 45
  • Karma: 368
This is a dj script requested by
@blackdragonknight


The purpose of this script is to make being a dj easier by automating the trigger process.

Note: This script was designed to work on a specific type of song.
-The song must be split into multiple triggers
-The trigger word must not change
-The trigger must contain numbers

Example: trigger1, trigger2, trigger3 etc...

Here is an example catalog of songs this script works with: http://www.imvu.com/shop/web_search.php ... d_search=1


Instructions:
Step 1) Download AutoIT from their website. http://www.autoitscript.com/site/autoit/

Step 2) Then you open the script editor (SciTE) and paste the code above into it and either run or compile it.

Step 3) Hit F1 to start the script

It will proceed to check for IMVU and bring it to the front.

Step 4) In the dialog prompts that open, type in the information required:

Trigger Word: The trigger phrase without any numbers
Trigger Begin: The first trigger number (Example: If the first trigger is trigger5 then 5 is the number)
Trigger End: The same as trigger begin except you put in the number from the last trigger
Trigger Length: This is the length of the triggers (Example: Each trigger is 20 seconds long so you type in 20)

Step 5) Once all of the dialog prompts have been filled out, the script should proceed to type out the triggers for you to start the song. If all goes well, it should proceed to type out all of the triggers with a delay in between each that is the exact length of the trigger.


Code
HotKeySet("{F1}", "Start")
HotKeySet("{F2}", "StopSong")


;Set global variables
Global $sleep = 0
Global $stop = False

;The trigger phrase all triggers are named after
Global $TriggerWord

;The number the trigger begins on Ex: mir13
Global $TriggerBegin

;The number the trigger ends on Ex: mir25
Global $TriggerEnd

;The length of the truggers Ex: 20(sec)
Global $TriggerLength

while 1
   sleep(100)
wend

Func Start()
   If($stop = True) Then
     $stop = False
   EndIf

   ;If IMVU is open
   If (IMVUisRunning() = False) Then
     stop()
   EndIf

   ;Bring IMVU to the front
   getIMVUWindow()

   ;Setup the song variables
   SetupSong()

   ;Play the song
   PlaySong();
EndFunc

Func SetupSong()
   $TriggerWord = InputBox("Trigger Word", "Please type in the word")

   $TriggerBegin = InputBox("Trigger Begin", "Please type in the begining trigger number")
   If Not (StringIsDigit($TriggerBegin)) Then
     While Not StringIsDigit($TriggerBegin)
       $TriggerBegin = InputBox("Trigger Begin", "Please type in the begining trigger number")
     WEnd
   EndIf

   $TriggerEnd = InputBox("Trigger End", "Please type in the end trigger number")
   If Not (StringIsDigit($TriggerEnd)) Then
     While Not StringIsDigit($TriggerEnd)
       $TriggerEnd = InputBox("Trigger End", "Please type in the end trigger number")
     WEnd
   EndIf

   $TriggerLength = InputBox("Trigger Length","Please type in the length of the trigger")
   If Not (StringIsDigit($TriggerLength)) Then
     While Not StringIsDigit($TriggerLength)
       $TriggerLength = InputBox("Trigger Length", "Please type in the amount of triggers")
     WEnd
   EndIf

   ;debug
   ConsoleWrite($TriggerWord)
   ConsoleWrite($TriggerBegin)
   ConsoleWrite($TriggerEnd)
   ConsoleWrite($TriggerLength)
EndFunc

Func PlaySong()
   $intBegin = $TriggerBegin

   Do
     If($stop = True) Then
       return
     EndIf
     Send($TriggerWord & $intBegin)
     Send("{ENTER}")
     Sleep($TriggerLength * 1000)
     $intBegin = $intBegin + 1
   Until $intBegin = $TriggerEnd + 1
EndFunc


;Stop the PlaySong function
Func StopSong()
   $stop = True
EndFunc

;Closes the script
Func Terminate()
   Exit 0
EndFunc

;Detects if the IMVUClient process is running
Func IMVUIsRunning()
   If ProcessExists("IMVUClient.exe") OR ("IMVUQualityAgent.exe") Then
     Return True
   Else
     Return False
   EndIf
EndFunc

;Gets the IMVUClient window and brings it to the front
Func getIMVUWindow()
   Opt("WinTitleMatchMode", 4)
   ;Get the Window Handle for IMVU
   $hICWindow = WinGetHandle("[CLASS:ImvuNativeWindow]")
   ;Bring IMVU to the front so we don't accidently type into something else
   WinActivate($hICWindow)
   WinWait($hICWindow)
EndFunc
Sat Aug 22, 2015 7:55 am
User avatar
Inner Family Member
  • Gender: Male
  • Posts: 209
  • Joined: Sep, 2011
  • Karma: 0
Haha thats a pretty neat script. plus i have never tried autoit.
Sat Aug 22, 2015 11:11 am
User avatar
Lower Family Member
  • Posts: 127
  • Joined: Jul, 2011
  • Karma: 20
That's genius, very well done. I know a few people that DJ or used to and I can see where they'd benefit from this
Wed Nov 28, 2018 6:10 pm
User avatar
  • Gender: Male
  • Posts: 8
  • Joined: Jun, 2015
  • Karma: 0
I tried it and its very useful.

Thank you M.D
Wed Nov 28, 2018 7:06 pm
User avatar
  • Gender: Male
  • Posts: 79
  • Joined: Nov, 2018
  • Karma: 0
Thank you bro
Wed Jan 01, 2020 5:35 pm
User avatar
  • Gender: Female
  • Posts: 33
  • Joined: Sep, 2019
  • Karma: 0
I saw this at a Dj show and it was amazing. Bravo !
Wed Jan 01, 2020 9:02 pm
User avatar
  • Gender: Male
  • Posts: 35
  • Joined: Dec, 2019
  • Advertisements: 5
  • Karma: 0
This is pretty dope, I was wondering if something like this existed

Create an account or sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here

SIGN IN NOW

Create an account

Sign up for a new account in our community. It's easy!

REGISTER A NEW ACCOUNT