Jump to content

SpamBot


James
 Share

Recommended Posts

Hey,

I made this for a friend, who is learning AutoIt :whistle: I fully commented it for him, and I thought I could post it here, so everyone who begins can learn basic things.

Functions

GUI

And loops

#include <GuiConstants.au3>     ; Include this file to allow the GUI to be made

$sGui = GuiCreate("SSpamBot", 250, 100, -1, -1)                     ; Create the GUI
$sLab = GUICtrlCreateLabel("SSpamBot - Secure_ICT", 70, 5, -1, -1)  ; Create a label with text
$sInp = GuiCtrlCreateInput("", 5, 22, 240, -1)                      ; Create an Input
        GUICtrlSetTip($sInp, "What text is to be spammed?")         ; Create tip when mouse hovers over the control
$sAmo = GUICtrlCreateInput("", 5, 45, 240, -1)                      ; Create an Input
        GuiCtrlSetTip($sAmo, "How many times?")                     ; Crate tip when mouse hovers over the control
$sbGo = GuiCtrlCreateButton("Start Spamming", 5, 70, -1, -1)        ; Create a button
        GUICtrlSetTip($sbGo, "Start the spamming!")                 ; Create tip whe mouse hovers over the control
$sCan = GUICtrlCreateButton("Cancel", 90, 70, -1, -1)               ; Create a button
        GUICtrlSetTip($sCan, "Cancel SSpambot!")                    ; Create tip when mouse hovers over the control
        
GuiSetState()   ; Set the state of the window

While 1                     ; While the program is running do things
    $sMsg = GuiGetMsg()     ; Allow the script to recieve and send "messages"
    Switch $sMsg            ; Start switching through events
    Case $GUI_EVENT_CLOSE   ; What will happen if the window closes?
        Exit                ; Exit
    Case $sbGo              ; What will happen if the spam button is pressed?
        _Spammer()          ; Do a function
    Case $sCan              ; What will happen if the cancel button is pressed?
        Exit                ; Exit
    EndSwitch               ; End the switching
Wend                        ; While End - While the statement ends

Func _Spammer()                                                                 ; Start a function
    $sTxt = GuiCtrlRead($sInp)                                                  ; Read a control
    $sNum = GuiCtrlRead($sAmo)                                                  ; Read a control
    If $sTxt = "" Then MsgBox(16, "SSpambot", "There was no text entered!")     ; If a control = something then do something else
    If $sAmo = "" Then MsgBox(16, "SSpambot", "There was no number entered!")   ; If a control = something then do something else
        GuiSetState(@SW_HIDE, $sGui)                                            ; Hide the window
    For $i = 1 to $sNum                                                         ; Start a loop
        Send($sTxt & "{Enter}")                                                 ; In the loop send a read control's text
    Next                                                                        ; And carry on doing it untill the loop ends
        GuiSetState(@SW_SHOW, $sGui)                                            ; Show the GUI after the loop has ended
EndFunc                                                                         ; End the function

Thanks,

Secure

Link to comment
Share on other sites

Thanks secure, but there are hundreds of examples in the helpfile, this is merely a waste of, yet another, Topic. I cannot understand why you create these garbage topics in scripts & scraps, it's simply a waste. It seems asthough you create one or two topics a day, all of which are filled with crap.

Regards,

Kurt

Awaiting Diablo III..

Link to comment
Share on other sites

I'm not posting for the post count, if a mod wants, they can set me to -1000000 or whatever. I'm posting because things like these are useful to newbies and myself.

All this does, for the newbies out there who wanted to know, is send text over and over and over again. It doesn't send email spam, it doesn't really do anything except send text over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over.

Thats all.

So, secure_itc, what was the point of this? I mean, the commenting may help people out, but the help files are much more thorough.

Link to comment
Share on other sites

i just noticed you used

For $i = 1 to $sNum ; Start a loop

Send($sTxt & "{Enter}") ; In the loop send a read control's text

Next

what that will "theoritically" do is if you loose focus, or want to stop it, it will just flood your computer with the send command, u might wanna add a hotkey to close the script just incase.. :whistle:

Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet()
Link to comment
Share on other sites

Hey

I agree with Kurt & Orange this is useless:

The button cancel doesnt cancel it just exits the app what about rename it to Exit , And as Mr revoked an hotkey would be very usefull.

In the function _spammer you error check which is good, but you dont exit the function with return , if there is no text in the text to spammed, or no numbers to the for loop.

Just my 2 cents.

-Rambo

My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! you’re the best in town Fight!
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...