Post: C# Flashing Name
05-22-2014, 09:52 AM #1
moxl
Save Point
(adsbygoogle = window.adsbygoogle || []).push({}); Hello guys!
I hereby publish my name flashing code.
Sorry for my bad english.

Im using MethodInvoker

    
namespace MW3
{
public partial class MW3 : Form
{
private Thread FlashName; // declare Thread for Invoke
private bool flashingNameIsRunninng = false; // for Invoke

private PS3API PS3 = new PS3API();
private Random rand = new Random();

#region Form
public MW3()
{
InitializeComponent();

FlashName = new Thread(new ThreadStart(Flash)); // for Invoke
FlashName.SetApartmentState(ApartmentState.STA); // for Invoke
}

private void MW3_Load(object sender, EventArgs e)
{
if (PS3.GetCurrentAPI() == SelectAPI.TargetManager)
{
PS3.PS3TMAPI_NET();
}
}

private void MW3_FormClosing(object sender, FormClosingEventArgs e)
{
FlashName.Abort(); // Invoke abort

PS3.DisconnectTarget();
}
#endregion


#region Name flashing
private void Flash()
{
while (flashingNameIsRunninng)
{
Invoke((MethodInvoker)(() => { FlashingName(); }));
Thread.Sleep(200);
}
FlashName.Abort();
}

private void FlashingName()
{
int text = textBoxChangeName.Text.Length; // Name length

// check Name length. if name length consists of 5 letters, then each letter has its own color
if (text == 5)
{
string[] letter = new string[5];
for (int i = 0; i < 5; i++)
{
string name = "^" + rand.Next(0, 9) + textBoxChangeName.Text[i];
letter[i] = name;
}
PS3.Extension.WriteString(0x01BBBC2C, string.Concat(letter));
}

// On otherwise, as usual
else if (text > 0 && text < 15)
{
string name = "^" + rand.Next(0, 9) + textBoxChangeName.Text;
PS3.Extension.WriteString(0x01BBBC2C, name);
}
}

private void checkBoxNameFlashing_CheckedChanged(object sender, EventArgs e)
{
if (checkBoxNameFlashing.Checked)
{
FlashName = new Thread(new ThreadStart(Flash));
FlashName.SetApartmentState(ApartmentState.STA);

if (!FlashName.IsAlive)
{
flashingNameIsRunninng = true;
FlashName.Start();
}
}
else
{
flashingnNameIsRunninng = false;
}
}
#endregion
}
}
(adsbygoogle = window.adsbygoogle || []).push({});
08-07-2014, 01:17 PM #2
Originally posted by moxl View Post
Hello guys!
I hereby publish my name flashing code.
Sorry for my bad english.

Im using MethodInvoker

    
namespace MW3
{
public partial class MW3 : Form
{
private Thread FlashName; // declare Thread for Invoke
private bool flashingNameIsRunninng = false; // for Invoke

private PS3API PS3 = new PS3API();
private Random rand = new Random();

#region Form
public MW3()
{
InitializeComponent();

FlashName = new Thread(new ThreadStart(Flash)); // for Invoke
FlashName.SetApartmentState(ApartmentState.STA); // for Invoke
}

private void MW3_Load(object sender, EventArgs e)
{
if (PS3.GetCurrentAPI() == SelectAPI.TargetManager)
{
PS3.PS3TMAPI_NET();
}
}

private void MW3_FormClosing(object sender, FormClosingEventArgs e)
{
FlashName.Abort(); // Invoke abort

PS3.DisconnectTarget();
}
#endregion


#region Name flashing
private void Flash()
{
while (flashingNameIsRunninng)
{
Invoke((MethodInvoker)(() => { FlashingName(); }));
Thread.Sleep(200);
}
FlashName.Abort();
}

private void FlashingName()
{
int text = textBoxChangeName.Text.Length; // Name length

// check Name length. if name length consists of 5 letters, then each letter has its own color
if (text == 5)
{
string[] letter = new string[5];
for (int i = 0; i < 5; i++)
{
string name = "^" + rand.Next(0, 9) + textBoxChangeName.Text[i];
letter[i] = name;
}
PS3.Extension.WriteString(0x01BBBC2C, string.Concat(letter));
}

// On otherwise, as usual
else if (text > 0 && text < 15)
{
string name = "^" + rand.Next(0, 9) + textBoxChangeName.Text;
PS3.Extension.WriteString(0x01BBBC2C, name);
}
}

private void checkBoxNameFlashing_CheckedChanged(object sender, EventArgs e)
{
if (checkBoxNameFlashing.Checked)
{
FlashName = new Thread(new ThreadStart(Flash));
FlashName.SetApartmentState(ApartmentState.STA);

if (!FlashName.IsAlive)
{
flashingNameIsRunninng = true;
FlashName.Start();
}
}
else
{
flashingnNameIsRunninng = false;
}
}
#endregion
}
}

