Hey,
zurzeit arbeite ich an einem Allround Converter. Da er nun funktionsfähig ist möchte ich ihn hier veröffentlichen, Updates werden folgen.
Anleitung:Inhalt anzeigen
Dort schreibt ihr rein was er konvertieren soll z.B. CreateVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60); natürlich ändert ihr das was er auslesen soll in $.
So sollte das dann aussehen: CreateVehicle($,$,$,$,$,$,$,$);
Da es sein kann das nach den Kommas ein Leerzeichen kommt könnt ihr noch % benutzen um die Leerzeichen zu dort zu ignorieren.
Das sieht dann so aus: CreateVehicle(%$%,%$%,%$%,%$%,%$%,%$%,%$%,%$%);
Inhalt anzeigen
Inhalt anzeigen
Dort gebt ihr den zu konvertierenden Quelltext ein.
Inhalt anzeigen
Inhalt anzeigen
Dort schreibt ihr rein wie er es ausgeben soll z.B. ModelID: $0$ Respawn_Delay: $7$
Inhalt anzeigen
Inhalt anzeigen
Nun drückt ihr auf Convert und in der letzen großen Textbox sollte nun euer konvertierter Quelltext erscheinen.
Bild:
Source/ Quelltext:
public String replace(String text, String searchText, String replaceText)
{
int i = 0;
int pos = 0;
foreach (Char c in text)
{
if (c.Equals(searchText[i]))
{
i++;
}
else
{
i = 0;
}
if(i == searchText.Length) {
text = text.Substring(0, pos + 1 - searchText.Length) + replaceText + text.Substring(pos + 1, text.Length - pos - 1);
text = replace(text, searchText, replaceText);
break;
}
pos++;
}
return text;
}
private void button1_Click(object sender, System.EventArgs e)
{
getVariables(textBox1.Text);
}
public Char getNextChar(String text, int count)
{
int i = 1;
while(true) {
if (!text[count + i].Equals('%') && !text[count + i].Equals('$'))
{
break;
}
i++;
}
return text[count+i];
}
public int getNextCharCount(String text, int count)
{
int i = 1;
while (true)
{
if (!text[count + i].Equals('%') && !text[count + i].Equals('$'))
{
break;
}
i++;
}
return count + i;
}
public void getVariables(String text)
{
String[][] Variable = new String[1][];
int i = 0;
int pos = 0;
int v = 0;
int a = 0;
String outputtext = textBox2.Text;
Variable[a] = new String[50];
foreach (Char c in richTextBox1.Text)
{
if (text[i].Equals('%') && c.Equals(' ')) { pos++; continue; }
if (text[i].Equals('%') && !c.Equals(' ')) { i++; }
if (text[i].Equals('$') && !c.Equals(getNextChar(text, i)))
{
Variable[a][v] += c;
pos++;
continue;
}
if (text[i].Equals('$') && c.Equals(getNextChar(text, i)))
{
i = getNextCharCount(text, i)+1;
v++;
pos++;
continue;
}
if (!c.Equals(text[i]) && i != text.Length - 1)
{
Variable[a] = new String[50];
}
if (c.Equals(text[i]))
{
if (i == text.Length - 1)
{
for (int k = 0; k < 51; k++)
{
if (Variable[a][k] != null)
{
outputtext = replace(outputtext, "$" + k + "$", Variable[a][k]);
}
else
{
break;
}
}
richTextBox2.Text += outputtext + System.Environment.NewLine;
outputtext = textBox2.Text;
v = 0;
Variable[a] = new String[50];
i = 0;
}
else
{
i++;
}
}
else
{
v = 0;
Variable[a] = new String[50];
i = 0;
}
pos++;
}
}
Alles anzeigen
Download/Virustotal: