DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
DayZTools.c
См. документацию.
2{
3 void RunDayZBat(string filepath, bool wait = false)
4 {
5 if (filepath.Length() < 2) return;
6
7 filepath.Replace("\\", "/");
8
9 if (filepath[1] != ":")
10 {
11 string cwd;
12 Workbench.GetCwd(cwd);
13 filepath = cwd + "/" + filepath;
14 }
15
16 int index = filepath.IndexOf("/");
17 int last_index = index;
18
19 while(index != -1)
20 {
21 last_index = index;
22 index = filepath.IndexOfFrom(last_index + 1, "/");
23 }
24
25 if (last_index == -1) return;
26
27 string path = filepath.Substring(0, last_index);
28 string bat = filepath.Substring(last_index + 1, filepath.Length() - last_index - 1);
29 /*Print(filepath);
30 Print(path);
31 Print(bat);*/
32 Workbench.RunCmd("cmd /c \"cd " + path + " & call " + bat + "\"", wait);
33 }
34
35 override void Configure()
36 {
37 Workbench.ScriptDialog("Mission directory","", this);
38 }
39
40 [ButtonAttribute("OK")]
41 void DialogOk()
42 {
43 }
44};
45
46[WorkbenchPluginAttribute("DayZ Restart", "Just for testing", "ctrl+1", "", {"ScriptEditor"})]
48{
49 [Attribute("day_z_data_missions/killDayZ.bat", "fileeditbox", "Path to missions dir", "")]
51
52 [Attribute("day_z_data_missions/_default_single/default_SampleMap3_Empty.bat", "fileeditbox", "Path to missions dir", "")]
54
55 override void Run()
56 {
59 }
60}
61
62[WorkbenchPluginAttribute("DayZ Run", "Just for testing", "ctrl+2", "", {"ScriptEditor"})]
63class RunDayzTool: DayZTool
65 [Attribute("day_z_data_missions/_default_single/default_SampleMap3_Empty.bat", "fileeditbox", "Path to missions dir", "")]
66 string MissionBatPath;
68 override void Run()
69 {
70 RunDayZBat(MissionBatPath);
71 }
72}
73
74[WorkbenchPluginAttribute("DayZ Kill", "Just for testing", "ctrl+3", "", {"ScriptEditor"})]
76{
77 [Attribute("day_z_data_missions/killDayZ.bat", "fileeditbox", "Path to missions dir", "")]
79
80 override void Run()
81 {
83 }
84}
85
86
87
88
89
string MissionBatPath
Определения DayZTools.c:67
RestartDayzTool DayZTool WorkbenchPluginAttribute("DayZ Run", "Just for testing", "ctrl+2", "", {"ScriptEditor"})
Определения DayZTools.c:62
override void Run()
Определения DayZTools.c:69
string path
Определения OptionSelectorMultistate.c:142
Определения EnEntity.c:824
Определения workbenchApi.c:109
void RunDayZBat(string filepath, bool wait=false)
Определения DayZTools.c:3
override void Configure()
Определения DayZTools.c:35
void DialogOk()
Определения DayZTools.c:41
Определения DayZTools.c:2
string KillBatPath
Определения DayZTools.c:78
override void Run()
Определения DayZTools.c:80
Определения DayZTools.c:76
string KillBatPath
Определения DayZTools.c:50
override void Run()
Определения DayZTools.c:55
string MissionBatPath
Определения DayZTools.c:53
Определения DayZTools.c:48
static proto native int RunCmd(string command, bool wait=false)
static proto void GetCwd(out string currentDir)
static proto int ScriptDialog(string caption, string text, Class data)
Определения workbenchApi.c:7
Определения workbenchApi.c:102
proto native int Length()
Returns length of string.
proto int Replace(string sample, string replace)
Replace all occurrances of 'sample' in 'str' by 'replace'.
proto string Substring(int start, int len)
Substring of 'str' from 'start' position 'len' number of characters.
proto native int IndexOfFrom(int start, string sample)
Finds 'sample' in 'str' from 'start' position. Returns -1 when not found.
proto native int IndexOf(string sample)
Finds 'sample' in 'str'. Returns -1 when not found.