-
Notifications
You must be signed in to change notification settings - Fork 1
/
ESP_Easy_Webdumper.scp
1103 lines (1070 loc) · 71.1 KB
/
ESP_Easy_Webdumper.scp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// COMPILE_OPTS|C:\Users\Jimmy\Desktop\ESP Easy Webdumper.exe|C:\Users\Jimmy\Dropbox\Diverse\ESP-projekt\ESP_Easy_Webdump\ICON.ico|CONSOLE=0|INCLUDES=1| /NOSYSTRAY|RUNTIMES=1|BMPS=1
//Global variables (version is MAYOR.MINOR.MINIMAL)
Let>VERSION=0.01.002
Let>APP_TITLE=ESP Easy Webdumper (%VERSION%)
GoSub>STARTUP_OF_APP
//Loop to let dialog1 stay alive and listen to interactions from user
Label>WAITING_FOR_A_WHILE
Let>WAIT_FOR_CROWS=0.02
Wait>%WAIT_FOR_CROWS%
Goto>WAITING_FOR_A_WHILE
SRT>DIALOG_MAIN
Dialog>Dialog1
object Dialog1: TForm
Left = -1241
Top = 266
HelpContext = 5000
BorderIcons = [biSystemMenu]
BorderStyle = bsSingle
Caption = 'CustomDialog'
ClientHeight = 514
ClientWidth = 592
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -14
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 120
TextHeight = 16
object Panel1: TPanel
Left = 9
Top = 32
Width = 248
Height = 425
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
TabOrder = 0
object CheckBox1: TCheckBox
Left = 5
Top = 4
Width = 116
Height = 17
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'Main page'
Checked = True
State = cbChecked
TabOrder = 0
end
object CheckBox2: TCheckBox
Left = 5
Top = 25
Width = 220
Height = 16
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'Config page'
TabOrder = 1
end
object CheckBox3: TCheckBox
Left = 5
Top = 44
Width = 220
Height = 18
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'Controllers page'
TabOrder = 2
end
object CheckBox4: TCheckBox
Left = 15
Top = 64
Width = 220
Height = 17
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'Controllers SUB page(s)'
TabOrder = 3
end
object CheckBox5: TCheckBox
Left = 5
Top = 84
Width = 220
Height = 17
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'Hardware page'
TabOrder = 4
end
object CheckBox6: TCheckBox
Left = 5
Top = 105
Width = 220
Height = 16
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'Devices page'
TabOrder = 5
end
object CheckBox7: TCheckBox
Left = 15
Top = 124
Width = 154
Height = 18
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'Device SUB page(s)'
TabOrder = 6
end
object CheckBox8: TCheckBox
Left = 5
Top = 144
Width = 236
Height = 17
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'Rule(s) [will be downloaded as .txt]'
TabOrder = 7
end
object CheckBox9: TCheckBox
Left = 5
Top = 164
Width = 240
Height = 17
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'Notifications page'
TabOrder = 8
end
object CheckBox10: TCheckBox
Left = 15
Top = 185
Width = 240
Height = 16
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'Notifications SUB page(s)'
TabOrder = 9
end
object CheckBox11: TCheckBox
Left = 5
Top = 204
Width = 240
Height = 18
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'Tools page'
TabOrder = 10
end
object CheckBox12: TCheckBox
Left = 15
Top = 224
Width = 240
Height = 17
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'Log page'
TabOrder = 11
end
object CheckBox13: TCheckBox
Left = 15
Top = 244
Width = 240
Height = 17
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'System Info page'
TabOrder = 12
end
object CheckBox14: TCheckBox
Left = 15
Top = 265
Width = 240
Height = 16
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'Advanced page'
TabOrder = 13
end
object CheckBox15: TCheckBox
Left = 15
Top = 284
Width = 240
Height = 18
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'JSON page'
TabOrder = 14
end
object CheckBox16: TCheckBox
Left = 15
Top = 304
Width = 240
Height = 17
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'Pinstate Buffer page'
TabOrder = 15
end
object CheckBox17: TCheckBox
Left = 15
Top = 324
Width = 240
Height = 17
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'WiFi Scan page'
TabOrder = 16
end
object CheckBox18: TCheckBox
Left = 15
Top = 345
Width = 240
Height = 16
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'I2C Scan page'
TabOrder = 17
end
object CheckBox19: TCheckBox
Left = 15
Top = 364
Width = 240
Height = 18
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'Flash page'
TabOrder = 18
end
object CheckBox20: TCheckBox
Left = 15
Top = 384
Width = 240
Height = 17
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'SD Card page'
TabOrder = 19
end
object CheckBox21: TCheckBox
Left = 15
Top = 404
Width = 240
Height = 17
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'Config [will be downloaded as .dat]'
TabOrder = 20
end
object CheckBox0: TCheckBox
Left = 128
Top = 4
Width = 113
Height = 17
Hint = 'With this option checked non-used pages will not be dumped.'
Caption = 'Selective dump'
TabOrder = 21
end
end
object BUTTON_ALL: tMSButton
Left = 10
Top = 4
Width = 75
Height = 26
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'Select all'
TabOrder = 1
DoBrowse = False
BrowseStyle = fbOpen
end
object BUTTON_NONE: tMSButton
Left = 90
Top = 4
Width = 87
Height = 26
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'Select none'
TabOrder = 2
DoBrowse = False
BrowseStyle = fbOpen
end
object BUTTON_CLIPBOARD: tMSButton
Left = 524
Top = 4
Width = 61
Height = 26
Hint = 'The log below is copied to your clipboard.'
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Align = alCustom
Caption = 'Copy log'
TabOrder = 3
DoBrowse = False
BrowseStyle = fbOpen
end
object INPUT_2_PANEL: TPanel
Left = 9
Top = 462
Width = 577
Height = 51
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
TabOrder = 4
object BUTTON_RUN_WEBDUMPER: tMSButton
Left = 510
Top = 2
Width = 65
Height = 48
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'RUN'
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -23
Font.Name = 'MS Sans Serif'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 2
DoBrowse = False
BrowseStyle = fbOpen
end
object INPUT_IP_ADDRESS: TEdit
Left = 260
Top = 2
Width = 250
Height = 46
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Alignment = taCenter
Color = clWhite
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -33
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
TabOrder = 1
Text = '192.168.0.123'
end
object BUTTON_SAVE_DEFAULT: tMSButton
Left = 0
Top = 28
Width = 142
Height = 21
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'Save default settings'
TabOrder = 0
DoBrowse = False
BrowseStyle = fbOpen
end
object CheckBox_ZIPFILE: TCheckBox
Left = 2
Top = 2
Width = 120
Height = 21
Margins.Left = 4
Margins.Top = 4
Margins.Right = 4
Margins.Bottom = 4
Caption = 'Store files in zip'
TabOrder = 3
end
end
object MEMO_PANEL: TPanel
Left = 267
Top = 33
Width = 318
Height = 425
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Caption = 'Panel3'
TabOrder = 5
object LOG_WINDOW: tMSMemo
Left = 1
Top = 1
Width = 316
Height = 423
Margins.Left = 2
Margins.Top = 2
Margins.Right = 2
Margins.Bottom = 2
Text = 'App started.'
ScrollBars = ssBoth
ScrollBarsAutoShowing = ssBoth
VertScrollBarStyles.ButtonSize = 21
HorzScrollBarStyles.ButtonSize = 21
Align = alClient
Color = 14513920
Font.Charset = DEFAULT_CHARSET
Font.Color = clWhite
Font.Height = -15
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentFont = False
TabOrder = 0
end
end
end
EndDialog>Dialog1
END>DIALOG_MAIN
//Load stuff
SRT>STARTUP_OF_APP
GoSub>GET_THE_DRIVE_LETTER
Assigned>IP_NUMBER,IS_THE_IP_NUMBER_ASSIGNED
GoSub>COMMAND_LINE_DEPLOY
GoSub>URL_SUB_PAGES
GoSub>DIALOG_MAIN
GoSub>SET_DEFAULT_DIALOG_SETTINGS
IfFileExists>%SCRIPT_DIR%\APP_DATA.zip
//Everything IS OKAY
Else>
SetDialogProperty>Dialog1,LOG_WINDOW,Text,APP_DATA.zip is missing!%CRLF%Download it from GitHub%CRLF%and restart the app...
SetDialogProperty>Dialog1,BUTTON_RUN_WEBDUMPER,Enabled,False
Endif>
If>HEADLESS_DUMPER=1
//Fix so that the cmd assigned number is restored...
Let>IP_NUMBER=IP_NUMBER_CMD
SetDialogProperty>Dialog1,INPUT_IP_ADDRESS,Text,%IP_NUMBER%
SetDialogProperty>Dialog1,,WindowState,wsMinimized
Endif>
GoSub>CHECK_APP_DATA_ZIP_FILE
If>APP_DATA_ZIP_FILE_EXISTS=1
GoSub>NEEDED_FOLDERS
GoSub>CREATE_MISSING_FOLDERS
GoSub>EXTERNAL_SCRIPT_FILES
Endif>
GoSub>LOAD_DIALOG_HANDLERS
If>HEADLESS_DUMPER=1
//Run automatically but with window open
GetDialogProperty>Dialog1,LOG_WINDOW,Text,LOG_WINDOW_TEXT
SetDialogProperty>Dialog1,LOG_WINDOW,Text,Running from command line.%CRLF%%LOG_WINDOW_TEXT%
GoSub>GET_TIME_AND_DATE
WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,####COMMAND LINE BATCH MODE####
GoSub>RUN_WEBDUMPER
If>IS_SILENT_ASSIGNED=TRUE
//
Else>
CloseDialog>Dialog1
Endif>
Exit>
Else>
//Open as normal...
Endif>
END>STARTUP_OF_APP
//Get path drive letter
SRT>GET_THE_DRIVE_LETTER
Let>REGEX_PATTERN=.:(?=\\)
RegEx>REGEX_PATTERN,%SCRIPT_DIR%,,MATCH_ARRAY,,,,
Let>DRIVE_LETTER=MATCH_ARRAY_1
END>GET_THE_DRIVE_LETTER
SRT>COMMAND_LINE_DEPLOY
If>IS_THE_IP_NUMBER_ASSIGNED=TRUE
GoSub>EVALUATE_IP
Let>HEADLESS_DUMPER=1
Let>IP_NUMBER_CMD=IP_NUMBER
Assigned>SILENT,IS_SILENT_ASSIGNED
Endif>
If>IP_NUMBER=0
//No ip to fetch...
Let>HEADLESS_DUMPER=0
Let>IS_SILENT_ASSIGNED=FALSE
Endif>
END>COMMAND_LINE_DEPLOY
SRT>LOAD_DIALOG_HANDLERS
SetDialogProperty>Dialog1,,Caption,APP_TITLE
AddDialogHandler>Dialog1,,OnClose,EXIT_APP
AddDialogHandler>Dialog1,BUTTON_RUN_WEBDUMPER,OnClick,RUN_WEBDUMPER
AddDialogHandler>Dialog1,BUTTON_NONE,OnClick,SELECT_NONE
AddDialogHandler>Dialog1,BUTTON_ALL,OnClick,SELECT_ALL
AddDialogHandler>Dialog1,BUTTON_CLIPBOARD,OnClick,COPY_TO_CLIPBOARD
AddDialogHandler>Dialog1,BUTTON_SAVE_DEFAULT,OnClick,SAVE_SETTINGS_FILE
//remove this when feature added
SetDialogProperty>Dialog1,CheckBox0,Visible,False
If>IS_SILENT_ASSIGNED=TRUE
//Do not show the dialog
Else>
Show>Dialog1
Endif>
If>APP_DATA_ZIP_FILE_EXISTS=0
//Cannot proceed!
SetDialogProperty>Dialog1,BUTTON_RUN_WEBDUMPER,Enabled,False
SetDialogProperty>Dialog1,LOG_WINDOW,Text,The APP_DATA.zip file is%CRLF%missing, please download and%CRLF%place it in the same%CRLF%folder as the exe file.%CRLF%%CRLF%Close app...
SetDialogProperty>Dialog1,LOG_WINDOW,Color,255
Endif>
END>LOAD_DIALOG_HANDLERS
//Available sub pages to dump
SRT>URL_SUB_PAGES
Let>URL_SUB_PAGE_1=
Let>URL_SUB_PAGE_2=/config
Let>URL_SUB_PAGE_3=/controllers
//index 1..3
Let>URL_SUB_PAGE_4=/controllers?index=
Let>URL_SUB_PAGE_4_MAX=3
Let>URL_SUB_PAGE_5=/hardware
//Only one page as of later versions...
Let>URL_SUB_PAGE_6=/devices
//index 1..12
Let>URL_SUB_PAGE_7=/devices?index=
Let>URL_SUB_PAGE_7_MAX=12
Let>URL_SUB_PAGE_8=/rules
Let>URL_SUB_PAGE_8_MAX=4
Let>URL_SUB_PAGE_9=/notifications
//index 1..3
Let>URL_SUB_PAGE_10=/notifications?index=
Let>URL_SUB_PAGE_10_MAX=3
Let>URL_SUB_PAGE_11=/tools
Let>URL_SUB_PAGE_12=/log
Let>URL_SUB_PAGE_13=/sysinfo
Let>URL_SUB_PAGE_14=/advanced
Let>URL_SUB_PAGE_15=/json
Let>URL_SUB_PAGE_16=/pinstates
Let>URL_SUB_PAGE_17=/wifiscanner
Let>URL_SUB_PAGE_18=/i2cscanner
Let>URL_SUB_PAGE_19=/filelist
Let>URL_SUB_PAGE_20=/SDfilelist
Let>URL_SUB_PAGE_21=/config.dat
Let>NUMBER_OF_MAXIMUM_FETCHINGS_TO_DO=21
END>URL_SUB_PAGES
//Just kill the app
SRT>EXIT_APP
Exit>
END>EXIT_APP
//List the folders needed and also the number of folders for the creation loop
SRT>NEEDED_FOLDERS
Let>FOLDER_1=%SCRIPT_DIR%\APP_DATA
Let>FOLDER_1_FILES=*.*
Let>FOLDER_2=%SCRIPT_DIR%\Settings
Let>FOLDER_2_FILES=*.ini
Let>FOLDER_3=%SCRIPT_DIR%\Log
Let>FOLDER_3_FILES=*.*
Let>NUMBER_OF_FOLDERS=3
END>NEEDED_FOLDERS
//Need APP_DATA.zip!!
SRT>CHECK_APP_DATA_ZIP_FILE
IfNotFileExists>%SCRIPT_DIR%\APP_DATA.zip
Let>APP_DATA_ZIP_FILE_EXISTS=0
Else>
//Everything is all right
Let>APP_DATA_ZIP_FILE_EXISTS=1
Endif>
END>CHECK_APP_DATA_ZIP_FILE
//Create missing folders
SRT>CREATE_MISSING_FOLDERS
Let>k=0
Repeat>k
Let>k=k+1
Let>TEMP_FOLDER_PATH=FOLDER_%k%
IfNotDirExists>TEMP_FOLDER_PATH
CreateDir>TEMP_FOLDER_PATH
Endif>
Until>k=NUMBER_OF_FOLDERS
END>CREATE_MISSING_FOLDERS
//Generic get time function (HARD is without - or : in the string)
SRT>GET_TIME_AND_DATE
Year>DATE_YEAR
Month>DATE_MONTH
Day>DATE_DAY
Let>DATE=%DATE_YEAR%-%DATE_MONTH%-%DATE_DAY%
RegEx>(-),DATE,0,,,1,,DATE_HARD
Hour>TIME_HOUR
Min>TIME_MIN
Sec>TIME_SEC
Let>TIME=%TIME_HOUR%:%TIME_MIN%:%TIME_SEC%
RegEx>(:),TIME,0,,,1,,TIME_HARD
END>GET_TIME_AND_DATE
//Run the application
SRT>RUN_WEBDUMPER
SetDialogProperty>Dialog1,LOG_WINDOW,Text,Webdumper started.
Let>FILES_CREATED=#########FILES CREATED#########
GoSub>GET_DIALOG_INFORMATION
GoSub>EVALUATE_IP
If>IP_NUMBER=0
//We cannot proceed
GetDialogProperty>Dialog1,INPUT_IP_ADDRESS,Text,IP_NUMBER
SetDialogProperty>Dialog1,INPUT_IP_ADDRESS,Color,255
SetDialogProperty>Dialog1,INPUT_IP_ADDRESS,Text,ERROR: IP!
Wait>1
SetDialogProperty>Dialog1,INPUT_IP_ADDRESS,Text,%IP_NUMBER%
SetDialogProperty>Dialog1,INPUT_IP_ADDRESS,Color,16777215
Else>
GoSub>PING_TARGET_UNIT
If>UNIT_RESPONDED_TO_PING=1
GoSub>GET_UNIT_NAME_AND_NUMBER
GoSub>SETUP_LOG_FILE
WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,######%DATE%######
WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,#######%VERSION%#######
WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,UNIT IP: %IP_NUMBER%
WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,UNIT NAME: %UNIT_NAME%
WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,UNIT NUMBER: %UNIT_NUMBER%
WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,#########JOB LOG#########
WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,Timer started...
Timer>START_OF_SCAN
Let>k_main=0
Repeat>k_main
Let>k_main=k_main+1
If>URL_SUB_PAGE_CHECKED_%k_main%=True
Let>SKIP=0
//Start fetching
If>URL_SUB_PAGE_%k_main%=/rules
//We should download rules instead of screen print
GoSub>DOWNLOAD_RULES
Let>SKIP=1
Endif>
If>URL_SUB_PAGE_%k_main%=/config.dat
//We should download config instead of screen print
GoSub>DOWNLOAD_CONFIG
Let>SKIP=1
Endif>
If>SKIP=0
Assigned>URL_SUB_PAGE_%k_main%_MAX,INDEX_PAGES_TO_EVALUATE
If>INDEX_PAGES_TO_EVALUATE=TRUE
Let>index_max=URL_SUB_PAGE_%k_main%_MAX
Let>index=0
Repeat>index
Let>index=index+1
Let>TEMP_URL=URL_SUB_PAGE_%k_main%
Let>PAGE_TO_FETCH=%TEMP_URL%%index%
Let>REGEX_PATTERN=(?<=/).+?(?=s\?setpage)
RegEx>REGEX_PATTERN,PAGE_TO_FETCH,,MATCH_ARRAY,NUMB_MATCHES,,,
If>NUMB_MATCHES>0
//This is device pages, not setup
Let>SAVE_AS=MATCH_ARRAY_1
Let>SAVE_AS=%SAVE_AS%_page_%index%
Else>
Let>REGEX_PATTERN=(?<=/).+?(?=s\?)
RegEx>REGEX_PATTERN,PAGE_TO_FETCH,,MATCH_ARRAY,,,,
Let>SAVE_AS=MATCH_ARRAY_1
Let>SAVE_AS=%SAVE_AS%_%index%
Endif>
GoSub>FETCH_SCREEN_DUMP
Until>index=index_max
Else>
//Just fetch the base page
Let>PAGE_TO_FETCH=URL_SUB_PAGE_%k_main%
RegEx>(/),PAGE_TO_FETCH,,,,1,,SAVE_AS
GoSub>FETCH_SCREEN_DUMP
Endif>
Endif>
Else>
//No fetching of this page...
Endif>
Until>k_main=NUMBER_OF_MAXIMUM_FETCHINGS_TO_DO
GoSub>GET_TIME_AND_DATE
Timer>END_OF_SCAN
Let>TIME_FOR_COMPLETE_SCAN={(%END_OF_SCAN%-%START_OF_SCAN%)/1000}
WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,Total time for webdump: %TIME_FOR_COMPLETE_SCAN% seconds
WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,############################
WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,[%DATE% %TIME%] JOB COMPLETED, over and out!
WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,%FILES_CREATED%
GetDialogProperty>Dialog1,LOG_WINDOW,Text,LOG_WINDOW_TEXT
SetDialogProperty>Dialog1,LOG_WINDOW,Text,Webdump completed (%TIME_FOR_COMPLETE_SCAN%s)%CRLF%%LOG_WINDOW_TEXT%
If>ZIP_RESULTS=True
GoSub>ZIP_THE_RESULTS
Endif>
Else>
//No ping is successful...
GetDialogProperty>Dialog1,LOG_WINDOW,Text,LOG_WINDOW_TEXT
SetDialogProperty>Dialog1,LOG_WINDOW,Text,NO PING RESPONSE,%CRLF%cannot proceed.%CRLF%%LOG_WINDOW_TEXT%
Endif>
Endif>
END>RUN_WEBDUMPER
SRT>ZIP_THE_RESULTS
Let>SAVE_AS=LOG_FOLDER_NAME
GetDialogProperty>Dialog1,LOG_WINDOW,Text,LOG_WINDOW_TEXT
SetDialogProperty>Dialog1,LOG_WINDOW,Text,[ ]Adding results to %SAVE_AS%.zip.%CRLF%%LOG_WINDOW_TEXT%
Let>ZIP_FILE_NAME=%SCRIPT_DIR%\Log\%SAVE_AS%.zip
Let>ARCHIVE_TO_ZIP=%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%
ZipAddFiles>%ZIP_FILE_NAME%,%ARCHIVE_TO_ZIP%\*.*,9,0,ZIP_ERROR
If>ZIP_ERROR=0
DeleteFolder>%ARCHIVE_TO_ZIP%
GetDialogProperty>Dialog1,LOG_WINDOW,Text,LOG_WINDOW_TEXT
Let>REGEX_PATTERN=(\[ \]Adding results to %SAVE_AS%.zip\.)
RegEx>REGEX_PATTERN,LOG_WINDOW_TEXT,0,,,1,[X]Adding results to %SAVE_AS%.zip.,LOG_WINDOW_TEXT
SetDialogProperty>Dialog1,LOG_WINDOW,Text,%LOG_WINDOW_TEXT%
Wait>0.5
GetDialogProperty>Dialog1,LOG_WINDOW,Text,LOG_WINDOW_TEXT
SetDialogProperty>Dialog1,LOG_WINDOW,Text,Completed!%CRLF%%LOG_WINDOW_TEXT%
Else>
GetDialogProperty>Dialog1,LOG_WINDOW,Text,LOG_WINDOW_TEXT
SetDialogProperty>Dialog1,LOG_WINDOW,Text,Zip did not complete.%CRLF%%LOG_WINDOW_TEXT%
Endif>
END>ZIP_THE_RESULTS
SRT>GET_DIALOG_INFORMATION
Let>k=0
Repeat>k
Let>k=k+1
Let>TEMP_CHECKBOX_TO_GET=CheckBox%k%
GetDialogProperty>Dialog1,%TEMP_CHECKBOX_TO_GET%,Checked,TEMP_VALUE
Let>URL_SUB_PAGE_CHECKED_%k%=TEMP_VALUE
Until>k=NUMBER_OF_MAXIMUM_FETCHINGS_TO_DO
GetDialogProperty>Dialog1,INPUT_IP_ADDRESS,Text,IP_NUMBER
GetDialogProperty>Dialog1,CheckBox_ZIPFILE,Checked,ZIP_RESULTS
END>GET_DIALOG_INFORMATION
//Get unit name and number from IP site
SRT>GET_UNIT_NAME_AND_NUMBER
GetDialogProperty>Dialog1,LOG_WINDOW,Text,LOG_WINDOW_TEXT
SetDialogProperty>Dialog1,LOG_WINDOW,Text,Connecting %IP_NUMBER%,%CRLF%for name and number%CRLF%%LOG_WINDOW_TEXT%
HTTPRequest>http://%IP_NUMBER%/config,,GET,,TEMP_DATA
Let>REGEX_PATTERN=(?<=<input class='widenumber' type='number' name='unit' min=0 max=9999 value=).+?(?=><TR><TD>)
//Let>REGEX_PATTERN=(?<=name='unit' value=').+?(?='>)
RegEx>REGEX_PATTERN,TEMP_DATA,,TEMP_ARR,NUM_MATCHES,,,
If>NUM_MATCHES>0
Let>UNIT_NUMBER=TEMP_ARR_1
GetDialogProperty>Dialog1,LOG_WINDOW,Text,LOG_WINDOW_TEXT
SetDialogProperty>Dialog1,LOG_WINDOW,Text,Unit number found: %UNIT_NUMBER%%CRLF%%LOG_WINDOW_TEXT%
Else>
Let>UNIT_NUMBER=
GetDialogProperty>Dialog1,LOG_WINDOW,Text,LOG_WINDOW_TEXT
SetDialogProperty>Dialog1,LOG_WINDOW,Text,No unit number found.%CRLF%%LOG_WINDOW_TEXT%
Endif>
Let>REGEX_PATTERN=(?<=<input class='wide' type='text' name='name' maxlength=25 value=').+?(?='><TR><TD>)
//Let>REGEX_PATTERN=(?<=name='name' value=').+?(?='>)
RegEx>REGEX_PATTERN,TEMP_DATA,,TEMP_ARR,NUM_MATCHES,,,
If>NUM_MATCHES>0
Let>UNIT_NAME=TEMP_ARR_1
GetDialogProperty>Dialog1,LOG_WINDOW,Text,LOG_WINDOW_TEXT
SetDialogProperty>Dialog1,LOG_WINDOW,Text,Unit name found: %UNIT_NAME%%CRLF%%LOG_WINDOW_TEXT%
Else>
Let>UNIT_NAME=
GetDialogProperty>Dialog1,LOG_WINDOW,Text,LOG_WINDOW_TEXT
SetDialogProperty>Dialog1,LOG_WINDOW,Text,No unit name found.%CRLF%%LOG_WINDOW_TEXT%
Endif>
END>GET_UNIT_NAME_AND_NUMBER
//See if files are missing, if they are, export new ones.
SRT>EXTERNAL_SCRIPT_FILES
IfNotFileExists>%SCRIPT_DIR%\APP_DATA\wkhtmltoimage.exe
Let>FILE_TO_EXTRACT=wkhtmltoimage.exe
GoSub>INTERNAL_FILE_TO_EXTRACT_FROM_ZIP,FILE_TO_EXTRACT
Endif>
IfNotFileExists>%SCRIPT_DIR%\APP_DATA\wkhtmltox.dll
Let>FILE_TO_EXTRACT=wkhtmltox.dll
GoSub>INTERNAL_FILE_TO_EXTRACT_FROM_ZIP,FILE_TO_EXTRACT
Endif>
IfFileExists>%SCRIPT_DIR%\APP_DATA\TimeStamp.vbs
//Do nothing
Else>
GetDialogProperty>Dialog1,LOG_MEMO,Text,LOG_MEMO_TEXT
SetDialogProperty>Dialog1,LOG_MEMO,Text,Creating "%SCRIPT_DIR%\APP_DATA\TimeStamp.vbs"%CRLF%%LOG_MEMO_TEXT%
LabelToVar>TIMESTAMP_VBS,TIMESTAMP_VBS_SCRIPT,1,0,{"*/"}
WriteLn>%SCRIPT_DIR%\APP_DATA\TimeStamp.vbs,,TIMESTAMP_VBS_SCRIPT
Endif>
END>EXTERNAL_SCRIPT_FILES
//Generic unzip-subroutine (pass file name to be unziped)
SRT>INTERNAL_FILE_TO_EXTRACT_FROM_ZIP
//The files are missing, need to unpack them
IfNotFileExists>%SCRIPT_DIR%\APP_DATA.zip
GetDialogProperty>Dialog1,LOG_WINDOW,Text,LOG_WINDOW_TEXT
SetDialogProperty>Dialog1,LOG_WINDOW,Text,APP_DATA.zip is missing!%CRLF%%LOG_WINDOW_TEXT%
Else>
IfNotDirExists>%SCRIPT_DIR%\APP_DATA
CreateDir>%SCRIPT_DIR%\APP_DATA
Endif>
ZipExtractFiles>%SCRIPT_DIR%\APP_DATA.zip,%INTERNAL_FILE_TO_EXTRACT_FROM_ZIP_Var_1%,%SCRIPT_DIR%\APP_DATA,ZIP_ERROR
GetDialogProperty>Dialog1,LOG_WINDOW,Text,LOG_WINDOW_TEXT
SetDialogProperty>Dialog1,LOG_WINDOW,Text,%INTERNAL_FILE_TO_EXTRACT_FROM_ZIP_Var_1% extracted from APP_DATA.zip%CRLF%%LOG_WINDOW_TEXT%
Endif>
END>INTERNAL_FILE_TO_EXTRACT_FROM_ZIP
//Generic screen dump fetcher...
SRT>FETCH_SCREEN_DUMP
IfNotDirExists>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%
CreateDir>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%
Endif>
If>PAGE_TO_FETCH=
Let>SAVE_AS=main
Endif>
GetDialogProperty>Dialog1,LOG_WINDOW,Text,LOG_WINDOW_TEXT
SetDialogProperty>Dialog1,LOG_WINDOW,Text,[ ]Screenshot of %SAVE_AS%.%CRLF%%LOG_WINDOW_TEXT%
GoSub>GET_TIME_AND_DATE
WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,[%DATE% %TIME%] Taking screenshot of %SAVE_AS% page.
//WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,#######COMMAND LINE BELOW#######
Let>COMMAND_LINE_FOR_DUMPER=wkhtmltoimage.exe --quality 35 http://%IP_NUMBER%%PAGE_TO_FETCH% "%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%SAVE_AS%.png" & exit 0
//WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,[%COMMAND_LINE_FOR_DUMPER%]
Let>RP_WINDOWMODE=0
Let>RP_WAIT=1
RunProgram>cmd /k %DRIVE_LETTER% & cd "%SCRIPT_DIR%\APP_DATA" & %COMMAND_LINE_FOR_DUMPER%
//WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,#######COMMAND LINE ABOVE#######
GoSub>GET_TIME_AND_DATE
WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,[%DATE% %TIME%] %SAVE_AS%.png saved.
Let>FILES_CREATED=%FILES_CREATED%%CRLF%%SAVE_AS%.png
GetDialogProperty>Dialog1,LOG_WINDOW,Text,LOG_WINDOW_TEXT
Let>REGEX_PATTERN=(\[ \]Screenshot of %SAVE_AS%\.)
RegEx>REGEX_PATTERN,LOG_WINDOW_TEXT,0,,,1,[X]Screenshot of %SAVE_AS%.,LOG_WINDOW_TEXT
SetDialogProperty>Dialog1,LOG_WINDOW,Text,%LOG_WINDOW_TEXT%
Wait>0.5
END>FETCH_SCREEN_DUMP
//Generic log file name
SRT>SETUP_LOG_FILE
GoSub>GET_TIME_AND_DATE
Let>LOG_FILE_NAME=
Let>LOG_FOLDER_NAME=%IP_NUMBER%_WEBDUMP_%DATE_HARD%%TIME_HARD%
If>UNIT_NUMBER=
//Do nothing
Else>
Let>LOG_FILE_NAME=%UNIT_NUMBER%_%LOG_FILE_NAME%
Let>LOG_FOLDER_NAME=%UNIT_NUMBER%_%LOG_FOLDER_NAME%
Endif>
If>UNIT_NAME=
//Do nothing
Else>
Let>LOG_FILE_NAME=%UNIT_NAME%_%LOG_FILE_NAME%
Let>LOG_FOLDER_NAME=%UNIT_NAME%_%LOG_FOLDER_NAME%
Endif>
Let>LOG_FILE_NAME=%LOG_FILE_NAME%%DATE_HARD%%TIME_HARD%.txt
IfNotDirExists>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%
CreateDir>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%
Endif>
END>SETUP_LOG_FILE
//Download config file
SRT>DOWNLOAD_CONFIG
IfNotDirExists>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%
CreateDir>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%
Endif>
GoSub>GET_TIME_AND_DATE
WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,[%DATE% %TIME%] Downloading config.dat
Let>FILE_NAME_CONFIG=URL_SUB_PAGE_%k_main%
Let>URL_TO_DONWLOAD_FROM=http://%IP_NUMBER%%FILE_NAME_CONFIG%
HTTPRequest>%URL_TO_DONWLOAD_FROM%,%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%%FILE_NAME_CONFIG%,GET,,IE_ERROR
Let>ERROR_OUTPUT=0
If>IE_ERROR=404 Error connecting to host
Let>ERROR_OUTPUT=1
Endif>
If>IE_ERROR=404 HTTP/1.1 404 Not Found
Let>ERROR_OUTPUT=1
Endif>
If>ERROR_OUTPUT>0
GoSub>GET_TIME_AND_DATE
WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,[%DATE% %TIME%] ! config.dat not found, skipping. !
Else>
GoSub>GET_TIME_AND_DATE
WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,[%DATE% %TIME%] config.dat saved.
Let>FILES_CREATED=%FILES_CREATED%%CRLF%config.dat
Endif>
END>DOWNLOAD_CONFIG
//Download all rule files...
SRT>DOWNLOAD_RULES
Let>RULES_INDEX=%k_main%
Let>MAX_RULE_PAGES=URL_SUB_PAGE_%RULES_INDEX%_MAX
Let>SUB_PAGE=URL_SUB_PAGE_%RULES_INDEX%
IfNotDirExists>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%
CreateDir>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%
Endif>
Let>k_rules=0
Repeat>k_rules
GoSub>GET_TIME_AND_DATE
Let>k_rules=k_rules+1
WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,[%DATE% %TIME%] Downloading rules%k_rules%.txt
Let>URL_TO_DONWLOAD_FROM=http://%IP_NUMBER%%SUB_PAGE%%k_rules%.txt
HTTPRequest>%URL_TO_DONWLOAD_FROM%,%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\rules%k_rules%.txt,GET,,IE_ERROR
Let>ERROR_OUTPUT=0
If>IE_ERROR=404 Error connecting to host
Let>ERROR_OUTPUT=1
Endif>
If>IE_ERROR=404 HTTP/1.1 404 Not Found
Let>ERROR_OUTPUT=1
Endif>
If>ERROR_OUTPUT>0
GoSub>GET_TIME_AND_DATE
WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,[%DATE% %TIME%] ! rules%k_rules%.txt not found, skipping. !
Else>
GoSub>GET_TIME_AND_DATE
WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,[%DATE% %TIME%] rules%k_rules%.txt saved.
Let>FILES_CREATED=%FILES_CREATED%%CRLF%rules%k_rules%.txt
Endif>
Until>k_rules=MAX_RULE_PAGES
END>DOWNLOAD_RULES
//Pinging routine...
SRT>PING_TARGET_UNIT
GoSub>GET_TIME_AND_DATE
WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,[%DATE% %TIME%] Pinging %IP_NUMBER%.
GetDialogProperty>Dialog1,LOG_WINDOW,Text,LOG_WINDOW_TEXT
SetDialogProperty>Dialog1,LOG_WINDOW,Text,Pinging %IP_NUMBER%...%CRLF%%LOG_WINDOW_TEXT%
IfFileExists>%SCRIPT_DIR%\APP_DATA\PING_%INPUT_IP_ADDRESS%.txt
DeleteFile>%SCRIPT_DIR%\APP_DATA\PING_%INPUT_IP_ADDRESS%.txt
Endif>
Wait>0.5
GetDialogProperty>Dialog1,LOG_WINDOW,Text,LOG_WINDOW_TEXT
SetDialogProperty>Dialog1,LOG_WINDOW,Text,This might take a minute or two.%CRLF%%LOG_WINDOW_TEXT%
//Count is used to send multiple pings. Lowest recommended is 2 since the first one might only wake the ESP. 5 turned out to be to many from a delay standpoint
Let>RUN_STRING=powershell "test-connection -ComputerName %IP_NUMBER% -count 2 | Format-List | tee '%SCRIPT_DIR%\APP_DATA\PING_%INPUT_IP_ADDRESS%.txt'"
Let>RP_WAIT=1
Let>RP_WINDOWMODE=0
Run>%RUN_STRING%
ReadFile>%SCRIPT_DIR%\APP_DATA\PING_%INPUT_IP_ADDRESS%.txt,PING_RESULTS
Let>REGEX_PATTERN=(ResponseTime[ ]*:[ ]*)[0123456789]+
RegEx>REGEX_PATTERN,PING_RESULTS,,PING_TIME_ARRAY,NUMBER_MATCHES,,,
//Fix regex results a bit (remove text, leave only number)
If>NUMBER_MATCHES>0
Let>REGEX_PATTERN=(ResponseTime[ ]*:[ ]*)
RegEx>REGEX_PATTERN,%PING_TIME_ARRAY_1%,,,,1,,PING_TIME
Endif>
DeleteFile>%SCRIPT_DIR%\APP_DATA\PING_%INPUT_IP_ADDRESS%.txt
If>NUMBER_MATCHES>0
Let>UNIT_RESPONDED_TO_PING=1
//List response time
GoSub>GET_TIME_AND_DATE
WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,[%DATE% %TIME%] %IP_NUMBER% responded in %PING_TIME%ms.
GetDialogProperty>Dialog1,LOG_WINDOW,Text,LOG_WINDOW_TEXT
SetDialogProperty>Dialog1,LOG_WINDOW,Text,Target responded (%PING_TIME%ms).%CRLF%%LOG_WINDOW_TEXT%
Else>
Let>UNIT_RESPONDED_TO_PING=0
//Throw an error if there's no response on IP
GoSub>GET_TIME_AND_DATE
WriteLn>%SCRIPT_DIR%\Log\%LOG_FOLDER_NAME%\%LOG_FILE_NAME%,,[%DATE% %TIME%] ERROR: %IP_NUMBER% is unresponsive.
GetDialogProperty>Dialog1,LOG_WINDOW,Text,LOG_WINDOW_TEXT
SetDialogProperty>Dialog1,LOG_WINDOW,Text,______________%CRLF%ERROR:%CRLF%%IP_NUMBER% is unresponsive.%CRLF%______________%CRLF%%LOG_WINDOW_TEXT%
Endif>
END>PING_TARGET_UNIT
//Fast select none
SRT>SELECT_NONE