Jump to content

AutoTyper(Spammer) In C#

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
9 replies to this topic

#1
Kierien

Kierien

    Learning Programmer

  • Members
  • PipPipPip
  • 32 posts
Hey,

This tut is extremely simple, a good one for C# beginners =)

First create a new C# project by going to

File>New>C#>Windows Forms Application

Then add 1 timer, 3 textboxes, and 2 buttons.

First were gonna give your timer a code, double click on your timer and add this code

SendKeys.Send(textBox1.text);
SendKeys.Send("{ENTER}");
SendKeys.Send(textBox2.text);
SendKeys.Send("{ENTER}");
SendKeys.Send(textBox3.text);
SendKeys.Send("{ENTER}");

The SendKeys Function basically types out the text you specify.

Now rename one of your buttons to "Start", and give it the following code

timer1.Enabled = true;

This enabled the timer, which in return, starts spamming your text.

Then rename another one to "Stop", and give it the code below

timer1.Enabled = false;

This disables your times, which stops the spamming.

And ur done =D

How simple was that? :rolleyes:

Hope you learned a thing or two from this.

~kierien

Edited by Kierien, 31 January 2009 - 09:02 PM.


#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
Not bad, perhaps a bit more explanation though? Newbs are not going to know what a timer does or what the SendKeys class is. Perhaps you should give more detail on these two things. Also, don't you need a timer_tick function before your timer1 will do anything?

#3
Kierien

Kierien

    Learning Programmer

  • Members
  • PipPipPip
  • 32 posts

Jordan said:

Not bad, perhaps a bit more explanation though? Newbs are not going to know what a timer does or what the SendKeys class is. Perhaps you should give more detail on these two things. Also, don't you need a timer_tick function before your timer1 will do anything?

Alright, will reedit to more detail, and no we dont need a timer_tick, because we already have our timer enabled and disabled via buttons.

~kierien

#4
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
You have misunderstood. Timer_Tick is the subroutine that runs whenever the timer ticks.

All of this code:

SendKeys.Send(textBox1.text);
SendKeys.Send("{ENTER}");
SendKeys.Send(textBox2.text);
SendKeys.Send("{ENTER}");
SendKeys.Send(textBox3.text);
SendKeys.Send("{ENTER}");

..is put within the timer_tick subroutine.
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#5
wajouba

wajouba

    Newbie

  • Members
  • Pip
  • 6 posts
ok, I'm very new, so should I attempt this or not, cause it looks like its incomplete or lacking info...?!

:)

#6
wajouba

wajouba

    Newbie

  • Members
  • Pip
  • 6 posts
I tried this, and got some errors at the end of each of the SendKeys.Send(textBox1.text);

the error is:
dosn't contain definition for text and no extension method text.

Did I need a reference that I didn't use?! :S
I don't get it sorry I'm new :$

#7
Kierien

Kierien

    Learning Programmer

  • Members
  • PipPipPip
  • 32 posts
It's .Text, not .text

#8
chili5

chili5

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 7,247 posts
I think the IDE will correct that for you.

What does this do?

SendKeys.Send(textBox1.text);

Like Jordan said, newbs won't understand what this is doing.

Now rename one of your buttons to "Start"

Why? I don't see anywhere in your code, you referencing the button that you want me to call "Start". So why should I?

Quote

Alright, will reedit to more detail, and no we dont need a timer_tick, because we already have our timer enabled and disabled via buttons.

Yes, you do need a timer_tick method. When you double click on a timer, one is created for you.

#9
wajouba

wajouba

    Newbie

  • Members
  • Pip
  • 6 posts
yes its true im trying to figure out what its doing, but I guess tomorow mourning would be better... plus you are right .Text was the problem, I did it and I got stuck in the autospamer when I tried it... :)

#10
Kierien

Kierien

    Learning Programmer

  • Members
  • PipPipPip
  • 32 posts

chili5 said:

I think the IDE will correct that for you.

What does this do?


SendKeys.Send(textBox1.text);


Like Jordan said, newbs won't understand what this is doing.


Now rename one of your buttons to "Start"


Why? I don't see anywhere in your code, you referencing the button that you want me to call "Start". So why should I?



Yes, you do need a timer_tick method. When you double click on a timer, one is created for you.

First of all, i wanted to rename the button to "Start" so that things will look neater. Secondly, yes i know when i double click on a timer a timer_tick is created for me. But i was referring to Jordan's post on whether a timer_tick was needed before the timer would function. And yeah we would need one, but it's already created anyway.