Closing Dialogs With Compiled EXE

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
MadQuestion
Pro Scripter
Posts: 70
Joined: Wed Nov 08, 2017 6:54 pm

Closing Dialogs With Compiled EXE

Post by MadQuestion » Wed Nov 08, 2017 7:24 pm

Hi Guys First Time Posting Long Time User Of Macro Scheduler. I have recently started the task of creating a script that will play a android strategy game I have created menus using dialogs but when I have exported the script to EXE to test it the Loading screen dialog2, dialog3, dialog4, dialog5, will not close. It will close when run from the run now button within the script editor but sadly that is the only place it closes. I have attached the script I wrote and all files needed to run the script just in case any script junkies out there fancy trying to debug it. Basically the script should open one dialog wait for the user to select the correct option then the next dialog is a status bar loading dialog which will not close when the status bar has completed. I am really stuck and have spent far too long trying to solve on my own. Im at days has been spent on this single problem.... I even had hair before this issue..... Please help guys & girls.

Code: Select all

Dialog>Dialog1
object Dialog1: TForm
  Left = 1195
  Top = 178
  HelpContext = 5000
  Align = alCustom
  BorderIcons = [biSystemMenu]
  Caption = 'Pick Your Game Of Choice'
  ClientHeight = 278
  ClientWidth = 481
  Color = clWhite
  DragKind = dkDock
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  Position = poScreenCenter
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object PICK_APP_MENU_TITLE: TLabel
    Left = 96
    Top = 16
    Width = 287
    Height = 24
    Caption = 'Which Game Are You Running The BOT In?'
    Font.Charset = ANSI_CHARSET
    Font.Color = clBlack
    Font.Height = -24
    Font.Name = 'Newsflash BB'
    Font.Style = []
    ParentFont = False
  end
  object CLASHOFKINGSICONIMAGE: tMSImage
    Left = 8
    Top = 56
    Width = 105
    Height = 105
  end
  object CLASHOFKINGSINTOWESTICONIMAGE: tMSImage
    Left = 128
    Top = 56
    Width = 105
    Height = 105
  end
  object CLASHOFQUEENSICONIMAGE: tMSImage
    Left = 248
    Top = 56
    Width = 105
    Height = 105
  end
  object CLASHOFCLANSICONIMAGE: tMSImage
    Left = 368
    Top = 56
    Width = 105
    Height = 105
  end
  object Label2: TLabel
    Left = 8
    Top = 168
    Width = 101
    Height = 16
    Alignment = taCenter
    Caption = 'Clash Of Kings'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'MS Sans Serif'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label3: TLabel
    Left = 128
    Top = 168
    Width = 101
    Height = 16
    Alignment = taCenter
    Caption = 'Clash Of Kings'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'MS Sans Serif'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label4: TLabel
    Left = 240
    Top = 168
    Width = 116
    Height = 16
    Alignment = taCenter
    Caption = 'Clash Of Queens'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'MS Sans Serif'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label5: TLabel
    Left = 368
    Top = 168
    Width = 102
    Height = 16
    Alignment = taCenter
    Caption = 'Clash Of Clans'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'MS Sans Serif'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label6: TLabel
    Left = 128
    Top = 184
    Width = 106
    Height = 16
    Alignment = taCenter
    Caption = '(Into The West)'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'MS Sans Serif'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object COK_CHECKBOX: TCheckBox
    Left = 54
    Top = 209
    Width = 19
    Height = 17
    TabOrder = 0
  end
  object COK_WEST_CHECKBOX: TCheckBox
    Left = 174
    Top = 209
    Width = 19
    Height = 17
    TabOrder = 1
  end
  object COQ_CHECKBOX: TCheckBox
    Left = 294
    Top = 209
    Width = 19
    Height = 17
    TabOrder = 2
  end
  object COC_CHECKBOX: TCheckBox
    Left = 414
    Top = 209
    Width = 19
    Height = 17
    TabOrder = 3
  end
  object MSButton1: tMSButton
    Left = 8
    Top = 232
    Width = 465
    Height = 41
    Caption = 'OPEN BOT SETTINGS MENU'
    Font.Charset = ANSI_CHARSET
    Font.Color = clBlack
    Font.Height = -19
    Font.Name = 'Neutra Display Titling'
    Font.Style = [fsBold, fsUnderline]
    ModalResult = 1
    ParentFont = False
    TabOrder = 4
    DoBrowse = False
    BrowseStyle = fbOpen
  end
end
EndDialog>Dialog1
Dialog>Dialog2
object Dialog2: TForm
  Left = 1215
  Top = 104
  HelpContext = 5000
  BorderIcons = []
  BorderStyle = bsNone
  Caption = 'LOADING CLASH OF QUEENS....'
  ClientHeight = 385
  ClientWidth = 456
  Color = clBlack
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  Position = poScreenCenter
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object CLASHOFQUEENSLOADINGIMAGE: tMSImage
    Left = -8
    Top = 0
    Width = 481
    Height = 361
  end
  object COQLOADINGBAR: TProgressBar
    Left = 8
    Top = 312
    Width = 441
    Height = 62
    TabOrder = 0
  end
end
EndDialog>Dialog2
Dialog>Dialog3
object Dialog3: TForm
  Left = 1215
  Top = 104
  HelpContext = 5000
  BorderIcons = []
  BorderStyle = bsNone
  Caption = 'LOADING CLASH OF KINGS....'
  ClientHeight = 360
  ClientWidth = 457
  Color = clBlack
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  Position = poScreenCenter
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object CLASHOFKINGSLOADINGIMAGE: tMSImage
    Left = -8
    Top = 0
    Width = 481
    Height = 361
  end
  object COKLOADINGBAR: TProgressBar
    Left = 8
    Top = 288
    Width = 441
    Height = 62
    TabOrder = 0
  end
end
EndDialog>Dialog3
Dialog>Dialog4
object Dialog4: TForm
  Left = 1215
  Top = 104
  HelpContext = 5000
  BorderIcons = []
  BorderStyle = bsNone
  Caption = 'LOADING CLASH OF KINGS INTO THE WEST....'
  ClientHeight = 338
  ClientWidth = 458
  Color = clBlack
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  Position = poScreenCenter
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object CLASHOFKINGSWESTLOADINGIMAGE: tMSImage
    Left = -8
    Top = 0
    Width = 481
    Height = 361
  end
  object COKWESTLOADINGBAR: TProgressBar
    Left = 8
    Top = 264
    Width = 441
    Height = 62
    TabOrder = 0
  end
end
EndDialog>Dialog4
Dialog>Dialog5
object Dialog5: TForm
  Left = 1215
  Top = 104
  HelpContext = 5000
  BorderIcons = []
  BorderStyle = bsNone
  Caption = 'LOADING CLASH OF CLANS....'
  ClientHeight = 376
  ClientWidth = 456
  Color = clBlack
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  Position = poScreenCenter
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object CLASHOFCLANSLOADINGIMAGE: tMSImage
    Left = -8
    Top = 0
    Width = 481
    Height = 361
  end
  object COCLOADINGBAR: TProgressBar
    Left = 8
    Top = 304
    Width = 441
    Height = 62
    TabOrder = 0
  end
end
EndDialog>Dialog5
SRT>COKSELECTEDROUTINE
  GetDialogProperty>Dialog1,COK_CHECKBOX,Checked,CHECKBOX
  If>CHECKBOX=True
    SetDialogProperty>Dialog1,MSButton1,Enabled,True
    SetDialogProperty>Dialog1,COQ_CHECKBOX,Visible,False
    SetDialogProperty>Dialog1,COK_WEST_CHECKBOX,Visible,False
    SetDialogProperty>Dialog1,COC_CHECKBOX,Visible,False
  Else>CHECKBOX=False
    SetDialogProperty>Dialog1,MSButton1,Enabled,False
    SetDialogProperty>Dialog1,COQ_CHECKBOX,Visible,True
    SetDialogProperty>Dialog1,COK_WEST_CHECKBOX,Visible,True
    SetDialogProperty>Dialog1,COC_CHECKBOX,Visible,True
  Endif
END>COKSELECTEDROUTINE
SRT>COQSELECTEDROUTINE
  GetDialogProperty>Dialog1,COQ_CHECKBOX,Checked,CHECKBOX
  If>CHECKBOX=True
    SetDialogProperty>Dialog1,MSButton1,Enabled,True
    SetDialogProperty>Dialog1,COK_CHECKBOX,Visible,False
    SetDialogProperty>Dialog1,COK_WEST_CHECKBOX,Visible,False
    SetDialogProperty>Dialog1,COC_CHECKBOX,Visible,False
  Else>CHECKBOX=False
    SetDialogProperty>Dialog1,MSButton1,Enabled,False
    SetDialogProperty>Dialog1,COK_CHECKBOX,Visible,True
    SetDialogProperty>Dialog1,COK_WEST_CHECKBOX,Visible,True
    SetDialogProperty>Dialog1,COC_CHECKBOX,Visible,True
  Endif
