Aareon Posted December 8, 2013 Share Posted December 8, 2013 I have a GUI going that automatically runs an swf, creates a button, and when the button is pressed, it creates another instance of the same swf file 1/9 of the original size. I want to be able to put input into the largest instance and the same input go into the small instance at the same time. Any suggestions? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 8, 2013 Moderators Share Posted December 8, 2013 Aareon,Welcome to the AutoIt forum. What exactly do you mean by "input into the largest instance"? Perhaps if you posted the code you have now (see here how to do it) we might get a better idea of what you require. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Aareon Posted December 8, 2013 Author Share Posted December 8, 2013 expandcollapse popup#include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <WindowsConstants.au3> #include <GuiButton.au3> #include <Misc.au3> Local $hDLL = DllOpen("user32.dll") ;***** GUI Create ***** AutoItSetOption("GUIOnEventMode", 1) $hGUI = GUICreate("Aareon's Client",875,580) $mbbutton = GUICtrlCreateButton("Multibox",740,0,60) GUICtrlSetOnEvent($mbbutton, "MBButton") ;***** Show GUI ***** GUISetState(@SW_SHOW) ;***** Show Flash ***** Sleep(1000) $oAlphaFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash") $oAlphaFlash.Loop = False $GX = GUICtrlCreateObj($oAlphaFlash, 0, 0, 740, 580) $oAlphaFlash.Movie = @WorkingDir & "\load.swf" $oAlphaFlash.Loop = False ;***** Multibox ***** Func MBButton() Sleep(1000) $oBetaFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash") $oBetaFlash.Loop = False $GX = GUICtrlCreateObj($oBetaFlash, 740, 26, 130, 130) $oBetaFlash.Movie = @WorkingDir & "\load.swf" $oBetaFlash.Loop = False EndFunc ;Sending keys to both clients $hDLL = DllOpen("user32.dll") While 1 If _IsPressed("57", $hDLL) Then opt("MouseCoordMode",0) ControlFocus("[CLASS:MacromediaFlashPlayerActiveX; INSTANCE:2]") Send("{w}") Sleep(100) ControlFocus("CLASS:MacromediaFlashPlayerActiveX; INSTANCE:1]") EndIf WEnd Func On_Exit() DllClose($hDLL) Exit EndFunc ;***** Show Errors/Close ***** GUISetState(@SW_SHOW) $oAutoItError = ObjEvent("AutoIt.Error", "COMError") GUISetOnEvent($GUI_EVENT_CLOSE, "Close") ;***** Prevent Lag ***** While 1 Sleep(1500) WEnd ;***** Show Errors **** Func COMError() $fError = True EndFunc ;==>COMError Func Close() Exit EndFunc As you can see, I've tried many things. Including ControlClick, ControlFocus, etc. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 8, 2013 Moderators Share Posted December 8, 2013 Aareon,For a start, you do not have the correct syntax for the 2 ControlSend calls - and you do not appear to send anything the second time (plus that syntax is wrong too). This modified version at least passes the syntax checker and has a lot of unecessary code removed - give it a try and see if it works:expandcollapse popup#include <GUIConstantsEx.au3> #include <Misc.au3> $oAutoItError = ObjEvent("AutoIt.Error", "COMError") Local $hDLL = DllOpen("user32.dll") ;***** GUI Create ***** AutoItSetOption("GUIOnEventMode", 1) $hGUI = GUICreate("Aareon's Client", 875, 580) GUISetOnEvent($GUI_EVENT_CLOSE, "Close") $mbbutton = GUICtrlCreateButton("Multibox", 740, 0, 60) GUICtrlSetOnEvent($mbbutton, "MBButton") ;***** Show GUI ***** GUISetState(@SW_SHOW) ;***** Show Flash ***** Sleep(1000) $oAlphaFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash") $oAlphaFlash.Loop = False $GX = GUICtrlCreateObj($oAlphaFlash, 0, 0, 740, 580) $oAlphaFlash.Movie = @WorkingDir & "\load.swf" $oAlphaFlash.Loop = False ;Sending keys to both clients $hDLL = DllOpen("user32.dll") While 1 If _IsPressed("57", $hDLL) Then ControlFocus($hGUI, "", "[CLASS:MacromediaFlashPlayerActiveX; INSTANCE:2]") ; Use the correct syntax - you need the GUI and text parameters Send("w") ; Use the correst syntax - you do not need { } Sleep(100) ControlFocus($hGUI, "", "CLASS:MacromediaFlashPlayerActiveX; INSTANCE:1]") ; Use the correct syntax - you need the GUI and text parameters Send("w") ; Sent something! EndIf WEnd ;***** Multibox ***** Func MBButton() Sleep(1000) $oBetaFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash") $oBetaFlash.Loop = False $GX = GUICtrlCreateObj($oBetaFlash, 740, 26, 130, 130) $oBetaFlash.Movie = @WorkingDir & "\load.swf" $oBetaFlash.Loop = False EndFunc ;==>MBButton ;***** Show Errors/Close ***** Func COMError() $fError = True EndFunc ;==>COMError Func Close() DllClose($hDLL) Exit EndFunc ;==>CloseAny luck? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Aareon Posted December 8, 2013 Author Share Posted December 8, 2013 No luck. I appreciate the corrections. The goal is to detect when I press 'w' while I have big instance focused(1), quickly set focus to Instance 2 after I've pressed w, and repeat the key. Then set focus back to big instance. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 8, 2013 Moderators Share Posted December 8, 2013 Aareon,Perhaps if you could explain why you wish to interact with this Flash object (and in 2 instances to boot) we might be able to suggest a better way to go about it. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Aareon Posted December 8, 2013 Author Share Posted December 8, 2013 I am trying to make a multiboxing client for Realm of the Mad God, but within a single window. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 8, 2013 Moderators Share Posted December 8, 2013 Aareon,Unfortunately you appear to have missed the Forum rules on your way in. Please read them now (there is also a link at bottom right of each page) - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts