Jump to content

Stopping the loop


nf67
 Share

Recommended Posts

^ And that's something I really don't understand =P, but, Danwilli, I just know that you know how to make my updated GUI always stay on top!

Please check out my new code ( still doesn't really have any resources so can be run on any PC ): ( some translations included at the bottom )

[uPDATED, STOPS IMMEDIATELY NOW]

#include <GUIConstants.au3>

;;;;;;;GUI;;;;;;;;;
#Region ### START Koda GUI section ### Form=
$Golfjesmaker = GUICreate("Golfjesmaker", 242, 52, 193, 125)
$Text = GUICtrlCreateInput("Scroll naar bij zooi.co.nr naar onder voor uitleg", 0, 0, 241, 21)
$Golf = GUICtrlCreateButton("Golf", 176, 24, 65, 25, 0)
$Stop = GUICtrlCreateButton("Stop", 0, 24, 65, 25, 0)
$StopValue = 0
GUICtrlCreateEdit("Golfjesmaker 1-Typ je bericht 2-Druk op Spam 3-Zet je cursor binnen 5 sec. op de golfplek (msn invoervakje)    4-Na 5 sec. begint de golf van je text 5-Druk op Stop om te stoppen -zooi.co.nr-", 64, 32, 113, 17, BitOR($ES_AUTOVSCROLL,$ES_READONLY,$ES_WANTRETURN,$WS_VSCROLL))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
                                    ;ALWAYS STAY ON TOP CODE IS MISSING
;;;;;;;Script;;;;;;
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Golf
            Sleep ( 5000 )          ; Time to put cursor somewhere
               While $StopValue <= 1  ; Loop from here to WEnd if StopValue is below 1 ( it always is )
            $nMsg = GUIGetMsg() 
            If $nMsg = $Stop Then ExitLoop; Stop the loop when $Stop is pressed (checks after every send so it stops ASAP) 
            Send(GUICtrlRead($Text))                                 ;Start of the wave effect 
            Send("{ENTER}")
            If GUIGetMsg() = $Stop Then ExitLoop
            Send("{SPACE}" & GUICtrlRead($Text))    
            Send("{ENTER}")
            If GUIGetMsg() = $Stop Then ExitLoop
            Send("{SPACE}{SPACE}" & GUICtrlRead($Text)) 
            Send("{ENTER}")
            If GUIGetMsg() = $Stop Then ExitLoop
            Send("{SPACE}{SPACE}{SPACE}" & GUICtrlRead($Text)) 
            Send("{ENTER}")
            If GUIGetMsg() = $Stop Then ExitLoop    
            Send("{SPACE}{SPACE}{SPACE}{SPACE}" & GUICtrlRead($Text))   
            Send("{ENTER}")
            If GUIGetMsg() = $Stop Then ExitLoop    
            Send("{SPACE}{SPACE}{SPACE}{SPACE}{SPACE}" & GUICtrlRead($Text))      
            Send("{ENTER}")
            If GUIGetMsg() = $Stop Then ExitLoop    
            Send("{SPACE}{SPACE}{SPACE}{SPACE}{SPACE}{SPACE}" & GUICtrlRead($Text)) 
            Send("{ENTER}")
            If GUIGetMsg() = $Stop Then ExitLoop    
            Send("{SPACE}{SPACE}{SPACE}{SPACE}{SPACE}" & GUICtrlRead($Text))        
            Send("{ENTER}")
            If GUIGetMsg() = $Stop Then ExitLoop    
            Send("{SPACE}{SPACE}{SPACE}{SPACE}" & GUICtrlRead($Text))   
            Send("{ENTER}")
            If GUIGetMsg() = $Stop Then ExitLoop    
            Send("{SPACE}{SPACE}{SPACE}" & GUICtrlRead($Text))      
            Send("{ENTER}")
            If GUIGetMsg() = $Stop Then ExitLoop    
            If GUIGetMsg() = $Stop Then ExitLoop    
            Send("{SPACE}{SPACE}" & GUICtrlRead($Text)) 
            Send("{ENTER}")
            If GUIGetMsg() = $Stop Then ExitLoop    
            Send("{SPACE}" & GUICtrlRead($Text))      
            Send("{ENTER}")                 ;End of the wave effect, should start at begin again
            If GUIGetMsg() = $Stop Then ExitLoop    
        WEnd                   ;End of the loop from While
    EndSwitch
WEnd

;Translation of the default Input message:
;Scroll down at Wavemaker (Golfjesmaker in Dutch) for explanation 

;Translation of the Edit:
;Golfjesmaker 1-Typ je bericht 2-Druk op Spam 3-Zet je cursor binnen 5 sec. op de golfplek (msn invoervakje)      4-Na 5 sec. begint de golf van je text 5-Druk op Stop om te stoppen -zooi.co.nr-
;Wavemaker 1-Type your message 2-Press Spam 3-Put your cursor on the wavespot ( msn input window ) within 5 seconds 4-After 5 sec. the wave of your text starts 5-Press Stop to stop -zooi.co.nr-

I still miss the Always stay on top code...

DeathNote is about a really good student which finds a notebook and decides to clean teh world of all evil, but he gets obsessed by his task and totally freaks out.. ( kinda gets evil himself ). His enemy is L ( no one knows his face nor his name. These are needed to kill with the DeathNote), which is a young a guy too. He's extremely smart ( just like Yagami Light, which finds the DeatNote, he is also called Kira later ( comes from Killer ). Just watch the first episode and you'll get to know the extremely high level of smart thinking and unpredictable situations.

Edited by nf67
Link to comment
Share on other sites

  • Replies 43
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

@danwilli

have you tested the source yourself? On this computer it nearly freezes if you turn the time to 1 second, you cant do anything, I had to shutdown the computer :/

@nf67

You could add:

If GUIGetMsg() = $Stop Then ExitLoop

after every Send(), if you need it instant, but that is not so handy either...

Edited by LinuZ
Link to comment
Share on other sites

Works fine! It stops greta now :-)