END>COQSELECTEDROUTINE
SRT>COCSELECTEDROUTINE
  GetDialogProperty>Dialog1,COC_CHECKBOX,Checked,CHECKBOX
  If>CHECKBOX=True
    SetDialogProperty>Dialog1,MSButton1,Enabled,True
    SetDialogProperty>Dialog1,COK_CHECKBOX,Visible,False
    SetDialogProperty>Dialog1,COK_WEST_CHECKBOX,Visible,False
    SetDialogProperty>Dialog1,COQ_CHECKBOX,Visible,False
  Else>CHECKBOX=False
    SetDialogProperty>Dialog1,MSButton1,Enabled,False
    SetDialogProperty>Dialog1,COK_CHECKBOX,Visible,True
    SetDialogProperty>Dialog1,COK_WEST_CHECKBOX,Visible,True
    SetDialogProperty>Dialog1,COQ_CHECKBOX,Visible,True
  Endif
END>COCSELECTEDROUTINE
SRT>COKWESTSELECTEDROUTINE
  GetDialogProperty>Dialog1,COK_WEST_CHECKBOX,Checked,CHECKBOX
  If>CHECKBOX=True
    SetDialogProperty>Dialog1,MSButton1,Enabled,True
    SetDialogProperty>Dialog1,COK_CHECKBOX,Visible,False
    SetDialogProperty>Dialog1,COC_CHECKBOX,Visible,False
    SetDialogProperty>Dialog1,COQ_CHECKBOX,Visible,False
  Else>CHECKBOX=False
    SetDialogProperty>Dialog1,MSButton1,Enabled,False
    SetDialogProperty>Dialog1,COK_CHECKBOX,Visible,True
    SetDialogProperty>Dialog1,COC_CHECKBOX,Visible,True
    SetDialogProperty>Dialog1,COQ_CHECKBOX,Visible,True
  Endif
END>COKWESTSELECTEDROUTINE
Dialog>QUEENSBOTMENU
object QUEENSBOTMENU: TForm
  Left = 372
  Top = 364
  HelpContext = 5000
  BorderIcons = [biSystemMenu]
  Caption = 'QUEENSBOT_2.0'
  ClientHeight = 836
  ClientWidth = 1488
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object QUEENSBOTBANNERIMAGE: tMSImage
    Left = 488
    Top = 0
    Width = 1001
    Height = 297
  end
  object EMULATORPLACE: TPanel
    Left = -2
    Top = -5
    Width = 491
    Height = 846
    Caption = 'CLICK HERE TO POSITION NOX'
    Font.Charset = ANSI_CHARSET
    Font.Color = clBlack
    Font.Height = -24
    Font.Name = 'Should'#39've Known Shaded'
    Font.Style = [fsUnderline]
    ParentFont = False
    TabOrder = 0
    object EMMYLOCATEBUTTON: tMSButton
      Left = 35
      Top = 440
      Width = 422
      Height = 25
      Caption = 'CLICK HERE'
      TabOrder = 0
      DoBrowse = False
      BrowseStyle = fbOpen
    end
  end
  object MSButton1: tMSButton
    Left = 496
    Top = 308
    Width = 97
    Height = 45
    Caption = 'QUIT BOT'
    TabOrder = 8
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object MSButton2: tMSButton
    Left = 608
    Top = 308
    Width = 97
    Height = 45
    Caption = 'START BOT'
    TabOrder = 10
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object MSButton3: tMSButton
    Left = 720
    Top = 308
    Width = 97
    Height = 45
    Caption = 'PAUSE BOT'
    TabOrder = 1
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object MSButton4: tMSButton
    Left = 944
    Top = 308
    Width = 97
    Height = 45
    Caption = 'RESET BOT'
    TabOrder = 2
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object UPDATEBUTTON: tMSButton
    Left = 496
    Top = 372
    Width = 97
    Height = 45
    Caption = 'UPDATER'
    TabOrder = 3
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object MSButton6: tMSButton
    Left = 608
    Top = 372
    Width = 97
    Height = 45
    Caption = 'MSButton1'
    TabOrder = 4
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object MSButton7: tMSButton
    Left = 720
    Top = 372
    Width = 97
    Height = 45
    Caption = 'MSButton1'
    TabOrder = 5
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object MSButton8: tMSButton
    Left = 832
    Top = 372
    Width = 97
    Height = 45
    Caption = 'MSButton1'
    TabOrder = 6
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object MSButton9: tMSButton
    Left = 832
    Top = 308
    Width = 97
    Height = 45
    Caption = 'STOP BOT'
    TabOrder = 7
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object MSButton10: tMSButton
    Left = 944
    Top = 372
    Width = 97
    Height = 45
    Caption = 'MSButton1'
    TabOrder = 9
    DoBrowse = False
    BrowseStyle = fbOpen
  end
end
EndDialog>QUEENSBOTMENU
Dialog>KINGSBOTMENU
object KINGSBOTMENU: TForm
  Left = 106
  Top = 71
  HelpContext = 5000
  BorderIcons = [biSystemMenu]
  Caption = 'KINGSBOT_2.0'
  ClientHeight = 836
  ClientWidth = 1488
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object KINGSBOTBANNERIMAGE: tMSImage
    Left = 488
    Top = 0
    Width = 1001
    Height = 297
  end
  object EMULATORPLACE: TPanel
    Left = -2
    Top = -5
    Width = 491
    Height = 846
    Caption = 'CLICK HERE TO POSITION NOX'
    Font.Charset = ANSI_CHARSET
    Font.Color = clBlack
    Font.Height = -24
    Font.Name = 'Should'#39've Known Shaded'
    Font.Style = [fsUnderline]
    ParentFont = False
    TabOrder = 0
    object EMMYLOCATEBUTTON: tMSButton
      Left = 35
      Top = 440
      Width = 422
      Height = 25
      Caption = 'CLICK HERE'
      TabOrder = 0
      DoBrowse = False
      BrowseStyle = fbOpen
    end
  end
end
EndDialog>KINGSBOTMENU
Dialog>KINGSWESTBOTMENU
object KINGSWESTBOTMENU: TForm
  Left = 154
  Top = 96
  HelpContext = 5000
  BorderIcons = [biSystemMenu]
  Caption = 'KINGSWESTBOT_2.0'
  ClientHeight = 836
  ClientWidth = 1488
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object KINGSWESTBOTBANNERIMAGE: tMSImage
    Left = 488
    Top = 0
    Width = 1001
    Height = 297
  end
  object EMULATORPLACE: TPanel
    Left = -2
    Top = -5
    Width = 491
    Height = 846
    Caption = 'CLICK HERE TO POSITION NOX'
    Font.Charset = ANSI_CHARSET
    Font.Color = clBlack
    Font.Height = -24
    Font.Name = 'Should'#39've Known Shaded'
    Font.Style = [fsUnderline]
    ParentFont = False
    TabOrder = 0
    object EMMYLOCATEBUTTON: tMSButton
      Left = 35
      Top = 440
      Width = 422
      Height = 25
      Caption = 'CLICK HERE'
      TabOrder = 0
      DoBrowse = False
      BrowseStyle = fbOpen
    end
  end
end
EndDialog>KINGSWESTBOTMENU
Dialog>CLANSBOTMENU
object CLANSBOTMENU: TForm
  Left = 270
  Top = 84
  HelpContext = 5000
  BorderIcons = [biSystemMenu]
  Caption = 'CLANSBOT_2.0'
  ClientHeight = 836
  ClientWidth = 1488
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object CLANSBOTBANNERIMAGE: tMSImage
    Left = 488
    Top = 0
    Width = 1001
    Height = 297
  end
  object EMULATORPLACE: TPanel
    Left = -2
    Top = -5
    Width = 491
    Height = 846
    Caption = 'CLICK HERE TO POSITION NOX'
    Font.Charset = ANSI_CHARSET
    Font.Color = clBlack
    Font.Height = -24
    Font.Name = 'Should'#39've Known Shaded'
    Font.Style = [fsUnderline]
    ParentFont = False
    TabOrder = 0
    object EMMYLOCATEBUTTON: tMSButton
      Left = 35
      Top = 440
      Width = 422
      Height = 25
      Caption = 'CLICK HERE'
      TabOrder = 0
      DoBrowse = False
      BrowseStyle = fbOpen
    end
  end
