void NameFormLoad(object sender, EventArgs e) { if (!File.Exists(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + GlobalVars.Config)) { SecurityFuncs.GeneratePlayerID(); SecurityFuncs.WriteConfigValues(); SecurityFuncs.ReadConfigValues(); } else { SecurityFuncs.ReadConfigValues(); } textBox1.Text = GlobalVars.Name; string hatdir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\content\\hats"; if (Directory.Exists(hatdir)) { DirectoryInfo dinfo = new DirectoryInfo(hatdir); FileInfo[] Files = dinfo.GetFiles("*.rbxm"); foreach (FileInfo file in Files) { if (file.Name.Equals(String.Empty)) { continue; } listBox1.Items.Add(file.Name); } listBox1.SelectedItem = GlobalVars.HatName; Image icon1 = Image.FromFile(hatdir + @"\\" + GlobalVars.HatName.Replace(".rbxm", "") + ".png"); pictureBox1.Image = icon1; } string mapdir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\maps"; if (Directory.Exists(mapdir)) { DirectoryInfo dinfo = new DirectoryInfo(mapdir); FileInfo[] Files = dinfo.GetFiles("*.rbxl"); foreach (FileInfo file in Files) { listBox2.Items.Add(file.Name); } listBox2.SelectedItem = "Baseplate.rbxl"; } PartSelectionLabel2.Text = SelectedPart; HeadButton1.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_HeadColor); TorsoButton2.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_TorsoColor); RArmButton3.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_RightArmColor); LArmButton4.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_LeftArmColor); RLegButton5.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_RightLegColor); LLegButton6.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_LeftLegColor); comboBox1.SelectedIndex = GlobalVars.AASamples; numericUpDown1.Text = GlobalVars.BotCount.ToString(); checkBox1.Checked = GlobalVars.Shadows; }
void Button1Click(object sender, EventArgs e) { SecurityFuncs.WriteConfigValues(); ScriptGenerator.GenerateScriptForClient(); //temp domain string exefile = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Cypher.exe"; string quote = "\""; string args = "-script " + quote + Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + GlobalVars.ScriptLuaFile + quote + " " + quote + Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\maps\\" + listBox2.SelectedItem.ToString() + quote; Process.Start(exefile, args); this.Close(); }
public static void GenerateScriptForClient() { //next, generate the header functions. SecurityFuncs.ReadConfigValues(); int aasamples = GlobalVars.AASamples.Equals(0) ? 1 : GlobalVars.AASamples.Equals(1) ? 4 : GlobalVars.AASamples.Equals(2) ? 8 : 1; string header = MultiLine( "function newWaitForChild(newParent,name)", "local returnable = nil", "if newParent:FindFirstChild(name) then", "returnable = newParent:FindFirstChild(name)", "else", "repeat wait() returnable = newParent:FindFirstChild(name) until returnable ~= nil", "end", "return returnable", "end", "settings().Rendering.Shadows = " + GlobalVars.Shadows.ToString().ToLower(), "settings().Rendering.AASamples = " + aasamples ); string playersettings = MultiLine( "UserID = " + GlobalVars.UserID, "PlayerName = '" + GlobalVars.Name + "'", "Hat1ID = '" + GlobalVars.HatName + "'", "HeadColorID = " + GlobalVars.HeadColor, "TorsoColorID = " + GlobalVars.TorsoColor, "LeftArmColorID = " + GlobalVars.LeftArmColor, "RightArmColorID = " + GlobalVars.RightArmColor, "LeftLegColorID = " + GlobalVars.LeftLegColor, "RightLegColorID = " + GlobalVars.RightLegColor, "BotCount = " + GlobalVars.BotCount, ); //add customization funcs string customizationgen = MultiLine( "function InitalizeClientAppearance(Player,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,HatID)", "local newCharApp = Instance.new('IntValue',Player)", "newCharApp.Name = 'Appearance'", "for i=1,6,1 do", "local BodyColor = Instance.new('BrickColorValue',newCharApp)", "if (i == 1) then", "if (HeadColorID ~= nil) then", "BodyColor.Value = BrickColor.new(HeadColorID)", "BodyColor.Name = 'HeadColor (ID: '..HeadColorID..')'", "else", "BodyColor.Value = BrickColor.new(1)", "BodyColor.Name = 'HeadColor (ID: 1)'", "end", "elseif (i == 2) then", "if (TorsoColorID ~= nil) then", "BodyColor.Value = BrickColor.new(TorsoColorID)", "BodyColor.Name = 'TorsoColor (ID: '..TorsoColorID..')'", "else", "BodyColor.Value = BrickColor.new(1)", "BodyColor.Name = 'TorsoColor (ID: 1)'", "end", "elseif (i == 3) then", "if (LeftArmColorID ~= nil) then", "BodyColor.Value = BrickColor.new(LeftArmColorID)", "BodyColor.Name = 'LeftArmColor (ID: '..LeftArmColorID..')'", "else", "BodyColor.Value = BrickColor.new(1)", "BodyColor.Name = 'LeftArmColor (ID: 1)'", "end", "elseif (i == 4) then", "if (RightArmColorID ~= nil) then", "BodyColor.Value = BrickColor.new(RightArmColorID)", "BodyColor.Name = 'RightArmColor (ID: '..RightArmColorID..')'", "else", "BodyColor.Value = BrickColor.new(1)", "BodyColor.Name = 'RightArmColor (ID: 1)'", "end", "elseif (i == 5) then", "if (LeftLegColorID ~= nil) then", "BodyColor.Value = BrickColor.new(LeftLegColorID)", "BodyColor.Name = 'LeftLegColor (ID: '..LeftLegColorID..')'", "else", "BodyColor.Value = BrickColor.new(1)", "BodyColor.Name = 'LeftLegColor (ID: 1)'", "end", "elseif (i == 6) then", "if (RightLegColorID ~= nil) then", "BodyColor.Value = BrickColor.new(RightLegColorID)", "BodyColor.Name = 'RightLegColor (ID: '..RightLegColorID..')'", "else", "BodyColor.Value = BrickColor.new(1)", "BodyColor.Name = 'RightLegColor (ID: 1)'", "end", "end", "local typeValue = Instance.new('NumberValue')", "typeValue.Name = 'CustomizationType'", "typeValue.Parent = BodyColor", "typeValue.Value = 1", "local indexValue = Instance.new('NumberValue')", "indexValue.Name = 'ColorIndex'", "indexValue.Parent = BodyColor", "indexValue.Value = i", "end", "local newHat = Instance.new('StringValue',newCharApp)", "if (HatID ~= nil) then", "newHat.Value = HatID", "newHat.Name = HatID", "else", "newHat.Value = 'NoHat.rbxm'", "newHat.Name = 'NoHat.rbxm'", "end", "local typeValue = Instance.new('NumberValue')", "typeValue.Name = 'CustomizationType'", "typeValue.Parent = newHat", "typeValue.Value = 2", "end", "function LoadCharacterNew(playerApp,newChar)", "local charparts = {[1] = newWaitForChild(newChar,'Head'),[2] = newWaitForChild(newChar,'Torso'),[3] = newWaitForChild(newChar,'Left Arm'),[4] = newWaitForChild(newChar,'Right Arm'),[5] = newWaitForChild(newChar,'Left Leg'),[6] = newWaitForChild(newChar,'Right Leg')}", "for _,newVal in pairs(playerApp:GetChildren()) do", "newWaitForChild(newVal,'CustomizationType')", "local customtype = newVal:FindFirstChild('CustomizationType')", "if (customtype.Value == 1) then ", "pcall(function()", "newWaitForChild(newVal,'ColorIndex')", "local colorindex = newVal:FindFirstChild('ColorIndex')", "charparts[colorindex.Value].BrickColor = newVal.Value ", "end)", "elseif (customtype.Value == 2) then", "pcall(function()", "local newHat = game.Workspace:InsertContent('rbxasset://hats/'..newVal.Value)", "if newHat[1] then ", "if newHat[1].className == 'Hat' then", "newHat[1].Parent = newChar", "else", "newHat[1]:remove()", "end", "end", "end)", "end", "end", "end" ); //string botcode = MultiLine( // ); //finally, we generate the actual script code. string code = MultiLine( "game:GetService('RunService'):run()", "local plr = game.Players:CreateLocalPlayer(UserID)", "plr.Name = PlayerName", "plr:LoadCharacter()", "pcall(function() plr:SetUnder13(false) end)", "pcall(function() plr:SetAccountAge(365) end)", "InitalizeClientAppearance(plr,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,Hat1ID)", "LoadCharacterNew(newWaitForChild(plr,'Appearance'),plr.Character)", "game:GetService('Visit')", "while true do", "wait(0.001)", "if (plr.Character ~= nil) then", "if (plr.Character.Humanoid.Health == 0) then", "wait(5)", "plr:LoadCharacter()", "LoadCharacterNew(newWaitForChild(plr,'Appearance'),plr.Character,plr.Backpack)", "elseif (plr.Character.Parent == nil) then ", "wait(5)", "plr:LoadCharacter()", "LoadCharacterNew(newWaitForChild(plr,'Appearance'),plr.Character,plr.Backpack)", "end", "end", "end" ); string scriptfile = MultiLine( header, playersettings, customizationgen, code ); List <string> list = new List <string>(Regex.Split(scriptfile, Environment.NewLine)); string[] convertedList = list.ToArray(); File.WriteAllLines(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + GlobalVars.ScriptLuaFile, convertedList); }
protected override void OnFormClosing(FormClosingEventArgs e) { base.OnFormClosing(e); SecurityFuncs.WriteConfigValues(); }