I updated the code ( see my last post with code ).

@danwilli: I had to reboot too as I told you in my PM, did your mouse also kinda freeze Linuz? Danwilli, do you know the code to make the GUI always stay on top of other windows? So you can easily put your cursor somewhere and stop faster? Thank you!

Edited by nf67
Link to comment
Share on other sites

#include <GUIConstants.au3>

;;;;;;;GUI;;;;;;;;;
#Region ### START Koda GUI section ### Form=
$Golfjesmaker = GUICreate("Golfjesmaker", 242, 52, 193, 125)
$Text = GUICtrlCreateInput("Scroll naar bij zooi.co.nr naar onder voor uitleg", 0, 0, 241, 21)
$Golf = GUICtrlCreateButton("Golf", 176, 24, 65, 25, 0)
$Stop = GUICtrlCreateButton("Stop", 0, 24, 65, 25, 0)
$StopValue = 0
$wavesize = 6 ; SIZE OF WAVE
GUICtrlCreateEdit("Golfjesmaker 1-Typ je bericht 2-Druk op Spam 3-Zet je cursor binnen 5 sec. op de golfplek (msn invoervakje)      4-Na 5 sec. begint de golf van je text 5-Druk op Stop om te stoppen, de laatste golf zal nog worden afgemaakt. -zooi.co.nr-", 64, 32, 113, 17, BitOR($ES_AUTOVSCROLL, $ES_READONLY, $ES_WANTRETURN, $WS_VSCROLL))
GUISetState(@SW_SHOW)
#EndRegion ### START Koda GUI section ### Form=
;ALWAYS STAY ON TOP CODE IS MISSING
;;;;;;;Script;;;;;;
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Golf
            Sleep(5000) ; Time to put cursor somewhere
            While $StopValue <= 1 ; Loop from here to WEnd if StopValue is below 1 ( it always is )
                For $wnum = 0 To $wavesize
                    $nMsg = GUIGetMsg()
                    If $nMsg = $Stop Then ExitLoop(2); Stop the loop when $Stop is pressed ( still finishes what's in the loop though ) IMMEDIATE STOP CODE IS MISSING
                    $tempClip = ClipGet()
                    ClipPut(GUICtrlRead($Text))
                    For $wave = 0 To $wnum
                        Send("{SPACE}")
                    Next
                    Send("^v{ENTER}")
                Next
                For $wnum = $wavesize To 0 Step -1
                    $nMsg = GUIGetMsg()
                    If $nMsg = $Stop Then ExitLoop(2)
                    For $wave = $wnum To 0 Step -1
                        Send("{SPACE}")
                    Next
                    Send("^v{ENTER}");End of the wave effect, should start at begin again if $Stop isn't pressed
                Next
            WEnd ;End of the loop from While
    EndSwitch
WEnd

Link to comment
Share on other sites

Works fine! It stops greta now :-)