end
EndDialog>CLANSBOTMENU

Label>BEFORETHESHOW
ExportData>LOGFILE,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\
SetDialogProperty>Dialog1,CLASHOFKINGSICONIMAGE,LoadImage,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\PNG__0002_CLASHOFKINGSICONIMAGE.png
SetDialogProperty>Dialog1,tMSImage,LoadBitmap,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\PNG__0002_CLASHOFKINGSICONIMAGE.png
SetDialogProperty>Dialog1,CLASHOFKINGSINTOWESTICONIMAGE,LoadImage,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\PNG__0001_CLASHOFKINGSINTOTHEWESTICONIMAGE.png
SetDialogProperty>Dialog1,tMSImage,LoadBitmap,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\PNG__0001_CLASHOFKINGSINTOTHEWESTICONIMAGE.png
SetDialogProperty>Dialog1,CLASHOFQUEENSICONIMAGE,LoadImage,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\PNG__0000_CLASHOFQUEENSICONIMAGE.png
SetDialogProperty>Dialog1,tMSImage,LoadBitmap,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\PNG__0000_CLASHOFQUEENSICONIMAGE.png
SetDialogProperty>Dialog1,CLASHOFCLANSICONIMAGE,LoadImage,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\PNG__0003_CLASHOFCLANSICONIMAGE.png
SetDialogProperty>Dialog1,tMSImage,LoadBitmap,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\PNG__0003_CLASHOFCLANSICONIMAGE.png
AddDialogHandler>Dialog1,COK_CHECKBOX,OnClick,COKSELECTEDROUTINE
AddDialogHandler>Dialog1,COQ_CHECKBOX,OnClick,COQSELECTEDROUTINE
AddDialogHandler>Dialog1,COC_CHECKBOX,OnClick,COCSELECTEDROUTINE
AddDialogHandler>Dialog1,COK_WEST_CHECKBOX,OnClick,COKWESTSELECTEDROUTINE
SetDialogProperty>Dialog1,MSButton1,Enabled,False
Show>Dialog1,ModalResult
If>ModalResult=1
  //Check Which App Was Selected
  GetDialogProperty>Dialog1,COK_CHECKBOX,Checked,COKSELECTED
  GetDialogProperty>Dialog1,COQ_CHECKBOX,Checked,COQSELECTED
  GetDialogProperty>Dialog1,COK_WEST_CHECKBOX,Checked,COKWESTSELECTED
  GetDialogProperty>Dialog1,COC_CHECKBOX,Checked,COCSELECTED
  If>COQSELECTED=True
      SRT>DoProgressCOQ
        Let>STATUSCOQ=%intMin%
        Let>LOADINGENDCOQ=%intMax%
        Repeat>STATUSCOQ
          Let>STATUSCOQ=STATUSCOQ+10
          SetDialogProperty>Dialog2,COQLOADINGBAR,Position,STATUSCOQ
          If>STATUSCOQ>%intMax%
            GoTo>EndProgressCOQ
          EndIf
          Wait>0.001
        Until>STATUSCOQ=intMax
        Label>EndProgressCOQ
        CloseDialog>Dialog2
      END>DoProgressCOQ
      ExportData>LOADINGFILE001,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\
      SetDialogProperty>Dialog2,CLASHOFQUEENSLOADINGIMAGE,LoadImage,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\CLASHOFQUEENSLOADINGIMAGE.png
      SetDialogProperty>Dialog2,tMSImage,LoadBitmap,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\CLASHOFQUEENSLOADINGIMAGE.png
      SetDialogProperty>Dialog2,COQLOADINGBAR,Position,STATUSCOQ
      GetDialogProperty>Dialog2,COQLOADINGBAR,Min,intMin
      GetDialogProperty>Dialog2,COQLOADINGBAR,Max,intMax
      AddDialogHandler>Dialog2,,OnActivate,DoProgressCOQ
      Show>Dialog2
      GoTo>DONEONMENUONE
  Else>COQSELECTED=False
    If>COKSELECTED=True
      SRT>DoProgressCOK
        Let>STATUSCOK=%intMin%
        Let>LOADINGENDCOK=%intMax%
        Repeat>STATUSCOK
          Let>STATUSCOK=STATUSCOK+10
          SetDialogProperty>Dialog3,COKLOADINGBAR,Position,STATUSCOK
          If>STATUSCOK>%intMax%
            CloseDialog>Dialog3
            GoTo>EndProgressCOK
          EndIf
          Wait>0.005
        Until>STATUSCOK=%LOADINGENDCOK%
        Label>EndProgressCOK
        CloseDialog>Dialog3
      END>DoProgressCOK
      ExportData>LOADINGFILE002,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\
      SetDialogProperty>Dialog3,CLASHOFKINGSLOADINGIMAGE,LoadImage,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\CLASHOFKINGSLOADINGIMAGE.png
      SetDialogProperty>Dialog3,tMSImage,LoadBitmap,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\CLASHOFKINGSLOADINGIMAGE.png
      SetDialogProperty>Dialog3,COKLOADINGBAR,Position,STATUSCOK
      GetDialogProperty>Dialog3,COKLOADINGBAR,Min,intMin
      GetDialogProperty>Dialog3,COKLOADINGBAR,Max,intMax
      AddDialogHandler>Dialog3,,OnActivate,DoProgressCOK
      Show>Dialog3
      GoTo>DONEONMENUONE
    Else>COKSELECTED=False
      If>COKWESTSELECTED=True
        SRT>DoProgressCOKWEST
          Let>STATUSCOKWEST=%intMin%
          Let>LOADINGENDCOKWEST=%intMax%
          Repeat>STATUSCOKWEST
            Let>STATUSCOKWEST=STATUSCOKWEST+10
            SetDialogProperty>Dialog4,COKWESTLOADINGBAR,Position,STATUSCOKWEST
            If>STATUSCOKWEST>%intMax%
              CloseDialog>Dialog4
              GoTo>EndProgressCOKWEST
            EndIf
            Wait>0.005
          Until>STATUSCOKWEST=%LOADINGENDCOKWEST%
          Label>EndProgressCOKWEST
          CloseDialog>Dialog4
        END>DoProgressCOKWEST
        ExportData>LOADINGFILE003,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\
        SetDialogProperty>Dialog4,CLASHOFKINGSWESTLOADINGIMAGE,LoadImage,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\CLASHOFKINGSWESTLOADINGIMAGE.png
        SetDialogProperty>Dialog4,tMSImage,LoadBitmap,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\CLASHOFKINGSWESTLOADINGIMAGE.png
        SetDialogProperty>Dialog4,COKWESTLOADINGBAR,Position,STATUSCOKWEST
        GetDialogProperty>Dialog4,COKWESTLOADINGBAR,Min,intMin
        GetDialogProperty>Dialog4,COKWESTLOADINGBAR,Max,intMax
        AddDialogHandler>Dialog4,,OnActivate,DoProgressCOKWEST
        Show>Dialog4
        GoTo>DONEONMENUONE
      Else>COKWESTSELECTED=False
        If>COCSELECTED=True
          SRT>DoProgressCOC
            Let>STATUSCOC=%intMin%
            Let>LOADINGENDCOC=%intMax%
            Repeat>STATUSCOC
              Let>STATUSCOC=STATUSCOC+10
              SetDialogProperty>Dialog5,COCLOADINGBAR,Position,STATUSCOC
              If>STATUSCOC>%intMax%
                CloseDialog>Dialog5
                GoTo>EndProgressCOC
              EndIf
              Wait>0.005
            Until>STATUSCOC=%LOADINGENDCOC%
            Label>EndProgressCOC
            CloseDialog>Dialog5
          END>DoProgressCOC
          ExportData>LOADINGFILE005,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\
          SetDialogProperty>Dialog5,CLASHOFCLANSLOADINGIMAGE,LoadImage,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\CLASHOFCLANSLOADINGIMAGE.png
          SetDialogProperty>Dialog5,tMSImage,LoadBitmap,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\CLASHOFCLANSLOADINGIMAGE.png
          SetDialogProperty>Dialog5,COCLOADINGBAR,Position,STATUSCOC
          GetDialogProperty>Dialog5,COCLOADINGBAR,Min,intMin
          GetDialogProperty>Dialog5,COCLOADINGBAR,Max,intMax
          AddDialogHandler>Dialog5,,OnActivate,DoProgressCOC
          Show>Dialog5
          GoTo>DONEONMENUONE
        Else>COCSELECTED=False
          GoTo>ENDAPPCHECK
        Endif
      Endif
    Endif
  Endif
  Label>ENDAPPCHECK
  MessageModal>NO APP WAS SELECTED TRY AGAIN
  GoTo>BEFORETHESHOW
