-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathProgram.cs
124 lines (102 loc) · 5.32 KB
/
Program.cs
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
using System;
using System.IO;
namespace ArkSpawnCodeGen
{
class Program
{
static void Main(string[] args)
{
string[] files = Directory.GetFiles(Directory.GetCurrentDirectory());
int amtFiles = files.Length;
int fileCount = 0;
bool isArkModFolder()
{
foreach (string s in files)
{
string filename = Path.GetFileNameWithoutExtension(s);
if (!filename.StartsWith("PrimalGameData"))
{
if (fileCount == amtFiles - 1)
{
return false;
}
else
{
fileCount++;
}
}
else
{
return true;
}
}
return false;
}
void MakeSpawnCodes()
{
string author = "\nCode generated with ARKMod.net's ARK Code Generator. For latest version, visit https://arkmod.net/.\nHappy ARKing!";
string engramsHeader = "\n---------------------------------------------------------------------------------Engram Names---------------------------------------------------------------------------------\n";
string itemsHeader = "\n---------------------------------------------------------------------------------Item Spawncodes--------------------------------------------------------------------------------\n";
string dinoHeader = "\n---------------------------------------------------------------------------------Creature Spawncodes-----------------------------------------------------------------------------\n";
string dinoTHeader = "\n---------------------------------------------------------------------------------Tamed Creature Spawncodes-----------------------------------------------------------------------\n";
var allItems = Directory.GetFiles(Directory.GetCurrentDirectory(), "*", SearchOption.AllDirectories);
File.Delete("Output.txt"); //this will wipe the text file so a clean set of codes can be re generated
File.AppendAllText("Output.txt", author + Environment.NewLine);
File.AppendAllText("Output.txt", engramsHeader + Environment.NewLine);
foreach (var item in allItems)
{
var filename = Path.GetFileNameWithoutExtension(item);
if (filename.StartsWith("EngramEntry"))
{
var s = filename + "_C";
File.AppendAllText("Output.txt", s + Environment.NewLine);
Console.WriteLine(s);
}
}
File.AppendAllText("Output.txt", itemsHeader + Environment.NewLine);// this add the item header to show that everythign below is an item spawn code
foreach (var item in allItems)
{
var filename = Path.GetFileNameWithoutExtension(item);
if (filename.StartsWith("PrimalItem"))
{
var s = @"admincheat GiveItem " + ((char)34) + "Blueprint'" + item.Substring(item.IndexOf("Content")).Replace(@"Content\", @"\Game\").Replace(".uasset", "." + filename).Replace(@"\", "/") + "'" + ((char)34) + " 1 1 0";
File.AppendAllText("Output.txt", s + Environment.NewLine);
Console.WriteLine(s);
}
}
File.AppendAllText("Output.txt", dinoHeader + Environment.NewLine);
foreach (var item in allItems)
{
var filename = Path.GetFileNameWithoutExtension(item);
if (filename.Contains("Character_BP"))
{
var s = @"admincheat SpawnDino " + ((char)34) + "Blueprint'" + item.Substring(item.IndexOf("Content")).Replace(@"Content\", @"\Game\").Replace(".uasset", "." + filename).Replace(@"\", "/") + "'" + ((char)34) + " 500 0 0 120";
File.AppendAllText("Output.txt", s + Environment.NewLine);
Console.WriteLine(s);
}
}
File.AppendAllText("Output.txt", dinoTHeader + Environment.NewLine);
foreach (var item in allItems)
{
var filename = Path.GetFileNameWithoutExtension(item) + "_C";
if (filename.Contains("Character_BP"))
{
var s = @"admincheat GMSummon " + ((char)34) + filename + ((char)34) + " 120";
File.AppendAllText("Output.txt", s + Environment.NewLine);
Console.WriteLine(s);
}
}
File.AppendAllText("Output.txt", author + Environment.NewLine);
}
if (isArkModFolder())
{
MakeSpawnCodes();
}
else
{
Console.WriteLine("This folder dont have a PrimalGameData.");
Console.ReadKey();
}
}
}
}