Jump to content

Recommended Posts

Posted (edited)

Good day,

I am hoping that I am asking this question correctly?

I have quite a number of functions that, with "minor" exceptions, are very similar, if not identical.

I am wondering if there is a "way-and-means" of amalgamating - that is, "combining" the functions into a single, coherent function?
• I would be assuming that at probable response would be "arrays"?

For example:

Spoiler
; -----------------------------------------------
#include <AutoItConstants.au3>
; -----------------------------------------------
Opt("MustDeclareVars", 1)
; -----------------------------------------------
Global $iTimeOut = 100
Global $iMouseX = 150, $iMouseY = 227
Global $iX = 885, $iY = 222
; -----------------------------------------------
CreatePreset002Scene()
; -----------------------------------------------
Func CreatePreset002Scene()
    ConfigurePreset002AmpSimView()
    ConfigurePreset002FMixerView()
    UpdatePreset002ScenesView($iX, $iY)
    UpdatePreset002SceneProperties($iX, $iY)
EndFunc   ;==>CreatePreset002Scene
; -----------------------------------------------
Func ConfigurePreset002AmpSimView()
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 534, 544, 2, 0)    ; Launch: Preset 002
EndFunc   ;==>ConfigurePreset002AmpSimView
; -----------------------------------------------
Func ConfigurePreset002FMixerView()
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 50, 120, 1, 0)    ; Select: Channel Label [ZMixer]
EndFunc   ;==>ConfigurePreset002FMixerView
; -----------------------------------------------
Func UpdatePreset002ScenesView($iX, $iY)
    Local $hSAC_SCENES = "[CLASS:SAC_SCENES]"
    ; -----------------------------------------------
    WinActivate($hSAC_SCENES)
    ; -----------------------------------------------
    Send("{End}")    ; Select: [End Of List]
    ; -----------------------------------------------
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 188, 118, 1, 0)    ; Select: [New]
    ; -----------------------------------------------
    Sleep($iTimeOut)
    ClipPut("Preset 002")    ; Copy text
    ; -----------------
    Send("{CTRLDOWN}")
    Send("v")    ; Paste text
    Send("{CTRLUP}")
    ; ----------------------
    Send("{ENTER}")    ; Select: [Ok]
EndFunc   ;==>UpdatePreset002ScenesView
; -----------------------------------------------
Func UpdatePreset002SceneProperties($iX, $iY)
    Local $hSAC_SCENEPROPERTIES = "[CLASS:SAC_SCENEPROPERTIES]"
    ; -----------------------------------------------
    Sleep(1500)
    Send("{ENTER}")    ; Select: [OK]
EndFunc   ;==>UpdatePreset002SceneProperties
; -----------------------------------------------

 

...and...

Spoiler
; -----------------------------------------------
#include <AutoItConstants.au3>
; -----------------------------------------------
Opt("MustDeclareVars", 1)
; -----------------------------------------------
Global $iTimeOut = 100
; For mouse positioning, 2nd position
Global $iMouseX = 150, $iMouseY = 179
; For mouse positioning, 5th position
Global $iMouseX = 150, $iMouseY = 227
; For F12 UpdateMainHeadingSceneProperties positioning
;~ Global $iX = 711, $iY = 80
; For F10 UpdateMainHeadingSceneProperties positioning
Global $iX = 885, $iY = 222
; -----------------------------------------------
CreatePreset003Scene()
; -----------------------------------------------
Func CreatePreset003Scene()
    ConfigurePreset003AmpSImView()
    ConfigurePreset003FMixerView()
    UpdatePreset003ScenesView($iX, $iY)
    UpdatePreset003SceneProperties($iX, $iY)
EndFunc   ;==>CreatePreset003Scene
; -----------------------------------------------
Func ConfigurePreset003AmpSImView()
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 534, 564, 2, 0)    ; Launch: Preset 003
EndFunc   ;==>ConfigurePreset003AmpSImView
; -----------------------------------------------
Func ConfigurePreset003FMixerView()
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 50, 120, 1, 0)    ; Select: Channel Label [ZMixer]
EndFunc   ;==>ConfigurePreset003FMixerView
; -----------------------------------------------
Func UpdatePreset003ScenesView($iX, $iY)
    Local $hSAC_SCENES = "[CLASS:SAC_SCENES]"
    ; -----------------------------------------------
    WinActivate($hSAC_SCENES)
    ; -----------------------------------------------
    Send("{End}")    ; Select: [End Of List]
    ; -----------------------------------------------
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 188, 118, 1, 0)    ; Select: [New]
    ; -----------------------------------------------
    Sleep($iTimeOut)
    ClipPut("Preset 003")    ; Copy text
    ; -----------------
    Send("{CTRLDOWN}")
    Send("v")    ; Paste text
    Send("{CTRLUP}")
    ; ----------------------
    Send("{ENTER}")    ; Select: [Ok]
EndFunc   ;==>UpdatePreset003ScenesView
; -----------------------------------------------
Func UpdatePreset003SceneProperties($iX, $iY)
    Local $hSAC_SCENEPROPERTIES = "[CLASS:SAC_SCENEPROPERTIES]"
    ; -----------------------------------------------
    Sleep(1500)
    Send("{ENTER}")    ; Select: [OK]
EndFunc   ;==>UpdatePreset003SceneProperties
; -----------------------------------------------

Whatever is the "move forward"...any assistance in assisting me in getting started would be greatly appreciated!

Thank you all for your time!

 

 

Edited by mr-es335

Create an account or sign in to comment

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

Create an account

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

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...