Else>ModalResult<>1
  //Check What Happened?
  MessageModal>SERIOUS ERROR
Endif
Label>DONEONMENUONE
If>COKSELECTED=True
  SRT>KINGSBOT
    ExportData>BANNERFILE001,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\
    SetDialogProperty>KINGSBOTMENU,KINGSBOTBANNERIMAGE,LoadImage,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\PNG__0003_clash-of-kings.png
    SetDialogProperty>KINGSBOTMENU,tMSImage,LoadBitmap,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\PNG__0003_clash-of-kings.png
    SRT>DoCOKActivatePosition
      MoveWindow>KINGSBOT_2.0,0,0
      ResizeWindow>QUEENSBOT001,484,838
      MoveWindow>QUEENSBOT001,7,30
      SetFocus>QUEENSBOT001
    END>DoCOKActivatePosition
    AddDialogHandler>KINGSBOTMENU,,OnActivate,DoCOKActivatePosition
    AddDialogHandler>KINGSBOTMENU,EMMYLOCATEBUTTON,OnClick,DoCOKActivatePosition
    AddDialogHandler>KINGSBOTMENU,UPDATEBUTTON,OnClick,UPDATER
    Show>KINGSBOTMENU,
  END>KINGSBOT
  GoSub>KINGSBOT
  GoTo>TESTENDED
Endif
If>COQSELECTED=True
  SRT>QUEENSBOT
    ExportData>BANNERFILE002,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\
    SetDialogProperty>QUEENSBOTMENU,QUEENSBOTBANNERIMAGE,LoadImage,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\PNG__0004_Clash_of_Queens_604x423.png
    SetDialogProperty>QUEENSBOTMENU,tMSImage,LoadBitmap,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\PNG__0004_Clash_of_Queens_604x423.png
    SRT>DoCOQActivatePosition
      MoveWindow>QUEENSBOT_2.0,0,0
      ResizeWindow>QUEENSBOT001,484,838
      MoveWindow>QUEENSBOT001,7,30
      SetFocus>QUEENSBOT001
    END>DoCOQActivatePosition
    AddDialogHandler>QUEENSBOTMENU,,OnActivate,DoCOQActivatePosition
    AddDialogHandler>QUEENSBOTMENU,EMMYLOCATEBUTTON,OnClick,DoCOQActivatePosition
    AddDialogHandler>QUEENSBOTMENU,UPDATEBUTTON,OnClick,UPDATER
    Show>QUEENSBOTMENU,
  END>QUEENSBOT
  GoSub>QUEENSBOT
  GoTo>TESTENDED
Endif
If>COCSELECTED=True
  SRT>CLANSBOT
    ExportData>BANNERFILE003,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\
    SetDialogProperty>CLANSBOTMENU,CLANSBOTBANNERIMAGE,LoadImage,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\PNG__0001_Clash_of_Clans_FB_banner.png
    SetDialogProperty>CLANSBOTMENU,tMSImage,LoadBitmap,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\PNG__0001_Clash_of_Clans_FB_banner.png
    SRT>DoCOCActivatePosition
      MoveWindow>CLANSBOT_2.0,0,0
      ResizeWindow>QUEENSBOT001,484,838
      MoveWindow>QUEENSBOT001,7,30
      SetFocus>QUEENSBOT001
    END>DoCOCActivatePosition
    AddDialogHandler>CLANSBOTMENU,,OnActivate,DoCOCActivatePosition
    AddDialogHandler>CLANSBOTMENU,EMMYLOCATEBUTTON,OnClick,DoCOCActivatePosition
    AddDialogHandler>CLANSBOTMENU,UPDATEBUTTON,OnClick,UPDATER
    Show>CLANSBOTMENU,
  END>CLANSBOT
  GoSub>CLANSBOT
  GoTo>TESTENDED
Endif
If>COKWESTSELECTED=True
  SRT>COKWESTBOT
    ExportData>BANNERFILE004,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\
    SetDialogProperty>KINGSWESTBOTMENU,KINGSWESTBOTBANNERIMAGE,LoadImage,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\PNG__0000_maxresdefault.png
    SetDialogProperty>KINGSWESTBOTMENU,tMSImage,LoadBitmap,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\PNG__0000_maxresdefault.png
    SRT>DoCOKWESTActivatePosition
      MoveWindow>KINGSWESTBOT_2.0,0,0
      ResizeWindow>QUEENSBOT001,484,838
      MoveWindow>QUEENSBOT001,7,30
      SetFocus>QUEENSBOT001
    END>DoCOKWESTActivatePosition
    AddDialogHandler>KINGSWESTBOTMENU,,OnActivate,DoCOKWESTActivatePosition
    AddDialogHandler>KINGSWESTBOTMENU,EMMYLOCATEBUTTON,OnClick,DoCOKWESTActivatePosition
    AddDialogHandler>KINGSWESTBOTMENU,UPDATEBUTTON,OnClick,UPDATER
    Show>KINGSWESTBOTMENU,
  END>COKWESTBOT
  GoSub>COKWESTBOT
  GoTo>TESTENDED
Endif
Label>TESTENDED
SRT>UPDATER
ExecuteFile>C:\Users\ClashBOT\Documents\Macro Scheduler 14\!CLASH-OF-THE-BOTS!\UPDATER.exe,
END>UPDATER
Last edited by MadQuestion on Mon Nov 13, 2017 11:22 pm, edited 1 time in total.

MadQuestion
Pro Scripter
Posts: 70
Joined: Wed Nov 08, 2017 6:54 pm

Re: Closing Dialogs With Compiled EXE

Post by MadQuestion » Wed Nov 08, 2017 9:41 pm

To be fair it just seems like its only possible to close modal result dialogs Show>Dialog1,ModalResult within a compiled exe non modal dialogs Show>Dialog1, can not be closed by using the CloseDialog>Dialog1 Is there anyway to do this I have tried CloseWindow>Dialog1 = No luck!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Closing Dialogs With Compiled EXE

Post by Marcus Tettmar » Thu Nov 09, 2017 10:29 am

Not following this. CloseDialog will close any kind of dialog.

Try this simple example and compile it:

Code: Select all

Dialog>Dialog1
object Dialog1: TForm
  Left = 1295
  Top = 634
end
EndDialog>Dialog1

Show>Dialog1

Wait>5

CloseDialog>Dialog1

MDL>Done
Run it. The dialog opens, and then after 5 seconds it is closed and the message displays then the macro ends. Works the same whether compiled or not.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

MadQuestion
Pro Scripter
Posts: 70
Joined: Wed Nov 08, 2017 6:54 pm

Re: Closing Dialogs With Compiled EXE

Post by MadQuestion » Thu Nov 09, 2017 9:12 pm

Hi Marcus Thanks For The Help. I have tried compiling the script you gave and yes the dialog window will close when I run the script. Could you perhaps look at the script I have written and tell me if I have written it incorrectly or have the wrong syntax perhaps?

This is the script that wont work

Code: Select all

//Open Dialog1 Modal Dialog Waits For User Input
Show>Dialog1,ModalResult

//Check User Input For Dialog1
If>ModalResult=1
  //Get the dialog properties for dialog1
  GetDialogProperty>Dialog1,COK_CHECKBOX,Checked,COKSELECTED
  GetDialogProperty>Dialog1,COQ_CHECKBOX,Checked,COQSELECTED
  GetDialogProperty>Dialog1,COK_WEST_CHECKBOX,Checked,COKWESTSELECTED
  GetDialogProperty>Dialog1,COC_CHECKBOX,Checked,COCSELECTED

//This is where the script chooses one of four dialogs with a status bar depending on the users input to dialog1
  If>COQSELECTED=True
//Sub Routine For Filling The Loading Bar
      SRT>DoProgressCOQ
        Let>STATUSCOQ=%intMin%
        Let>LOADINGENDCOQ=%intMax%
        Repeat>STATUSCOQ
          Let>STATUSCOQ=STATUSCOQ+10
          SetDialogProperty>Dialog2,COQLOADINGBAR,Position,STATUSCOQ
          If>STATUSCOQ>%intMax%
            GoTo>EndProgressCOQ
          EndIf
          Wait>0.001
        Until>STATUSCOQ=intMax
//Exit Loading Bar Routine Label
        Label>EndProgressCOQ
//This Should Close The Loading Screen Dialog2 But Not In exe only?
        CloseDialog>Dialog2