I updated the code ( see my last post with code ).

@danwilli: I had to reboot too as I told you in my PM, did your mouse also kinda freeze Linuz? Danwilli, do you know the code to make the GUI always stay on top of other windows? So you can easily put your cursor somewhere and stop faster? Thank you!

Good, and yes for the mouse freezing.

@Danwilli

No problem, my own fault, now I have learned to put an hotkey for exit in all sources I test from now on :)

Link to comment
Share on other sites

Code with on top attribute, and adjustable wave size

#include <GUIConstants.au3>

;;;;;;;GUI;;;;;;;;;
#Region ### START Koda GUI section ### Form=
$Golfjesmaker = GUICreate("Golfjesmaker", 242, 52, 193, 125, -1, BitOR( $WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
$Text = GUICtrlCreateInput("Scroll naar bij zooi.co.nr naar onder voor uitleg", 0, 0, 241, 21)
$Golf = GUICtrlCreateButton("Golf", 176, 24, 65, 25, 0)
$Stop = GUICtrlCreateButton("Stop", 0, 24, 65, 25, 0)
$StopValue = 0
$wavesize = 12 ; SIZE OF WAVE
GUICtrlCreateEdit("Golfjesmaker 1-Typ je bericht 2-Druk op Spam 3-Zet je cursor binnen 5 sec. op de golfplek (msn invoervakje)      4-Na 5 sec. begint de golf van je text 5-Druk op Stop om te stoppen, de laatste golf zal nog worden afgemaakt. -zooi.co.nr-", 64, 32, 113, 17, BitOR($ES_AUTOVSCROLL, $ES_READONLY, $ES_WANTRETURN, $WS_VSCROLL))
GUISetState(@SW_SHOW)
#EndRegion ### START Koda GUI section ### Form=
;ALWAYS STAY ON TOP CODE IS MISSING
;;;;;;;Script;;;;;;
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Golf
            Sleep(5000) ; Time to put cursor somewhere
            While $StopValue <= 1 ; Loop from here to WEnd if StopValue is below 1 ( it always is )
                For $wnum = 0 To $wavesize
                    $nMsg = GUIGetMsg()
                    If $nMsg = $Stop Then ExitLoop(2); Stop the loop when $Stop is pressed ( still finishes what's in the loop though ) IMMEDIATE STOP CODE IS MISSING
                    $tempClip = ClipGet()
                    ClipPut(GUICtrlRead($Text))
                    For $wave = 0 To $wnum
                        Send("{SPACE}")
                    Next
                    Send("^v{ENTER}")
                Next
                For $wnum = $wavesize To 0 Step -1
                    $nMsg = GUIGetMsg()
                    If $nMsg = $Stop Then ExitLoop(2)
                    For $wave = $wnum To 0 Step -1
                        Send("{SPACE}")
                    Next
                    Send("^v{ENTER}");End of the wave effect, should start at begin again if $Stop isn't pressed
                Next
            WEnd ;End of the loop from While
    EndSwitch
WEnd
Link to comment
Share on other sites

That works great now Danwilli, but I don't understand how it works.. :-S

What's all this ???

wnum? ^v? tempclip?

Will you please give some ;s?

$tempClip = ClipGet()
                    ClipPut(GUICtrlRead($Text))
                    For $wave = 0 To $wnum
                        Send("{SPACE}")
                    Next
                    Send("^v{ENTER}")
                Next
                For $wnum = $wavesize To 0 Step -1
                    $nMsg = GUIGetMsg()
                    If $nMsg = $Stop Then ExitLoop(2)
                    For $wave = $wnum To 0 Step -1
                        Send("{SPACE}")
                    Next
                    Send("^v{ENTER}");End of the wave effect, should start at begin again if $Stop isn't pressed
                Next

Keep in mind that I've only written like 5 or 4 scripts, with the help of ElTorro and Danwilli...

Link to comment
Share on other sites

Thanks a lot for this!!

( $WS_EX_TOOLWINDOW, $WS_EX_TOPMOST)

I really like the window style ( I guess that's being controlled by toolwindow? ) and the topmost :-) :-)

Exactly what I wanted

Thanks

Link to comment
Share on other sites

I hope this will help you:

#include <GUIConstants.au3>

$Golfjesmaker = GUICreate("Golfjesmaker", 242, 52, (@DesktopWidth / 2) - 121, 0, -1, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
$Text = GUICtrlCreateInput("Scroll naar bij zooi.co.nr naar onder voor uitleg", 0, 0, 241, 21)
$Golf = GUICtrlCreateButton("Golf", 176, 24, 65, 25, 0)
$Stop = GUICtrlCreateButton("Stop", 0, 24, 65, 25, 0)
Global $StopValue = 0, $sel = 0, $Activewin = "", $wavesize = 12 ; Stop trigger, For winselect() and start() to communicate, the window to spam, SIZE OF WAVE
GUICtrlCreateEdit("Golfjesmaker 1-Typ je bericht 2-Druk op Spam 3-Zet je cursor binnen 5 sec. op de golfplek (msn invoervakje)      4-Na 5 sec. begint de golf van je text 5-Druk op Stop om te stoppen, de laatste golf zal nog worden afgemaakt. -zooi.co.nr-", 64, 32, 113, 17, BitOR($ES_AUTOVSCROLL, $ES_READONLY, $ES_WANTRETURN, $WS_VSCROLL))
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Golf
            Start() ; This function sets a hotkey for enter, and when pressed, calls the winselect() function, and the winselect function will store the currently selected Windows handle (ID) to a variable
    EndSwitch
    If $StopValue = 0 Then ; checks to see if spam should run or not
        $sel = 0; Reset the $sel variable if not set to run spammer() (this way we can start it again and the Start() and Winselect() functions will still work
    Else
        spammer(); calls our spamming function
    EndIf
WEnd

Func Start()
    SplashTextOn("test", "Please select the window you wish to spam and press ENTER to start", @DesktopWidth / 6, 100, 0, 0, 1); Splash promt for window selection
    HotKeySet("{ENTER}", "winselect"); Makes "enter" key start the winselect Function
    While $sel = 0; Starts while loop and waits for $sel to = anything but 0
        Sleep(10);Save the CPU
    WEnd
    SplashOff(); Kill splash text
    HotKeySet("{ENTER}"); Stops the hotkey for Enter so that it can be used again
    $StopValue = 1; Change the StopValue to 1 (1 = Started, 0 = Stopped)
EndFunc   ;==>Start
Func winselect(); stores the currently selected Windows handle (ID) to a variable
    $Activewin = WinGetHandle(""); stores the currently selected Windows handle (ID) to a variable
    $sel = 1; Sets $sel to 1 so that the Start function can know when to continue
EndFunc   ;==>winselect
Func spammer(); This is our main function that is in charge of sending out the spams
    For $wnum = 0 To $wavesize; Starts a for loop with our wavesize as the limit
        CheckStop() ; This fuction will check if stop has been pressed and set $stopvalue accordingly
        If $StopValue = 0 Then; Checks if stopvalue is 0, if so, exit this loop
            ExitLoop; Leaves For Loop
        EndIf
        ClipPut(GUICtrlRead($Text)); Sets text to the clipboard so that we can paste it in (fast), instead of type it in (slow)
        For $wave = 0 To $wnum; Starts for loop for sending spaces
            While WinGetHandle("") <> $Activewin ; Checks to see if the active window is still the window we wanted to spam (so we don't spam the wrong spot)
                CheckStop() ; This fuction will check if stop has been pressed and set $stopvalue accordingly
                If $StopValue = 0 Then; Checks if stopvalue is 0, if so, exit this loop
                    ExitLoop; Leaves For Loop
                EndIf
            WEnd
            Send("{SPACE}"); Sends Space $wave times
        Next
        While WinGetHandle("") <> $Activewin ; Checks to see if the active window is still the window we wanted to spam (so we don't spam the wrong spot)
            CheckStop() ; This fuction will check if stop has been pressed and set $stopvalue accordingly
            If $StopValue = 0 Then; Checks if stopvalue is 0, if so, exit this loop
                ExitLoop; Leaves For Loop
            EndIf
        WEnd
        Send("^v{ENTER}"); Sends Ctrl-V (paste) and then presses enter
    Next
    For $wnum = $wavesize To 0 Step -1; Sends Ctrl-V (paste) and then presses enter (backwards: Step -1)
        CheckStop() ; This fuction will check if stop has been pressed and set $stopvalue accordingly
        If $StopValue = 0 Then; Checks if stopvalue is 0, if so, exit this loop
            ExitLoop; Leaves For Loop
        EndIf
        For $wave = $wnum To 0 Step -1; Starts for loop for sending spaces (backwards: Step -1)
            While WinGetHandle("") <> $Activewin ; Checks to see if the active window is still the window we wanted to spam (so we don't spam the wrong spot)
                CheckStop() ; This fuction will check if stop has been pressed and set $stopvalue accordingly
                If $StopValue = 0 Then ; Checks if stopvalue is 0, if so, exit this loop
                    ExitLoop; Leaves For Loop
                EndIf
            WEnd
            Send("{SPACE}"); Sends Space $wave times
        Next
        While WinGetHandle("") <> $Activewin ; Checks to see if the active window is still the window we wanted to spam (so we don't spam the wrong spot)
            CheckStop() ; This fuction will check if stop has been pressed and set $stopvalue accordingly
            If $StopValue = 0 Then; Checks if stopvalue is 0, if so, exit this loop
                ExitLoop; Leaves For Loop
            EndIf
        WEnd
        Send("^v{ENTER}"); Sends Ctrl-V (paste) and then presses enter
    Next
EndFunc   ;==>spammer
Func CheckStop() ; This fuction will check if stop has been pressed and set $stopvalue accordingly
    $nMsg = GUIGetMsg()
    If $nMsg = $Stop Then
        $StopValue = 0
    EndIf
EndFunc   ;==>CheckStopoÝ÷ Ù©Ýjz'ªäyÛ©½êìÚºÚ"µÍÚ[ÛYH ÑÕRPÛÛÝ[Ë]LÉÝÂÌÍÑÛÛÛXZÙHÕRPÜX]J   ][ÝÑÛÛÛXZÙ][ÝË
L
ÚÝÜÚYÈHHLKLK]Ô    ÌÍÕÔ×ÑVÕÓÓÒSÕË  ÌÍÕÔ×ÑVÕÔSÔÕ
JBÌÍÕ^HÕRPÝÜX]R[]
    ][ÝÔØÜÛXZÛÚKÛËXÛÛÜZ]][ÝËKJBÌÍÑÛÛHÕRPÝÜX]P]Û   ][ÝÑÛÛ][ÝËMÍ
KK
BÌÍÔÝÜHÕRPÝÜX]P]Û  ][ÝÔÝÜ  ][ÝË
KK
BÛØ[  ÌÍÔÝÜ[YHH  ÌÍÜÙ[H  ÌÍÐXÝ]]Ú[H ][ÝÉ][ÝË    ÌÍÝØ]Ú^HHLÕRPÝÜX]QY]
    ][ÝÑÛÛÛXZÙKUHXÚQZÈÜÜ[HËV]HÝÛÜ[[
HÙXËÜHÛÛZÈ
Û[ÙZÚJH
SH
HÙXËYÚ[HÛÛ[H^
KQZÈÜÝÜÛHHÝÜ[HX]ÝHÛÛ[ÙÈÛÜ[[XXZÝ^ÛÚKÛËI][ÝË
ÌLLËMË]Ô    ÌÍÑT×ÐUUÕÐÔÓ   ÌÍÑT×ÔPQÓK    ÌÍÑT×ÕÐSUT    ÌÍÕÔ×ÕÐÔÓ
JBÕRTÙ]Ý]JÕ×ÔÒÕÊBÚ[HBIÌÍÛÙÈHÕRQÙ]ÙÊ
BTÝÚ]Ú   ÌÍÛÙÂBPØÙH   ÌÍÑÕRWÑUSÐÓÔÑBBBQ^]BPØÙH ÌÍÑÛÛBBTÝ

BQ[ÝÚ]ÚRY    ÌÍÔÝÜ[YHH[BIÌÍÜÙ[HQ[ÙBBÜ[[Y
BQ[[[ÈÝ

BTÜÚ^Û   ][ÝÝÝ    ][ÝË  ][ÝÔXÙHÙ[XÝHÚ[ÝÈ[ÝHÚÚÈÜ[H[ÜÈSTÈÝ   ][ÝËÚÝÜÚYÈ
LJNÈÜÚÛ]ÜÚ[ÝÈÙ[[ÛRÝÙ^]
    ][ÝÞÑSTI][ÝË   ][ÝÝÚ[Ù[][ÝÊBUÚ[H    ÌÍÜÙ[HBTÛY
L
BUÑ[TÜÚÙ
BRÝÙ^]
    ][ÝÞÑSTI][ÝÊBIÌÍÔÝÜ[YHHB[[Â[ÈÚ[Ù[XÝ

BIÌÍÐXÝ]]Ú[[Ù][J   ][ÝÉ][ÝÊBIÌÍÜÙ[HB[[Â[ÈÜ[[Y
BQÜ    ÌÍÝÛ[HHÈ   ÌÍÝØ]Ú^BBPÚXÚÔÝÜ

BBRY    ÌÍÔÝÜ[YHH[BBQ^]ÛÜBQ[YBPÛ]
ÕRPÝXY
    ÌÍÕ^
JBBQÜ  ÌÍÝØ]HHÈ   ÌÍÝÛ[BBBUÚ[[Ù][J   ][ÝÉ][ÝÊH   ÉÝÈ  ÌÍÐXÝ]]Ú[BBBPÚXÚÔÝÜ

BBBBRY  ÌÍÔÝÜ[YHH[BBBBQ^]ÛÜBBBQ[YBBUÑ[BBTÙ[
    ][ÝÞÔÔPÑ_I][ÝÊBBS^BUÚ[[Ù][J ][ÝÉ][ÝÊH   ÉÝÈ  ÌÍÐXÝ]]Ú[BBPÚXÚÔÝÜ

BBBRY   ÌÍÔÝÜ[YHH[BBBQ^]ÛÜBBQ[YBUÑ[BTÙ[
    ][Ý×ÑSTI][ÝÊBS^QÜ ÌÍÝÛ[HH ÌÍÝØ]Ú^HÈÝLBBPÚXÚÔÝÜ

BBRY    ÌÍÔÝÜ[YHH[BBQ^]ÛÜBQ[YBQÜ    ÌÍÝØ]HH ÌÍÝÛ[HÈÝLBBBUÚ[[Ù][J ][ÝÉ][ÝÊH   ÉÝÈ  ÌÍÐXÝ]]Ú[BBBPÚXÚÔÝÜ

BBBBRY  ÌÍÔÝÜ[YHH[BBBBQ^]ÛÜBBBQ[YBBUÑ[BBTÙ[
    ][ÝÞÔÔPÑ_I][ÝÊBBS^BUÚ[[Ù][J ][ÝÉ][ÝÊH   ÉÝÈ  ÌÍÐXÝ]]Ú[BBPÚXÚÔÝÜ

BBBRY   ÌÍÔÝÜ[YHH[BBBQ^]ÛÜBBQ[YBUÑ[BTÙ[
    ][Ý×ÑSTI][ÝÊBS^[[Â[ÈÚXÚÔÝÜ

BIÌÍÛÙÈHÕRQÙ]ÙÊ
BRY ÌÍÛÙÈH ÌÍÔÝÜ[BIÌÍÔÝÜ[YHHQ[Y[[

EDIT: Added non marked up code.

Note: Now if the user switches to the wrong app or window, the spammer will pause itself and continue when the user clicks back on to the window to be spammed.

Edited by danwilli
Link to comment
Share on other sites

Short update: I will chekc out your code now, but I will first tell you some crappy crap expirience. Chris: Hello here is the Wavemaker as you requested, I included instructions. MSNFriend: Cool, please send. Chris: *sends .exe* POPUP: .exe sending is blocked for the safety of contacts ( WTH, that's bullshit ) Chris: *sends .rar* MSNFriend: I can't open it ( Get winrar -.- ) Chris* Sends .zip* MSNFriend: This program is blocked for security reasons and will not be launched. Chris: Do you by chance happen to run Vista....? MSNFriend: Yes.... Chris: ************************************************** ( I hate vista, I did, but now I hate it even more )

Link to comment
Share on other sites

Wow danwilli, it works ;) I tested the idiot-proof version and it really is safe for idiots :). However, I have found a very inconvenient thing that we can't control.... MSN is too slow to handle the sends, as for the client it looks like a continuesly waving text. But if you start a second pc, log on and check what it's like to be the receiver it turns out that it lets through like 10 messages at once. Waits 3 seconds. Lets through some messages. Waits. Oh something coming through. It really isn't a waving text anymore, unless you manually scroll upwards.... I check the options but I found no Spamfilter or whatsoever, I also couldn't find an option to let through more messages.... damn.. I don't know what to do

Link to comment
Share on other sites

I just found that that I am not able to close the idiot version.. :S

Edit: Now I am :-S Didn't change anything. Please ignore this post but read the one up here ^

Edited by nf67
Link to comment
Share on other sites

If line by line, this should do the trick. This adds a $sleep variable that can be set to the number of seconds you wish to wait between line sends.

#include <GUIConstants.au3>

$Golfjesmaker = GUICreate("Golfjesmaker", 242, 52, (@DesktopWidth / 2) - 121, 0, -1, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
$Text = GUICtrlCreateInput("Scroll naar bij zooi.co.nr naar onder voor uitleg", 0, 0, 241, 21)
$Golf = GUICtrlCreateButton("Golf", 176, 24, 65, 25, 0)
$Stop = GUICtrlCreateButton("Stop", 0, 24, 65, 25, 0)
Global $StopValue = 0, $sel = 0, $Activewin = "", $wavesize = 12

Global $sleep = 2       ; How many seconds to delay between line sends (this can be a decimal)

GUICtrlCreateEdit("Golfjesmaker 1-Typ je bericht 2-Druk op Spam 3-Zet je cursor binnen 5 sec. op de golfplek (msn invoervakje)      4-Na 5 sec. begint de golf van je text 5-Druk op Stop om te stoppen, de laatste golf zal nog worden afgemaakt. -zooi.co.nr-", 64, 32, 113, 17, BitOR($ES_AUTOVSCROLL, $ES_READONLY, $ES_WANTRETURN, $WS_VSCROLL))
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Golf
            Start()
    EndSwitch
    If $StopValue = 0 Then
        $sel = 0
    Else
        spammer()
    EndIf
WEnd

Func Start()
    SplashTextOn("test", "Please select the window you wish to spam and press ENTER to start", @DesktopWidth / 6, 100, 0, 0, 1); Splash promt for window selection
    HotKeySet("{ENTER}", "winselect")
    While $sel = 0
        Sleep(10)
    WEnd
    SplashOff()
    HotKeySet("{ENTER}")
    $StopValue = 1
EndFunc
Func winselect()
    $Activewin = WinGetHandle("")
    $sel = 1
EndFunc
Func spammer()
    For $wnum = 0 To $wavesize
        CheckStop()
        If $StopValue = 0 Then
            ExitLoop
        EndIf
        ClipPut(GUICtrlRead($Text))
        For $wave = 0 To $wnum
            While WinGetHandle("") <> $Activewin
                CheckStop()
                If $StopValue = 0 Then
                    ExitLoop
                EndIf
            WEnd
            Send("{SPACE}")
        Next
        ;
        ;
        ;
        ;
        ;
        $timer = TimerInit()
        While WinGetHandle("") <> $Activewin or TimerDiff($timer) < $sleep * 1000
            CheckStop()
            If $StopValue = 0 Then
                ExitLoop
            EndIf
        WEnd
        Send("^v{ENTER}")
    Next
    For $wnum = $wavesize To 0 Step -1
        CheckStop()
        If $StopValue = 0 Then
            ExitLoop
        EndIf
        For $wave = $wnum To 0 Step -1
            While WinGetHandle("") <> $Activewin
                CheckStop()
                If $StopValue = 0 Then
                    ExitLoop
                EndIf
            WEnd
            Send("{SPACE}")
        Next
        $timer = TimerInit()
        While WinGetHandle("") <> $Activewin or TimerDiff($timer) < $sleep * 1000
            CheckStop()
            If $StopValue = 0 Then
                ExitLoop
            EndIf
        WEnd
        Send("^v{ENTER}")
    Next
EndFunc
Func CheckStop()
    $nMsg = GUIGetMsg()
    If $nMsg = $Stop Then
        $StopValue = 0
    EndIf
EndFunc
Link to comment
Share on other sites

A really simple solution would be to add all the Send statements to an array, and send each element in the array, and emediately after check if the stop button was pressed, should work flawless. ;)

Edit: Typos :)

Edited by FreeFry
Link to comment
Share on other sites

Indeed, that is pretty much what we did, but without an array. If we were to put it into an array as you suggest though, it would probably save us at least 20 lines of code. I will leave this for him to implement. I also added a semi idiot proof feature that will pause the line sends if the user activates another windows (as to not spam in the wrong place).

@nf67, You really should try to take FreeFry's suggestion and implement it into the code you already have. It should allow you shrink the script size a bit.

Edited by danwilli
Link to comment
Share on other sites

#include <GUIConstants.au3>
Dim $sTex
Dim $sMsg[12]
Dim $counter = 0



#Region ### START Koda GUI section ### Form=
$Golfjesmaker = GUICreate("Golfjesmaker", 242, 52, 193, 125)
$Text = GUICtrlCreateInput("Scroll naar bij zooi.co.nr naar onder voor uitleg", 0, 0, 241, 21)
$Golf = GUICtrlCreateButton("Golf", 176, 24, 65, 25, 0)
$Stop = GUICtrlCreateButton("Stop", 0, 24, 65, 25, 0)
$StopValue = 0
GUICtrlCreateEdit("Golfjesmaker 1-Typ je bericht 2-Druk op Spam 3-Zet je cursor binnen 5 sec. op de golfplek (msn invoervakje)      4-Na 5 sec. begint de golf van je text 5-Druk op Stop om te stoppen -zooi.co.nr-", 64, 32, 113, 17, BitOR($ES_AUTOVSCROLL,$ES_READONLY,$ES_WANTRETURN,$WS_VSCROLL))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Golf
            UpdateMsg()
            Sleep ( 5000 )
               While $StopValue <= 1
                    Send($sMsg[$counter])
                    If GUIGetMsg() = $Stop Then ExitLoop
                    $counter = $counter + 1
                    If $counter = 12 Then $counter = 0
        WEnd                   ;End of the loop from While
    EndSwitch
WEnd

Func UpdateMsg()
    $sText = GUICtrlRead($Text)
    $sMsg[0] = $sText & "{ENTER}"
    $sMsg[1] = "{SPACE}" & $sText & "{ENTER}"
    $sMsg[2] = "{SPACE}{SPACE}" & $sText & "{ENTER}"
    $sMsg[3] = "{SPACE}{SPACE}{SPACE}" & $sText & "{ENTER}"
    $sMsg[4] = "{SPACE}{SPACE}{SPACE}{SPACE}" & $sText & "{ENTER}"
    $sMsg[5] = "{SPACE}{SPACE}{SPACE}{SPACE}{SPACE}" & $sText & "{ENTER}"
    $sMsg[6] = "{SPACE}{SPACE}{SPACE}{SPACE}{SPACE}{SPACE}" & $sText & "{ENTER}"
    $sMsg[7] = "{SPACE}{SPACE}{SPACE}{SPACE}{SPACE}" & $sText & "{ENTER}"
    $sMsg[8] = "{SPACE}{SPACE}{SPACE}{SPACE}" & $sText & "{ENTER}"
    $sMsg[9] = "{SPACE}{SPACE}{SPACE}" & $sText & "{ENTER}"
    $sMsg[10] = "{SPACE}{SPACE}" & $sText & "{ENTER}"
    $sMsg[11] = "{SPACE}" & $sText & "{ENTER}"
EndFunc

It was fun to script that :)

You can use it as yours or script your own one with arrays, this uses an array ($sMsg)

Edit: Someone that know if there is a kind of

#declare SP {SPACE}

like in C, so that everytime I write SP in the code, it gets replaced by {SPACE}

???

Edited by LinuZ
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...