Jump to content

Repeating Text Macro


Skizot
 Share

Recommended Posts

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
Link to comment
Share on other sites

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

Link to comment
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

Link to comment
Share on other sites

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
Link to comment
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

Link to comment
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 :)

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...