Jump to content

my program is doing cmds but too late, its slow


retaly
 Share

Recommended Posts

hy, i know where is the problem,fixed it, then here is the good script:

While 1
    While 1

        $aMsg = GUIGetMsg(1) ; Use advanced parameter to get array
        Switch $aMsg[1] ; check which GUI sent the message
            Case $hGUI1
                Switch $aMsg[0] ; Now check for the messages for $hGUI1
                    Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we exit <<<<<<<<<<<<<<<
                        ExitLoop
                    Case $useit
                        GUICtrlSetState($useit, $GUI_DISABLE)
gui2()
Case $detect
If WinExists(GUICtrlRead($progress)) Then
GUICtrlSetData($status, "Run!")
Else
GUICtrlSetData($status, "Not Running!")
EndIf


Case $exit
    For $i = 0 To 13
                IniWrite($sIniFile, "Napló", $i, GUICtrlRead($aControlID[$i]))
            Next
            Exit
Case $GUI_EVENT_CLOSE 
    For $i = 0 To 13
                IniWrite($sIniFile, "Napló", $i, GUICtrlRead($aControlID[$i]))
            Next
            Exit

Case $btnStop
            _Check4Stop()
        Case $btnStart
            _Check4Start()


EndSwitch



            Case $hGUI2
                Switch $aMsg[0] ; Now check for the messages for $hGUI2
                    Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we just delete the GUI <<<<<<<<<<<<<<<
                        GUIDelete($hGUI2)
                        GUICtrlSetState($useit, $GUI_ENABLE)


                EndSwitch

        EndSwitch

    WEnd

EndFunc   ;==>gui1

and i dont use that script, its from my old script, but i cant use, this is the script:

; cmd
  If $Start = 1 Then
        If GUICtrlRead($Checkbox1) = 1 Then ; 1st send,check, etc..
           $ism = GUICtrlRead($btnStart)
  If WinActive(GUICtrlRead($progress)) Then
   Send(GUICtrlRead($s1))
   Sleep(GUICtrlRead($w1))
   _Delayer()
   EndIf
        EndIf
EndIf

so i wanna paste this old script in the fist script,, plz help

Edited by retaly
Link to comment
Share on other sites

  • Moderators

retaly,

Nothing to do with your problem, but does the code you are actually working on look the same as the code you posted? ;)

Have you never heard of Tidy - a utility you get with the full SciTE4AutoIt3 version of the editor? It makes your code properly indented and also picks out errors - like the fact that you have a While too much and a Func too few in that snippet. ;)

Once I have run Tidy on the snippets I will see what I can do to help - but please make it easy for us to help you and run it on your code before posting. The same goes for anyone else reading this - having neat code (which only takes a key press) really helps anyone trying to debug it. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

retaly,

Where is that second snippet supposed to go in the first? Within the loop? Within what I assume is a function but outside the loop? :)

"paste this old script in the fist script" is not really much to go on. Can you please explain what you are trying to do. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

i mean,

wanna to paste the cmd script in this script part:

While 1
    While 1
        $aMsg = GUIGetMsg(1) ; Use advanced parameter to get array
        Switch $aMsg[1] ; check which GUI sent the message
            Case $hGUI1
                Switch $aMsg[0] ; Now check for the messages for $hGUI1
                    Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we exit <<<<<<<<<<<<<<<
                        ExitLoop
                    Case $useit
                        GUICtrlSetState($useit, $GUI_DISABLE)
gui2()
Case $detect
If WinExists(GUICtrlRead($progress)) Then
GUICtrlSetData($status, "Run!")
Else
GUICtrlSetData($status, "Not Running!")
EndIf

Case $exit
    For $i = 0 To 13
                IniWrite($sIniFile, "Napló", $i, GUICtrlRead($aControlID[$i]))
            Next
            Exit
Case $GUI_EVENT_CLOSE
    For $i = 0 To 13
                IniWrite($sIniFile, "Napló", $i, GUICtrlRead($aControlID[$i]))
            Next
            Exit
Case $btnStop
            _Check4Stop()
        Case $btnStart
            _Check4Start()

EndSwitch

            Case $hGUI2
                Switch $aMsg[0] ; Now check for the messages for $hGUI2
                    Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we just delete the GUI <<<<<<<<<<<<<<<
                        GUIDelete($hGUI2)
                        GUICtrlSetState($useit, $GUI_ENABLE)

                EndSwitch
        EndSwitch
    WEnd
EndFunc   ;==>gui1

cmd:

; cmd
  If $Start = 1 Then
        If GUICtrlRead($Checkbox1) = 1 Then ; 1st send,check, etc..
           $ism = GUICtrlRead($btnStart)
  If WinActive(GUICtrlRead($progress)) Then
   Send(GUICtrlRead($s1))
   Sleep(GUICtrlRead($w1))
   _Delayer()
   EndIf
        EndIf
EndIf

because its working without multipled gui, but with multipled gui i cant use that cmd.. :S,

for example i tryed to do:

While 1
 
  $nMsg = GUIGetMsg(1) ; Use advanced parameter to get array
  Switch $nMsg[1] ; check which GUI sent the message
   Case $hGUI1
    Switch $nMsg[0] ; Now check for the messages for $hGUI1
     Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we exit <<<<<<<<<<<<<<<
      ExitLoop
     Case $useit
      GUICtrlSetState($useit, $GUI_DISABLE)
      gui2()
     Case $detect
      If WinExists(GUICtrlRead($progress)) Then
       GUICtrlSetData($status, "Fut!")
      Else
       GUICtrlSetData($status, "Nem Fut!")
      EndIf
     
     
     Case $exit
      For $i = 0 To 13
       IniWrite($sIniFile, "Napló", $i, GUICtrlRead($aControlID[$i]))
      Next
      Exit
     Case $GUI_EVENT_CLOSE
      For $i = 0 To 13
       IniWrite($sIniFile, "Napló", $i, GUICtrlRead($aControlID[$i]))
      Next
      Exit
     Case $btnStop
      _Check4Stop()
     Case $btnStart
      _Check4Start()
     
    EndSwitch
   
    ; parancsok
    If $Start = 1 Then
     If GUICtrlRead($Checkbox1) = 1 Then ; skillek, 1. Küldés
      $ism = GUICtrlRead($btnStart)
      If WinActive(GUICtrlRead($progress)) Then
       Send(GUICtrlRead($s1))
       Sleep(GUICtrlRead($w1))
       _HP()
       _Target()
       _Drop()
       _Delayer()
      EndIf
     EndIf
    EndIf
   
   Case $hGUI2
    Switch $nMsg[0] ; Now check for the messages for $hGUI2
     Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we just delete the GUI <<<<<<<<<<<<<<<
      GUIDelete($hGUI2)
      GUICtrlSetState($useit, $GUI_ENABLE)
     
     
    EndSwitch
   
  EndSwitch
 
WEnd

EndFunc   ;==>gui1
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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