-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAutoItP3dExporterFolder.au3
More file actions
executable file
·158 lines (111 loc) · 4.08 KB
/
AutoItP3dExporterFolder.au3
File metadata and controls
executable file
·158 lines (111 loc) · 4.08 KB
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
#include <MsgBoxConstants.au3>
#include<Array.au3>
#include <File.au3>
#include <GDIPlus.au3>
#include <GUIMenu.au3>
Example()
Func Example()
; Create a constant variable in Local scope of the message to display in FileSelectFolder.
Local Const $sMessage = "Select a folder"
;Local Const $LucasExe = "C:\Users\Asus\Documents\LucasPure3DEditor4_5\LucasPure3DEditor4.exe"
Local Const $LucasExe = "C:\Users\asus\Documents\RoadRage\LucasPure3DEditor4_5\LucasPure3DEditor4.exe"
; Display an open dialog to select a file.
Local $sFileSelectFolder = FileSelectFolder($sMessage, "")
;Local $sFileSelectFolder = "C:\Temp\Simpsons Road Rage Files\PS2\STECHNG.RCF"
Local $sTextureFolder = $sFileSelectFolder & "\textures"
ConsoleWrite("Starting Lucas Batch Export in " & $sFileSelectFolder & @CRLF)
If NOT FileExists($sTextureFolder) Then
;MsgBox($MB_SYSTEMMODAL, "", "An error occurred. The directory already exists.")
; Create the directory.
DirCreate($sTextureFolder)
ConsoleWrite("Created texture folder " & $sTextureFolder & @CRLF)
EndIf
If @error Then
; Display the error message.
MsgBox($MB_SYSTEMMODAL, "", "No folder was selected.")
Else
; Display the selected folder.
; MsgBox($MB_SYSTEMMODAL, "", "You chose the following folder:" & @CRLF & $sFileSelectFolder)
$FileList = _FileListToArray($sFileSelectFolder, "*.p3d", $FLTA_FILES)
;_ArrayDisplay($FileList)
; Lucas' Pure3D Editor 4.5
Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase
Local $iPID = Run($LucasExe, "", @SW_SHOWMAXIMIZED)
Local $hWnd = WinWait("Pure3D Editor", "", 10)
; SendKeepActive($hWnd)
For $i = 1 to $FileList[0]
;If $i = 1 Then
If $i >= 1 Then
ConsoleWrite($i & " Opening " & $FileList[$i] & @CRLF)
;MsgBox ( flag, "title", "text" [, timeout = 0 [, hwnd]] )
Send("^o")
Local $hOpen = WinWaitActive("Open", "", 0)
Sleep(100)
Send("!n")
Send($sFileSelectFolder & "\" & $FileList[$i])
Send("{ENTER}")
;;Send("{TAB}{ENTER}")
;Sleep(900)
; window title changes to include the opened file
Local $hSaveAs = WinWait($FileList[$i], "", 0)
;horrible hack - possible dialog box popup about corrupted Fil
Send("{ENTER}")
Sleep(100)
Send("{ENTER}")
;Open Save As Menu -- save as
Send("{LALT}")
Send("{DOWN}")
Send("{DOWN}")
Send("{DOWN}")
Send("{DOWN}")
Send("{ENTER}")
;Sleep(300)
Local $hSaveAs = WinWait("Save As", "", 0)
;save as p3dxml
Send("{TAB}")
;Sleep(300)
Send("{DOWN}")
;Sleep(300)
Send("{DOWN}")
Send("{ENTER}")
Send("{ENTER}")
Sleep(500)
;possible "Confirm Save As" - replace file box
If WinExists("Confirm Save As") Then
;ConsoleWrite("Confirm Save As Found" & @CRLF)
Send("!Y")
EndIf
WinWaitActive ("Pure3D Editor" ,"", 0 )
Sleep(500)
;try AND EXPORT THE TEXTURES
Send("{LALT}")
Send("{RIGHT}")
Send("{RIGHT}")
Send("{RIGHT}")
Send("{DOWN}")
Send("{ENTER}")
Sleep(500)
;Not the texture exporter
If WinActive("Open") Then
ConsoleWrite($i & " Open found - no texture export " & $FileList[$i] & @CRLF)
Send("{ESC}")
EndIf
If WinActive("Select Folder") Then
ConsoleWrite($i & " Select Folder found textures for " & $FileList[$i] & @CRLF)
Send($sTextureFolder)
Send("{ENTER}")
Send("{ENTER}")
;return
EndIf
WinWaitActive ( $FileList[$i] ,"", 0 )
;MsgBox($MB_ICONINFORMATION, "", $FileList[$i] & " " & $hMenu & " " & $iFile , 1)
EndIf
Next
; ProcessClose($iPID)
; $aArray[0] = Number of Files\Folders returned
; $aArray[1] = 1st File\Folder
; $aArray[n] = nth File\Folder
EndIf
ProcessClose($iPID)
MsgBox($MB_ICONINFORMATION, "", "Completed" , 5)
EndFunc ;==>Example