//This is the end of the loading dialog routine
     END>DoProgressCOQ
Endif
//Prepare the data for main menu 
      ExportData>LOADINGFILE001,DIR
      SetDialogProperty>Dialog2,CLASHOFQUEENSLOADINGIMAGE,LoadImage,DIR.png
      SetDialogProperty>Dialog2,tMSImage,LoadBitmap,DIR.png
//Set initial state of loading bar
      SetDialogProperty>Dialog2,COQLOADINGBAR,Position,STATUSCOQ
      GetDialogProperty>Dialog2,COQLOADINGBAR,Min,intMin
      GetDialogProperty>Dialog2,COQLOADINGBAR,Max,intMax
      AddDialogHandler>Dialog2,,OnActivate,DoProgressCOQ
//Show loading dialog2
      Show>Dialog2
//Start New Main Menu
      GoTo>DONEONMENUONE
Actually while I was getting this post ready I realised that my CloseDialog>Dialog2 was inside both the Progress Bar SRT> and the If> When I moved the CloseDialog>Dialog2 to after the Endif of the If> the issues was no more and the script behaved itself. So thought I would go ahead with this post and help others who come across this issue as well or if they make similar mistakes like I did. This forum is a great help to me at times of stress........

Here is the working correction of the above script for those who are interested.

Code: Select all

Show>Dialog1,ModalResult
If>ModalResult=1
  //Check Which App Was Selected
  GetDialogProperty>Dialog1,COK_CHECKBOX,Checked,COKSELECTED
  GetDialogProperty>Dialog1,COQ_CHECKBOX,Checked,COQSELECTED
  GetDialogProperty>Dialog1,COK_WEST_CHECKBOX,Checked,COKWESTSELECTED
  GetDialogProperty>Dialog1,COC_CHECKBOX,Checked,COCSELECTED
  If>COQSELECTED=True
      SRT>DoProgressCOQ
        Let>STATUSCOQ=%intMin%
        Let>LOADINGENDCOQ=%intMax%
        Repeat>STATUSCOQ
          Let>STATUSCOQ=STATUSCOQ+10
          SetDialogProperty>Dialog2,COQLOADINGBAR,Position,STATUSCOQ
          If>STATUSCOQ>%intMax%
            CloseDialog>Dialog2
            GoTo>EndProgressCOQ
          EndIf
          Wait>0.001
        Until>STATUSCOQ=intMax
        Label>EndProgressCOQ
//I REMOVED THE CloseDialog>Dialog2 From Here
      END>DoProgressCOQ
Endif
      ExportData>LOADINGFILE001,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\
      SetDialogProperty>Dialog2,CLASHOFQUEENSLOADINGIMAGE,LoadImage,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\CLASHOFQUEENSLOADINGIMAGE.png
      SetDialogProperty>Dialog2,tMSImage,LoadBitmap,C:\Users\ClashBOT\Pictures\!CLASH_OF_BOTS!\EXPORTED\CLASHOFQUEENSLOADINGIMAGE.png
      SetDialogProperty>Dialog2,COQLOADINGBAR,Position,STATUSCOQ
      GetDialogProperty>Dialog2,COQLOADINGBAR,Min,intMin
      GetDialogProperty>Dialog2,COQLOADINGBAR,Max,intMax
      AddDialogHandler>Dialog2,,OnActivate,DoProgressCOQ
      Show>Dialog2
//And Placed it at a logical point..... After the Show>Dialog2......
      CloseDialog>Dialog2
      GoTo>DONEONMENUONE
//The Loading Screen Dialog Now Closes When Compiled.
The lesson I learned was when it seems like a bug 99.99% of the time its likely down to user errors.

Scones
Junior Coder
Posts: 32
Joined: Fri Jul 05, 2019 11:21 am

Re: Closing Dialogs With Compiled EXE

Post by Scones » Tue Mar 10, 2020 9:08 am

I am having this issue, but the solution presented in the end is not working for me

To sum up the issue, so you don't have to read this old post:

CloseDialog doesn't seem to always work in compiled scripts

MadQuestion seemed to find out that it works when he puts it outside his SRT's


This is my script (simplified)

Code: Select all

Dialog>MainDialog
object MainDialog: TForm
  Left = 2637
  Top = 101
  HelpContext = 5000
  BorderIcons = [biSystemMenu]
  Caption = 'Macro Control Panel'
  ClientHeight = 131
  ClientWidth = 553
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object OneU: tMSButton
    Left = 66
    Top = 24
    Width = 407
    Height = 54
    Caption = 'UPDATE'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 0
    DoBrowse = False
    BrowseStyle = fbOpen
  end
end
EndDialog>MainDialog
AddDialogHandler>MainDialog,OneU,OnClick,OneStats

Label>Main
CloseDialog>MainDialog
MDL CloseDialog done
Show MainDialog,r

//One Stats
SRT>OneStats
let>DECIMAL_SEPARATOR=.
ReadFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Statistik\QTNOT til Artios\Dkpbrsc.txt,DKPBRSC1
ReadFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Statistik\QTNOT til Artios\DKPERNI.txt,DKPERNI1
ReadFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Statistik\QTNOT til Artios\dkjurroh.txt,DKJURROH1
ReadFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Statistik\QTNOT til Artios\dkptana.txt,DKPTANA1
ReadFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Statistik\QTNOT til Artios\DKPTHSK.txt,DKPTHSK1
ReadFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Statistik\QTNOT til Artios\dkkassva.txt,dkkassva1
Separate>DKPBRSC1,CRLF,DKPBRSC_Arr1
Separate>DKPERNI1,CRLF,DKPERNI_Arr1
Separate>DKJURROH1,CRLF,DKJURROH_Arr1
Separate>DKPTANA1,CRLF,DKPTANA_Arr1
Separate>DKPTHSK1,CRLF,DKPTHSK_Arr1
ArrayCount>DKPBRSC_Arr1,DKPBRSC_Count1
ArrayCount>DKPERNI_Arr1,DKPERNI_Count1
ArrayCount>DKJURROH_Arr1,DKJURROH_Count1
ArrayCount>DKPTANA_Arr1,DKPTANA_Count1
ArrayCount>DKPTHSK_Arr1,DKPTHSK_Count1
Let>Collective1={%DKPBRSC_Count1%+%DKPERNI_Count1%+%DKJURROH_Count1%+%DKPTANA_Count1%+%DKPTHSK_Count1%}
Let>Executes1=%Collective1%
Let>Seconds1=%Executes1%*15
Let>Minutes1=%Seconds1%/60
Let>Hours1=%Minutes1%/60
Let>HourRate1=700
Let>CostSave1=%Hours1%*%HourRate1%
Let>ExecutesRounded1={round (%Executes1%)}
Let>HoursRounded1={round (%Hours1%)}
Let>CostSaveRounded1={round (%CostSave1%)}
SetDialogProperty>MainDialog,OneExecutions,Caption,All time: %ExecutesRounded1%
SetDialogProperty>MainDialog,OneTimeSaved,Caption,All time: %HoursRounded1% hrs
SetDialogProperty>MainDialog,OneCostSaved,Caption,All time: %CostSaveRounded1% DKK
SkipLabel>Main
END>OneStats
If you compile this script, You shouldn't be able to close the dialog.

As you can see, i did what MadQuestion suggested and moved the CloseDialog outside the SRT.

Before i did that, the CloseWindow was inside the SRT at the very end, which did not work either.

The SkipLabel does work because the MDL shows up, but CloseDialog does nothing.


Edit: Here is my full script, if you need to know what i'm trying to accomplish.

Code: Select all

// COMPILE_OPTS|\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Compiled\Macro Control Panel.exe||CONSOLE=0|INCLUDES=1| /LOGFILE=\dev\nul /NOSYSTRAY|RUNTIMES=1|BMPS=1