Why Use all that coding? there is a much simpler way. :/
08-10-2014, 03:38 AM #3
1austin112
League Champion
Originally posted by moxl View Post
Hello guys!
I hereby publish my name flashing code.
Sorry for my bad english.

Im using MethodInvoker

    
namespace MW3
{
public partial class MW3 : Form
{
private Thread FlashName; // declare Thread for Invoke
private bool flashingNameIsRunninng = false; // for Invoke

private PS3API PS3 = new PS3API();
private Random rand = new Random();

#region Form
public MW3()
{
InitializeComponent();

FlashName = new Thread(new ThreadStart(Flash)); // for Invoke
FlashName.SetApartmentState(ApartmentState.STA); // for Invoke
}

private void MW3_Load(object sender, EventArgs e)
{
if (PS3.GetCurrentAPI() == SelectAPI.TargetManager)
{
PS3.PS3TMAPI_NET();
}
}

private void MW3_FormClosing(object sender, FormClosingEventArgs e)
{
FlashName.Abort(); // Invoke abort

PS3.DisconnectTarget();
}
#endregion


#region Name flashing
private void Flash()
{
while (flashingNameIsRunninng)
{
Invoke((MethodInvoker)(() => { FlashingName(); }));
Thread.Sleep(200);
}
FlashName.Abort();
}

private void FlashingName()
{
int text = textBoxChangeName.Text.Length; // Name length

// check Name length. if name length consists of 5 letters, then each letter has its own color
if (text == 5)
{
string[] letter = new string[5];
for (int i = 0; i < 5; i++)
{
string name = "^" + rand.Next(0, 9) + textBoxChangeName.Text[i];
letter[i] = name;
}
PS3.Extension.WriteString(0x01BBBC2C, string.Concat(letter));
}

// On otherwise, as usual
else if (text > 0 && text < 15)
{
string name = "^" + rand.Next(0, 9) + textBoxChangeName.Text;
PS3.Extension.WriteString(0x01BBBC2C, name);
}
}

private void checkBoxNameFlashing_CheckedChanged(object sender, EventArgs e)
{
if (checkBoxNameFlashing.Checked)
{
FlashName = new Thread(new ThreadStart(Flash));
FlashName.SetApartmentState(ApartmentState.STA);

if (!FlashName.IsAlive)
{
flashingNameIsRunninng = true;
FlashName.Start();
}
}
else
{
flashingnNameIsRunninng = false;
}
}
#endregion
}
}

Way to much coding man.....
Put this in a button..

byte[] NAME = Encoding.ASCII.GetBytes(Textbox for name input here);
Array.Resize(ref NAME, NAME.Length + 1);
PS3.SetMemory(0x001bbbc2c, NAME);


make checkbox or whatever you want to start the flash and stop it


if (metroCheckBox87.Checked)
{
timer10.Start();
}
else
{
timer10.Stop();
}


Then the timer to make the flash

Random random = new Random();
int Color = random.Next(0, 7);
byte[] Code1 = Encoding.ASCII.GetBytes("^" + Color + metroTextBox17.Text);
Array.Resize(ref Code1, Code1.Length + 1);
PS3.SetMemory(0x001bbbc2c, Code1);



(metroTextBox17.Text was just the text box i had for my name input)


Much simpler and alot less coding

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo