Ejemplo n.º 1
0
        void Button1Click(object sender, EventArgs e)
        {
            SecurityFuncs.WriteConfigValues();
            ScriptGenerator.GenerateScriptForClient();
            //temp domain
            string exefile = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + GlobalVars.EXEName;
            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);
        }
Ejemplo n.º 2
0
        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(
                "--Header",
                "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,
                "AnimatedCharacter = " + GlobalVars.AnimatedCharacter.ToString().ToLower()
                );

            string playersettings = MultiLine(
                "--Player Settings",
                "UserID = " + GlobalVars.UserID,
                "PlayerName = '" + GlobalVars.Name + "'"
                );

            string customizationsettings = "";

            if (GlobalVars.AnimatedCharacter == false)
            {
                customizationsettings = MultiLine(
                    "--Customization Settings",
                    "Hat1ID = 'NoHat.rbxm'"
                    );
            }
            else
            {
                customizationsettings = MultiLine(
                    "--Customization Settings",
                    "Hat1ID = '" + GlobalVars.HatName + "'"
                    );
            }

            string colorsettings = "";

            if (GlobalVars.AnimatedCharacter == false)
            {
                if (GlobalVars.UseRandomColors)
                {
                    colorsettings = GeneratePlayerColorString();
                }
                else
                {
                    colorsettings = GeneratePlayerColorPresetString(GlobalVars.PlayerColorPreset);
                }
            }
            else
            {
                colorsettings = MultiLine(
                    "--Color Settings",
                    "HeadColorID = " + GlobalVars.HeadColor,
                    "TorsoColorID = " + GlobalVars.TorsoColor,
                    "LeftArmColorID = " + GlobalVars.LeftArmColor,
                    "RightArmColorID = " + GlobalVars.RightArmColor,
                    "LeftLegColorID = " + GlobalVars.LeftLegColor,
                    "RightLegColorID = " + GlobalVars.RightLegColor
                    );
            }

            //add customization funcs
            string customizationgen = MultiLine(
                "--Customization Code",
                "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"
                );

            //finally, we generate the actual script code.

            string code = MultiLine(
                "--Game Code",
                "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)",
                "if (AnimatedCharacter == false) then",
                "if plr.Character:FindFirstChild('Animate') then",
                "plr.Character.Animate:Remove()",
                "end",
                "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)",
                "if (AnimatedCharacter == false) then",
                "if plr.Character:FindFirstChild('Animate') then",
                "plr.Character.Animate:Remove()",
                "end",
                "end",
                "elseif (plr.Character.Parent == nil) then",
                "wait(5)",
                "plr:LoadCharacter()",
                "LoadCharacterNew(newWaitForChild(plr,'Appearance'),plr.Character,plr.Backpack)",
                "if (AnimatedCharacter == false) then",
                "if plr.Character:FindFirstChild('Animate') then",
                "plr.Character.Animate:Remove()",
                "end",
                "end",
                "end",
                "end",
                "end"
                );

            string scriptfile = MultiLine(
                header,
                playersettings,
                customizationsettings,
                colorsettings,
                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);
        }
Ejemplo n.º 3
0
        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;
            checkBox1.Checked        = GlobalVars.Shadows;

            if (GlobalVars.EXEName == "RobloxShaders.exe")
            {
                checkBox2.Checked = true;
            }
            else
            {
                checkBox2.Checked = false;
            }

            if (GlobalVars.AnimatedCharacter == false)
            {
                groupBox1.Enabled = true;
                if (GlobalVars.UseRandomColors == true)
                {
                    label9.Enabled      = false;
                    button3.Enabled     = false;
                    button4.Enabled     = false;
                    button5.Enabled     = false;
                    button6.Enabled     = false;
                    button7.Enabled     = false;
                    button9.Enabled     = false;
                    button10.Enabled    = false;
                    button11.Enabled    = false;
                    panel1Head.Enabled  = false;
                    panel2Torso.Enabled = false;
                    panel3LLeg.Enabled  = false;
                    panel4LArm.Enabled  = false;
                    panel5RLeg.Enabled  = false;
                    panel6RArm.Enabled  = false;
                    checkBox4.Checked   = true;
                    SetColorsToPreset(1);
                    GlobalVars.PlayerColorPreset = 1;
                }
                else
                {
                    label9.Enabled      = true;
                    button3.Enabled     = true;
                    button4.Enabled     = true;
                    button5.Enabled     = true;
                    button6.Enabled     = true;
                    button7.Enabled     = true;
                    button9.Enabled     = true;
                    button10.Enabled    = true;
                    button11.Enabled    = true;
                    panel1Head.Enabled  = true;
                    panel2Torso.Enabled = true;
                    panel3LLeg.Enabled  = true;
                    panel4LArm.Enabled  = true;
                    panel5RLeg.Enabled  = true;
                    panel6RArm.Enabled  = true;
                    checkBox4.Checked   = false;
                }
                ToggleCustomization(false);
                checkBox3.Checked = true;
            }
            else
            {
                groupBox1.Enabled = false;
                if (GlobalVars.UseRandomColors == true)
                {
                    checkBox4.Checked = true;
                }
                ToggleCustomization(true);
                checkBox3.Checked = false;
            }

            SetColorsToPreset(GlobalVars.PlayerColorPreset);
        }
Ejemplo n.º 4
0
 protected override void OnFormClosing(FormClosingEventArgs e)
 {
     base.OnFormClosing(e);
     SecurityFuncs.WriteConfigValues();
 }