//Dialogs
//MainDialog
Dialog>MainDialog
object MainDialog: TForm
  Left = 284
  Top = 128
  HelpContext = 5000
  BorderIcons = [biSystemMenu]
  Caption = 'Macro Control Panel'
  ClientHeight = 502
  ClientWidth = 1444
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object Label1: TLabel
    Left = 48
    Top = 8
    Width = 364
    Height = 36
    Caption = 'DS Smith Macro Control Panel'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -29
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object OneExecutions: TLabel
    Left = 48
    Top = 120
    Width = 84
    Height = 19
    Caption = 'Press update'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = []
    ParentFont = False
  end
  object OneTimeSaved: TLabel
    Left = 160
    Top = 120
    Width = 84
    Height = 19
    Caption = 'Press update'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = []
    ParentFont = False
  end
  object OneCostSaved: TLabel
    Left = 280
    Top = 120
    Width = 84
    Height = 19
    Caption = 'Press update'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = []
    ParentFont = False
  end
  object OneTitle: TLabel
    Left = 48
    Top = 64
    Width = 140
    Height = 26
    Caption = 'QTNOT til Artios'
    Color = clGreen
    Font.Charset = ANSI_CHARSET
    Font.Color = clMaroon
    Font.Height = -21
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentColor = False
    ParentFont = False
  end
  object Label4: TLabel
    Left = 48
    Top = 96
    Width = 72
    Height = 19
    Caption = 'Executions'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object afgadsfg: TLabel
    Left = 160
    Top = 96
    Width = 76
    Height = 19
    Caption = 'Time saved'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object asdfsdf: TLabel
    Left = 280
    Top = 96
    Width = 72
    Height = 19
    Caption = 'Cost saved'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label13: TLabel
    Left = 760
    Top = 64
    Width = 216
    Height = 26
    Caption = 'Grouped output - Display'
    Font.Charset = ANSI_CHARSET
    Font.Color = clGreen
    Font.Height = -21
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label22: TLabel
    Left = 40
    Top = 224
    Width = 140
    Height = 26
    Caption = 'QTNOT til Artios'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -21
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label26: TLabel
    Left = 187
    Top = 224
    Width = 55
    Height = 26
    Caption = 'Active'
    Font.Charset = ANSI_CHARSET
    Font.Color = clGreen
    Font.Height = -21
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label30: TLabel
    Left = 752
    Top = 224
    Width = 140
    Height = 26
    Caption = 'QTNOT til Artios'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -21
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label34: TLabel
    Left = 899
    Top = 224
    Width = 55
    Height = 26
    Caption = 'Active'
    Font.Charset = ANSI_CHARSET
    Font.Color = clGreen
    Font.Height = -21
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label18: TLabel
    Left = 48
    Top = 344
    Width = 90
    Height = 57
    Alignment = taRightJustify
    Caption = 'All time: 4271'#13#10'30 days: 344'#13#10'Year: 4271'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = []
    ParentFont = False
  end
  object Label19: TLabel
    Left = 182
    Top = 344
    Width = 106
    Height = 57
    Alignment = taRightJustify
    Caption = 'All time: 120 hrs'#13#10'30 days: 10 hrs'#13#10'Year: 120 hrs'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = []
    ParentFont = False
  end
  object Label20: TLabel
    Left = 312
    Top = 344
    Width = 107
    Height = 57
    Alignment = taRightJustify
    Caption = 'All time: 84000,-'#13#10'30 days: 7000,-'#13#10'Year: 84000,-'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = []
    ParentFont = False
  end
  object Label21: TLabel
    Left = 48
    Top = 288
    Width = 121
    Height = 26
    Caption = 'PDF til variant'
    Font.Charset = ANSI_CHARSET
    Font.Color = clMaroon
    Font.Height = -21
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label23: TLabel
    Left = 48
    Top = 320
    Width = 72
    Height = 19
    Caption = 'Executions'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label24: TLabel
    Left = 168
    Top = 320
    Width = 76
    Height = 19
    Caption = 'Time saved'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label25: TLabel
    Left = 312
    Top = 320
    Width = 72
    Height = 19
    Caption = 'Cost saved'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label28: TLabel
    Left = 760
    Top = 344
    Width = 90
    Height = 57
    Alignment = taRightJustify
    Caption = 'All time: 4271'#13#10'30 days: 344'#13#10'Year: 4271'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = []
    ParentFont = False
  end
  object Label29: TLabel
    Left = 894
    Top = 344
    Width = 106
    Height = 57
    Alignment = taRightJustify
    Caption = 'All time: 120 hrs'#13#10'30 days: 10 hrs'#13#10'Year: 120 hrs'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = []
    ParentFont = False
  end
  object Label31: TLabel
    Left = 1024
    Top = 344
    Width = 107
    Height = 57
    Alignment = taRightJustify
    Caption = 'All time: 84000,-'#13#10'30 days: 7000,-'#13#10'Year: 84000,-'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = []
    ParentFont = False
  end
  object Label32: TLabel
    Left = 760
    Top = 288
    Width = 72
    Height = 26
    Caption = 'Edit PDF'
    Font.Charset = ANSI_CHARSET
    Font.Color = clMaroon
    Font.Height = -21
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label33: TLabel
    Left = 760
    Top = 320
    Width = 72
    Height = 19
    Caption = 'Executions'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label35: TLabel
    Left = 880
    Top = 320
    Width = 76
    Height = 19
    Caption = 'Time saved'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label36: TLabel
    Left = 1024
    Top = 320
    Width = 72
    Height = 19
    Caption = 'Cost saved'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object TwoExecutions: TLabel
    Left = 760
    Top = 120
    Width = 84
    Height = 19
    Caption = 'Press update'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = []
    ParentFont = False
  end
  object TwoTimeSaved: TLabel
    Left = 872
    Top = 120
    Width = 84
    Height = 19
    Caption = 'Press update'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = []
    ParentFont = False
  end
  object TwoCostSaved: TLabel
    Left = 992
    Top = 120
    Width = 84
    Height = 19
    Caption = 'Press update'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = []
    ParentFont = False
  end
  object Label6: TLabel
    Left = 760
    Top = 96
    Width = 72
    Height = 19
    Caption = 'Executions'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label7: TLabel
    Left = 872
    Top = 96
    Width = 76
    Height = 19
    Caption = 'Time saved'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label8: TLabel
    Left = 992
    Top = 96
    Width = 72
    Height = 19
    Caption = 'Cost saved'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Panel1: TPanel
    Left = 8
    Top = 56
    Width = 705
    Height = 209
    TabOrder = 0
  end
  object OneNM: tMSButton
    Left = 576
    Top = 160
    Width = 121
    Height = 87
    Hint =
      'Renames original macro to real macro name, so shortcuts are set ' +
      'to the macro again'
    Caption = 'Normal'#13#10'mode'
    Font.Charset = ANSI_CHARSET
    Font.Color = clGreen
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = []
    ParentFont = False
    TabOrder = 1
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object OneMM: tMSButton
    Left = 576
    Top = 74
    Width = 121
    Height = 87
    Hint =
      'Kills all instances and renames Maintenance script to this macro' +
      #39's name. Now all shortcuts lead to the maintenance script instea' +
      'd'
    Caption = 'Maintenance'#13#10'mode'
    Font.Charset = ANSI_CHARSET
    Font.Color = clOlive
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = []
    ParentFont = False
    TabOrder = 2
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object OneKA: tMSButton
    Left = 456
    Top = 74
    Width = 121
    Height = 87
    Hint =
      'Sends SHUTDOWN to a txt file that is continuesly read by abort s' +
      'cripts on all active clients'
    Caption = 'Kill all'#13#10'instances'
    Font.Charset = ANSI_CHARSET
    Font.Color = clMaroon
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = []
    ParentFont = False
    TabOrder = 3
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object OneCR: tMSButton
    Left = 456
    Top = 160
    Width = 121
    Height = 87
    Hint =
      'Kills all instances and renames Offline script to this macro'#39's n' +
      'ame. Now all shortcuts lead to the offline script instead'
    Caption = 'Offline'#13#10'mode'
    Font.Charset = ANSI_CHARSET
    Font.Color = clMaroon
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = []
    ParentFont = False
    TabOrder = 4
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object OneU: tMSButton
    Left = 34
    Top = 192
    Width = 407
    Height = 54
    Caption = 'UPDATE'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 5
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object Panel2: TPanel
    Left = 720
    Top = 56
    Width = 705
    Height = 209
    TabOrder = 6
  end
  object MSButton6: tMSButton
    Left = 1288
    Top = 160
    Width = 121
    Height = 87
    Caption = 'Normal'#13#10'mode'
    Font.Charset = ANSI_CHARSET
    Font.Color = clGreen
    Font.Height = -13
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 7
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object MSButton7: tMSButton
    Left = 1288
    Top = 74
    Width = 121
    Height = 87
    Caption = 'Maintenance'#13#10'mode'
    Font.Charset = ANSI_CHARSET
    Font.Color = clOlive
    Font.Height = -13
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 9
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object MSButton8: tMSButton
    Left = 1168
    Top = 74
    Width = 121
    Height = 87
    Caption = 'Kill all'#13#10'instances'
    Font.Charset = ANSI_CHARSET
    Font.Color = clMaroon
    Font.Height = -13
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 11
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object MSButton9: tMSButton
    Left = 1168
    Top = 160
    Width = 121
    Height = 87
    Caption = 'Offline'#13#10'mode'
    Font.Charset = ANSI_CHARSET
    Font.Color = clMaroon
    Font.Height = -13
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 13
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object TwoU: tMSButton
    Left = 746
    Top = 192
    Width = 407
    Height = 54
    Caption = 'UPDATE'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 15
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object Panel3: TPanel
    Left = 8
    Top = 280
    Width = 705
    Height = 209
    TabOrder = 17
  end
  object MSButton11: tMSButton
    Left = 576
    Top = 384
    Width = 121
    Height = 87
    Caption = 'Normal'#13#10'mode'
    Font.Charset = ANSI_CHARSET
    Font.Color = clGreen
    Font.Height = -13
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 19
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object MSButton12: tMSButton
    Left = 576
    Top = 298
    Width = 121
    Height = 87
    Caption = 'Maintenance'#13#10'mode'
    Font.Charset = ANSI_CHARSET
    Font.Color = clOlive
    Font.Height = -13
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 21
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object MSButton13: tMSButton
    Left = 456
    Top = 298
    Width = 121
    Height = 87
    Caption = 'Kill all'#13#10'instances'
    Font.Charset = ANSI_CHARSET
    Font.Color = clMaroon
    Font.Height = -13
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 23
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object MSButton14: tMSButton
    Left = 456
    Top = 384
    Width = 121
    Height = 87
    Caption = 'Offline'#13#10'mode'
    Font.Charset = ANSI_CHARSET
    Font.Color = clMaroon
    Font.Height = -13
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 8
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object MSButton15: tMSButton
    Left = 34
    Top = 416
    Width = 407
    Height = 54
    Caption = 'UPDATE'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 10
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object Panel4: TPanel
    Left = 727
    Top = 280
    Width = 698
    Height = 209
    TabOrder = 12
  end
  object MSButton16: tMSButton
    Left = 1288
    Top = 384
    Width = 121
    Height = 87
    Caption = 'Normal'#13#10'mode'
    Font.Charset = ANSI_CHARSET
    Font.Color = clGreen
    Font.Height = -13
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 14
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object MSButton17: tMSButton
    Left = 1288
    Top = 298
    Width = 121
    Height = 87
    Caption = 'Maintenance'#13#10'mode'
    Font.Charset = ANSI_CHARSET
    Font.Color = clOlive
    Font.Height = -13
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 16
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object MSButton18: tMSButton
    Left = 1168
    Top = 298
    Width = 121
    Height = 87
    Caption = 'Kill all'#13#10'instances'
    Font.Charset = ANSI_CHARSET
    Font.Color = clMaroon
    Font.Height = -13
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 18
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object MSButton19: tMSButton
    Left = 1168
    Top = 384
    Width = 121
    Height = 87
    Caption = 'Offline'#13#10'mode'
    Font.Charset = ANSI_CHARSET
    Font.Color = clMaroon
    Font.Height = -13
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 20
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object MSButton20: tMSButton
    Left = 746
    Top = 416
    Width = 407
    Height = 54
    Caption = 'UPDATE'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Calibri'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 22
    DoBrowse = False
    BrowseStyle = fbOpen
  end
end
EndDialog>MainDialog
AddDialogHandler>MainDialog,OneKA,OnClick,OneKA_CLICK
AddDialogHandler>MainDialog,OneMM,OnClick,OneMM_CLICK
AddDialogHandler>MainDialog,OneNM,OnClick,OneNM_CLICK
AddDialogHandler>MainDialog,OneU,OnClick,OneStats
AddDialogHandler>MainDialog,TwoU,OnClick,TwoStats

IfFileExists>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Compiled\QTNOT til Artios - UNDER MAINTENANCE.exe
  SetDialogObjectFont>MainDialog,OneTitle,Calibri,16,1,32896
  SetDialogObjectFont>MainDialog,OneMM,Calibri,12,1,32896
  SetDialogObjectFont>MainDialog,OneNM,Calibri,12,0,32768
Else
  SetDialogObjectFont>MainDialog,OneTitle,Calibri,16,1,32768
  SetDialogObjectFont>MainDialog,OneNM,Calibri,12,1,32768
  SetDialogObjectFont>MainDialog,OneMM,Calibri,12,0,32896
Endif

//Wait_Kill_Dialog
Dialog>Wait_Kill_Dialog
object Wait_Kill_Dialog: TForm
  Left = 974
  Top = 130
  HelpContext = 5000
  BorderIcons = [biSystemMenu]
  Caption = 'Wait 5 seconds'
  ClientHeight = 137
  ClientWidth = 476
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object Label1: TLabel
    Left = 131
    Top = 32
    Width = 213
    Height = 19
    Caption = 'Waiting for abort scripts to finish'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = []
    ParentFont = False
  end
  object PGB: TProgressBar
    Left = 69
    Top = 73
    Width = 338
    Height = 32
    TabOrder = 0
  end
end
EndDialog>Wait_Kill_Dialog

//OneKA_Dialog
Dialog>OneKA_Dialog
object OneKA_Dialog: TForm
  Left = 776
  Top = 138
  HelpContext = 5000
  BorderIcons = [biSystemMenu]
  Caption = 'CustomDialog'
  ClientHeight = 114
  ClientWidth = 520
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object Label1: TLabel
    Left = 44
    Top = 24
    Width = 432
    Height = 19
    Caption =
      'Are you sure you want to kill all instances of QTNOT til Artios.' +
      'exe?'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = []
    ParentFont = False
  end
  object YES: tMSButton
    Left = 178
    Top = 64
    Width = 75
    Height = 25
    Caption = 'Yes'
    ModalResult = 1
    TabOrder = 0
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object NO: tMSButton
    Left = 266
    Top = 64
    Width = 75
    Height = 25
    Caption = 'No'
    ModalResult = 1
    TabOrder = 1
    DoBrowse = False
    BrowseStyle = fbOpen
  end
end
EndDialog>OneKA_Dialog
AddDialogHandler>OneKA_Dialog,NO,OnClick,Restart

//OneMM_Dialog
Dialog>OneMM_Dialog
object OneMM_Dialog: TForm
  Left = 974
  Top = 130
  HelpContext = 5000
  BorderIcons = [biSystemMenu]
  Caption = 'Maintenance'
  ClientHeight = 107
  ClientWidth = 322
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object Label1: TLabel
    Left = 100
    Top = 8
    Width = 122
    Height = 19
    Caption = 'Expected ready by:'
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Calibri'
    Font.Style = []
    ParentFont = False
  end
  object EXPECT: TEdit
    Left = 32
    Top = 35
    Width = 257
    Height = 21
    Alignment = taCenter
    TabOrder = 0
    Text = 'Date - Time'
  end
  object OK: tMSButton
    Left = 127
    Top = 71
    Width = 75
    Height = 25
    Caption = 'OK'
    ModalResult = 1
    TabOrder = 1
    DoBrowse = False
    BrowseStyle = fbOpen
  end
end
EndDialog>OneMM_Dialog

Label>Main
CloseDialog>MainDialog
MDL CloseDialog done
Show MainDialog,r

//One Kill
SRT>OneKA_CLICK
  Show OneKA_Dialog, r
  DeleteFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Compiled\Abort scripts\QTNOT til Artios.txt
  WriteLn>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Compiled\Abort scripts\QTNOT til Artios.txt,One_GS_r,SHUTDOWN
  Show>Wait_Kill_Dialog
  SetDialogProperty>Wait_Kill_Dialog,PGB,Position,10
  Wait 0.5
  SetDialogProperty>Wait_Kill_Dialog,PGB,Position,20
  Wait 0.5
  SetDialogProperty>Wait_Kill_Dialog,PGB,Position,30
  Wait 0.5
  SetDialogProperty>Wait_Kill_Dialog,PGB,Position,40
  Wait 0.5
  SetDialogProperty>Wait_Kill_Dialog,PGB,Position,50
  Wait 0.5
  SetDialogProperty>Wait_Kill_Dialog,PGB,Position,60
  Wait 0.5
  SetDialogProperty>Wait_Kill_Dialog,PGB,Position,70
  Wait 0.5
  SetDialogProperty>Wait_Kill_Dialog,PGB,Position,80
  Wait 0.5
  SetDialogProperty>Wait_Kill_Dialog,PGB,Position,90
  Wait 0.4
  SetDialogProperty>Wait_Kill_Dialog,PGB,Position,100
  Wait 0.6
  CloseDialog>Wait_Kill_Dialog
  DeleteFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Compiled\Abort scripts\QTNOT til Artios.txt
End>OneKA_CLICK

SRT>Restart
  ExecuteFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Compiled\Macro Control Panel.exe,
  Exit
END>Restart

//One Maintenance
SRT>OneMM_CLICK
  IfFileExists>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Compiled\QTNOT til Artios - UNDER MAINTENANCE.exe
    MDL MAINTENANCE MODE ALREADY ENABLED
  Else
    Show OneKA_Dialog, r
    DeleteFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Compiled\Abort scripts\QTNOT til Artios.txt
    WriteLn>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Compiled\Abort scripts\QTNOT til Artios.txt,One_GS_r,SHUTDOWN
    Show>Wait_Kill_Dialog
    SetDialogProperty>Wait_Kill_Dialog,PGB,Position,10
    Wait 0.5
    SetDialogProperty>Wait_Kill_Dialog,PGB,Position,20
    Wait 0.5
    SetDialogProperty>Wait_Kill_Dialog,PGB,Position,30
    Wait 0.5
    SetDialogProperty>Wait_Kill_Dialog,PGB,Position,40
    Wait 0.5
    SetDialogProperty>Wait_Kill_Dialog,PGB,Position,50
    Wait 0.5
    SetDialogProperty>Wait_Kill_Dialog,PGB,Position,60
    Wait 0.5
    SetDialogProperty>Wait_Kill_Dialog,PGB,Position,70
    Wait 0.5
    SetDialogProperty>Wait_Kill_Dialog,PGB,Position,80
    Wait 0.5
    SetDialogProperty>Wait_Kill_Dialog,PGB,Position,90
    Wait 0.4
    SetDialogProperty>Wait_Kill_Dialog,PGB,Position,100
    Wait 0.6
    CloseDialog>Wait_Kill_Dialog
    DeleteFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Compiled\Abort scripts\QTNOT til Artios.txt
    Show OneMM_Dialog,r
    GetDialogProperty>OneMM_Dialog,EXPECT,text,EXPECTRESULT
    WriteLn>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Compiled\Maintenance\QTNOT til Artios.txt,EXPECTSUCCESS,%EXPECTRESULT%
    RenameFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Compiled\QTNOT til Artios.exe,\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Compiled\QTNOT til Artios - UNDER MAINTENANCE.exe
    IfnotFileExists>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Compiled\QTNOT til Artios - UNDER MAINTENANCE.exe
    MDL FAILED TO RENAME MACRO TO MAINTENANCE VERSION. CHECK FOLDER
    exit
    Endif
    CopyFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Compiled\Maintenance.exe,\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Compiled\QTNOT til Artios.exe
    SetDialogObjectFont>MainDialog,OneTitle,Calibri,16,1,32896
    SetDialogObjectFont>MainDialog,OneMM,Calibri,12,1,32896
    SetDialogObjectFont>MainDialog,OneNM,Calibri,12,0,32768
    CloseDialog>MainDialog
    Show>MainDialog,r
  Endif
END>OneMM_CLICK

//One Normal
SRT>OneNM_CLICK
  IfFileExists>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Compiled\QTNOT til Artios - UNDER MAINTENANCE.exe
    DeleteFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Compiled\QTNOT til Artios.exe
    RenameFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Compiled\QTNOT til Artios - UNDER MAINTENANCE.exe,\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Compiled\QTNOT til Artios.exe
    DeleteFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Compiled\Maintenance\QTNOT til Artios.txt
    SetDialogObjectFont>MainDialog,OneTitle,Calibri,16,1,32768
    SetDialogObjectFont>MainDialog,OneNM,Calibri,12,1,32768
    SetDialogObjectFont>MainDialog,OneMM,Calibri,12,0,32896
    CloseDialog>MainDialog
    Show>MainDialog,r
  Else
    MDL ALREADY IN NORMAL MODE
  Endif
END>OneNM_CLICK

//One Stats
SRT>OneStats
let>DECIMAL_SEPARATOR=.
ReadFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Statistik\QTNOT til Artios\Dkpbrsc.txt,DKPBRSC1
ReadFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Statistik\QTNOT til Artios\DKPERNI.txt,DKPERNI1
ReadFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Statistik\QTNOT til Artios\dkjurroh.txt,DKJURROH1
ReadFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Statistik\QTNOT til Artios\dkptana.txt,DKPTANA1
ReadFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Statistik\QTNOT til Artios\DKPTHSK.txt,DKPTHSK1
ReadFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Statistik\QTNOT til Artios\dkkassva.txt,dkkassva1
Separate>DKPBRSC1,CRLF,DKPBRSC_Arr1
Separate>DKPERNI1,CRLF,DKPERNI_Arr1
Separate>DKJURROH1,CRLF,DKJURROH_Arr1
Separate>DKPTANA1,CRLF,DKPTANA_Arr1
Separate>DKPTHSK1,CRLF,DKPTHSK_Arr1
ArrayCount>DKPBRSC_Arr1,DKPBRSC_Count1
ArrayCount>DKPERNI_Arr1,DKPERNI_Count1
ArrayCount>DKJURROH_Arr1,DKJURROH_Count1
ArrayCount>DKPTANA_Arr1,DKPTANA_Count1
ArrayCount>DKPTHSK_Arr1,DKPTHSK_Count1
Let>Collective1={%DKPBRSC_Count1%+%DKPERNI_Count1%+%DKJURROH_Count1%+%DKPTANA_Count1%+%DKPTHSK_Count1%}
Let>Executes1=%Collective1%
Let>Seconds1=%Executes1%*15
Let>Minutes1=%Seconds1%/60
Let>Hours1=%Minutes1%/60
Let>HourRate1=700
Let>CostSave1=%Hours1%*%HourRate1%
Let>ExecutesRounded1={round (%Executes1%)}
Let>HoursRounded1={round (%Hours1%)}
Let>CostSaveRounded1={round (%CostSave1%)}
SetDialogProperty>MainDialog,OneExecutions,Caption,All time: %ExecutesRounded1%
SetDialogProperty>MainDialog,OneTimeSaved,Caption,All time: %HoursRounded1% hrs
SetDialogProperty>MainDialog,OneCostSaved,Caption,All time: %CostSaveRounded1% DKK
SkipLabel>Main
END>OneStats

//Two Stats
SRT>TwoStats
let>DECIMAL_SEPARATOR=.
ReadFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Statistik\Grouped Output\Dkpbrsc.txt,DKPBRSC2
ReadFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Statistik\Grouped Output\DKPERNI.txt,DKPERNI2
ReadFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Statistik\Grouped Output\dkjurroh.txt,DKJURROH2
ReadFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Statistik\Grouped Output\dkptana.txt,DKPTANA2
ReadFile>\\DSS-DK-FIL-001\Data\Common\Autoclick projekt\Statistik\Grouped Output\DKPTHSK.txt,DKPTHSK2
Separate>DKPBRSC2,CRLF,DKPBRSC_Arr2
Separate>DKPERNI2,CRLF,DKPERNI_Arr2
Separate>DKJURROH2,CRLF,DKJURROH_Arr2
Separate>DKPTANA2,CRLF,DKPTANA_Arr2
Separate>DKPTHSK2,CRLF,DKPTHSK_Arr2
ArrayCount>DKPBRSC_Arr2,DKPBRSC_Count2
ArrayCount>DKPERNI_Arr2,DKPERNI_Count2
ArrayCount>DKJURROH_Arr2,DKJURROH_Count2
ArrayCount>DKPTANA_Arr2,DKPTANA_Count2
ArrayCount>DKPTHSK_Arr2,DKPTHSK_Count2
Let>Collective2={%DKPBRSC_Count2%+%DKPERNI_Count2%+%DKJURROH_Count2%+%DKPTANA_Count2%+%DKPTHSK_Count2%}
Let>Executes2=%Collective2%/3
Let>Seconds2=%Executes2%*15
Let>Minutes2=%Seconds2%/60
Let>Hours2=%Minutes2%/60
Let>HourRate2=700
Let>CostSave2=%Hours2%*%HourRate2%
Let>ExecutesRounded2={round (%Executes2%)}
Let>HoursRounded2={round (%Hours2%)}
Let>CostSaveRounded2={round (%CostSave2%)}
SetDialogProperty>MainDialog,TwoExecutions,Caption,All time: %ExecutesRounded2%
SetDialogProperty>MainDialog,TwoTimeSaved,Caption,All time: %HoursRounded2% hrs
SetDialogProperty>MainDialog,TwoCostSaved,Caption,All time: %CostSaveRounded2% DKK

CloseDialog>MainDialog
Show>MainDialog,r
END>TwoStats

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts