Sign in to follow this  
Followers 0
Skizot

Repeating Text Macro

11 posts in this topic

#1 ·  Posted (edited)

Global $Paused
#include <GUIConstants.au3>

GUICreate("Custom Game Text Repeater.", 245, 140)

$Label = GUICtrlCreateLabel("Message", 10, 10)
$YesID  = GUICtrlCreateButton("Start/Stop", 90, 110, 75, 20)
$SpamMsg = GuiCtrlCreateInput("Message", 10, 25, 225, 20)
$LabelStatus = GuiCtrlCreateLabel("", 50, 55, 131, 21)

GUISetState(); display the GUI

Do
    $msg = GUIGetMsg()
    Select
    Case $msg= $YesID
        TogglePause()
    EndSelect
Until $msg = $GUI_EVENT_CLOSE

Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        Sleep(10000)
        Send("{ENTER}")
        Sleep(10)
        Send((GUICtrlRead($SpamMsg)))
        Sleep(10)
        Send("{ENTER}")
    WEnd
EndFunc

This STARTS.... but never stops.... EVER.... heh

when i click the button to stop it just keeps going.

any ideas on how to make it stop? even if it's a stop button that ends the loop?

Edited by Skizot

Share this post


Link to post
Share on other sites



Shouldn't it stop if you click the red x?

Share this post


Link to post
Share on other sites

it does nothing. just keeps running.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

This one work use ESC to exit

CODE
Global $Paused

#include <GUIConstants.au3>

#include <Misc.au3>

GUICreate("Custom Game Text Repeater.", 245, 140)

$Label = GUICtrlCreateLabel("Message", 10, 10)

$YesID = GUICtrlCreateButton("Start/Stop", 90, 110, 75, 20)

$SpamMsg = GuiCtrlCreateInput("Message", 10, 25, 225, 20)

$LabelStatus = GuiCtrlCreateLabel("", 50, 55, 131, 21)

$dll = DllOpen("user32.dll")

GUISetState(); display the GUI

Func TogglePause()

$read = GUICtrlRead($SpamMsg)

While 1

if _IsPressed("1B",$dll) then ExitLoop

Sleep(100)

Send("{ENTER}")

Sleep(10)

;Send($read)

MsgBox(0,"",$read)

Sleep(10)

Send("{ENTER}")

WEnd

EndFunc

while 1

$msg = GUIGetMsg()

Select

case $msg = $GUI_EVENT_CLOSE

Exit

Case $msg= $YesID

$t = 1

call("TogglePause")

EndSelect

WEnd

Editted sorry placement was off

Edited by flip209

" I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln

Share this post


Link to post
Share on other sites

is there no way to make it stop via the button?

Share this post


Link to post
Share on other sites

Try this one

CODE
Global $Paused

#include <GUIConstants.au3>

#include <Misc.au3>

GUICreate("Custom Game Text Repeater.", 245, 140)

$Label = GUICtrlCreateLabel("Message", 10, 10)

$YesID = GUICtrlCreateButton("Start/Stop", 90, 110, 75, 20)

$SpamMsg = GuiCtrlCreateInput("Message", 10, 25, 225, 20)

$LabelStatus = GuiCtrlCreateLabel("", 50, 55, 131, 21)

$dll = DllOpen("user32.dll")

GUISetState(); display the GUI

Func TogglePause()

$read = GUICtrlRead($SpamMsg)

While 1

if _IsPressed("1B",$dll) then ExitLoop

Sleep(100)

Send("{ENTER}")

Sleep(10)

;Send($read)

MsgBox(0,"",$read)

Sleep(10)

Send("{ENTER}")

WEnd

EndFunc

while 1

$msg = GUIGetMsg()

Select

case $msg = $GUI_EVENT_CLOSE

Exit

Case $msg= $YesID

$t = 1

call("TogglePause")

EndSelect

WEnd


" I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

still nothing.... your message box might be slowing it down. try the send with the cursor in the message box. see if you can make it stop. also this timer should be random between 30-45 seconds.

also i made it change the label if it works. All it says is running......

Global $Paused
#include <GUIConstants.au3>
#include <Misc.au3>

GUICreate("Custom Game Text Repeater.", 245, 140)

$Label = GUICtrlCreateLabel("Message", 10, 10)
$YesID = GUICtrlCreateButton("Start/Stop", 90, 110, 75, 20)
$SpamMsg = GuiCtrlCreateInput("Message", 10, 25, 225, 20)
$LabelStatus = GuiCtrlCreateLabel("", 50, 55, 131, 21)
$dll = DllOpen("user32.dll")

GUISetState(); display the GUI


Func TogglePause()
$read = GUICtrlRead($SpamMsg)

While 1
GuiCtrlSetData($LabelStatus, "")
if _IsPressed("1B",$dll) then ExitLoop
GuiCtrlSetData($LabelStatus, "running....")
Sleep(10000)
Send("{ENTER}")
Sleep(10)
Send($read)
;MsgBox(0,"",$read)
Sleep(10)
Send("{ENTER}")
GuiCtrlSetData($LabelStatus, "End Loop...")
WEnd
EndFunc



while 1
$msg = GUIGetMsg()
Select
case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg= $YesID
$t = 1
call("TogglePause")
EndSelect
WEnd
Edited by Skizot

Share this post


Link to post
Share on other sites

It works now you have to hold down f12 (changed the button so program would not exit) because you have a sleep of 1000 it has to finisht that until it is done. And you had the label in the wrong place.

CODE
Global $Paused

#include <GUIConstants.au3>

#include <Misc.au3>

GUICreate("Custom Game Text Repeater.", 245, 140)

$Label = GUICtrlCreateLabel("Message", 10, 10)

$YesID = GUICtrlCreateButton("Start/Stop", 90, 110, 75, 20)

$SpamMsg = GuiCtrlCreateInput("Message", 10, 25, 225, 20)

$LabelStatus = GuiCtrlCreateLabel("", 50, 55, 131, 21)

$dll = DllOpen("user32.dll")

GUISetState(); display the GUI

Func TogglePause()

$read = GUICtrlRead($SpamMsg)

While 1

GuiCtrlSetData($LabelStatus, "")

if _IsPressed("7B",$dll) then

GuiCtrlSetData($LabelStatus, "End Loop...")

ExitLoop

EndIf

GuiCtrlSetData($LabelStatus, "running....")

Sleep(10000)

Send("{ENTER}")

Sleep(10)

Send($read)

;MsgBox(0,"",$read)

Sleep(10)

Send("{ENTER}")

GuiCtrlSetData($LabelStatus, "End Loop...")

WEnd

EndFunc

while 1

$msg = GUIGetMsg()

Select

case $msg = $GUI_EVENT_CLOSE

Exit

Case $msg= $YesID

$t = 1

call("TogglePause")

EndSelect

WEnd


" I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln

Share this post


Link to post
Share on other sites

try on event mode. Or putting a sleep in the while loop. If you are doing a lot in the while loop guis can become sluggish.

Share this post


Link to post
Share on other sites

that's actually pretty good. though the having to wait kinda sucks. i'm cool with it as it is... but if you can come up with a way to make it stop the second the start/stop button is pressed that would be awesome.

thanks for your help so far :)

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Ignore this post figured it out.

Edited by Skizot

Share this post


Link to post
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
Sign in to follow this  
Followers 0