Efficient Auto Talker

Discussion in 'Programming General' started by Teh.One, Dec 19, 2009.

Efficient Auto Talker
  1. Unread #1 - Dec 19, 2009 at 8:23 PM
  2. Teh.One
    Joined:
    Sep 18, 2009
    Posts:
    308
    Referrals:
    0
    Sythe Gold:
    0

    Teh.One Forum Addict
    Banned

    Efficient Auto Talker

    Well, this is a auto talker I made.

    You will need

    2 buttons, start and stop.
    And a textbox.
    And a Timer.


    Here is the code -

    Under
    Code:
    public partial class Form1 : Form
    {
    Declare

    Code:
    int count = 0;
    It is then like

    Code:
    public partial class Form1 : Form
    {
    int count = 0;
    Under
    Code:
        public Form1()
            {
                InitializeComponent();
            }
    Add this

    Code:
        public void stopProcess(String File)
            {
                System.Diagnostics.Process[] process = System.Diagnostics.Process.GetProcesses();
                for (int i = 0; i <= process.GetUpperBound(0); i++)
                {
                    if (process[i].ProcessName == File)
                    {
                        process[i].Kill();
                    }
                }
            }
    We use that method later on for stopping the talker.

    Here is your methods for button1

    Code:
            private void button1_Click(object sender, EventArgs e)
            {
                timer1.Interval = 1000;
                SendKeys.Send("%{TAB}");
                timer1.Enabled = true;
            }
    Timer methods

    Code:
            private void timer1_Tick(object sender, EventArgs e)
            {
                Random randomnum = new Random();
                timer1.Enabled = false;
                timer1.Interval = randomnum.Next(125, 225);
                if (count < textBox1.Text.Length)
                {
                    SendKeys.Send(textBox1.Text);
                    SendKeys.Send("{Enter}");
                    timer1.Enabled = true;
                }
                else
                {
                    count = 0;
                    SendKeys.Send("{Enter}");
    
                }
            }
    For button2, your stop button, your process is what you named it, mine was talker so I end the process talker.

    Code:
            private void button2_Click(object sender, EventArgs e)
            {
                stopProcess("Talker");
                timer1.Enabled = false;
            }
    I haven't added a frequency to it, but if you wanted, the code would be something like -

    Code:
                timer1.Interval = Convert.ToInt32(textBox2.Text);

    Note - I don't take all credits for this.
     
  3. Unread #2 - Dec 27, 2009 at 1:16 PM
  4. Blupig
    Joined:
    Nov 23, 2006
    Posts:
    7,145
    Referrals:
    16
    Sythe Gold:
    1,609
    Discord Unique ID:
    178533992981594112
    Valentine's Singing Competition Winner Member of the Month Winner MushyMuncher Gohan has AIDS Extreme Homosex World War 3 I'm LAAAAAAAME
    Off Topic Participant

    Blupig BEEF TOILET
    $5 USD Donor

    Efficient Auto Talker

    lol sendkeys
     
  5. Unread #3 - Dec 27, 2009 at 1:42 PM
  6. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    Efficient Auto Talker

    ^I'l infract you for spamming sir!
     
  7. Unread #4 - Dec 27, 2009 at 3:27 PM
  8. deathbal sam
    Joined:
    Sep 25, 2008
    Posts:
    754
    Referrals:
    0
    Sythe Gold:
    0

    deathbal sam Apprentice
    Banned

    Efficient Auto Talker

    Blupig if you have a better method why not post it?
     
< Opacity changer | JAVA : DICE ROLLS 20 TIMES and PRINTS THE RESULT >

Users viewing this thread
1 guest


 
 
Adblock breaks this site