Jump to content
Sign in to follow this  
BobiusMaximus

Macro Program

Recommended Posts

Well, I'm a diablo 2 player, and sometimes in the chat channel I'm trying to trade, and I want to have a few phrases to say over and over again, and eventually I came up with this ;)

Imrpoved Version, now has a checkbox so you can use the same program for both tasks that the old ones did:

#include <GUIConstants.au3>

HotKeySet("{F9}","F9")
HotKeySet("{F10}","F10")
HotKeySet("{F11}","F11")
HotKeySet("{F12}","F12")

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=c:\bob\autoit\my autoit stuff\macro\macroform.kxf
$Form1_1 = GUICreate("Bobs Macro Program", 269, 167, 306, 184)
$F9 = GUICtrlCreateInput("F9", 32, 25, 209, 21)
$F10 = GUICtrlCreateInput("F10", 32, 50, 209, 21)
$F11 = GUICtrlCreateInput("F11", 32, 75, 209, 21)
$F12 = GUICtrlCreateInput("F12", 32, 100, 209, 21)
$Label1 = GUICtrlCreateLabel("F9", 10, 28, 16, 17)
$Label2 = GUICtrlCreateLabel("F10", 5, 53, 22, 17)
$Label3 = GUICtrlCreateLabel("F11", 7, 77, 22, 17)
$Label4 = GUICtrlCreateLabel("F12", 6, 104, 22, 17)
$Label5 = GUICtrlCreateLabel("This Program By BobiusMaximus", 24, 0, 157, 17)
$Checkbox1 = GUICtrlCreateCheckbox("Enter Before And after?", 24, 128, 137, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Func F9()
     If $Checkbox1=true Then
         Send("{Enter}")
         EndIf
     Send(GuiCtrlRead($F9))
      If $Checkbox1=true Then
         Send("{Enter}")
         EndIf
EndFunc

Func F10()
     If $Checkbox1=true Then
         Send("{Enter}")
         EndIf
     Send(GuiCtrlRead($F10))
     If $Checkbox1=true Then
         Send("{Enter}")
         EndIf
EndFunc

Func F11()
     If $Checkbox1=true Then
         Send("{Enter}")
         EndIf
     Send(GuiCtrlRead($F11))
     If $Checkbox1=true Then
         Send("{Enter}")
         EndIf
EndFunc

Func F12()
     If $Checkbox1=true Then
         Send("{Enter}")
         EndIf
     Send(GuiCtrlRead($F12))
     If $Checkbox1=true Then
         Send("{Enter}")
         EndIf
EndFunc

-Bob

Edited by BobTheLeetHaxx0r

Photoshop User and Noob AutoIt user.

Share this post


Link to post
Share on other sites

Made this a while ago.

#include <Misc.au3>
#include <GUIConstants.au3>
#NoTrayIcon
DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
$KeyMod = ""
$GSform1 = GUICreate("GSpam v1.5", 284, 287, 432, 207)
GUISetBkColor(0x000000)
$Input1 = GUICtrlCreateInput("", 24, 16, 249, 21)
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBkColor(-1, 0x000000)
$Input2 = GUICtrlCreateInput("", 24, 40, 249, 21)
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBkColor(-1, 0x000000)
$Input3 = GUICtrlCreateInput("", 24, 64, 249, 21)
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBkColor(-1, 0x000000)
$Input4 = GUICtrlCreateInput("", 24, 88, 249, 21)
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBkColor(-1, 0x000000)
$Input5 = GUICtrlCreateInput("", 24, 112, 249, 21)
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBkColor(-1, 0x000000)
$Input6 = GUICtrlCreateInput("", 24, 136, 249, 21)
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBkColor(-1, 0x000000)
$Input7 = GUICtrlCreateInput("", 24, 160, 249, 21)
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBkColor(-1, 0x000000)
$Input8 = GUICtrlCreateInput("", 24, 184, 249, 21)
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBkColor(-1, 0x000000)
$Input9 = GUICtrlCreateInput("", 24, 208, 249, 21)
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("1", 8, 16, 10, 17)
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("2", 8, 40, 10, 17)
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("3", 8, 64, 10, 17)
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("4", 8, 88, 10, 17)
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("5", 8, 112, 10, 17)
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("6", 8, 136, 10, 17)
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("7", 8, 160, 10, 17)
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("8", 8, 184, 10, 17)
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("9", 8, 208, 10, 17)
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0x000000)
$Rad_Ctrl = GUICtrlCreateRadio("CTRL", 176, 256, 49, 17)
GUICtrlSetColor(-1, 0x008000)
GUICtrlSetBkColor(-1, 0x000000)
$Rad_Alt= GUICtrlCreateRadio("ALT", 232, 256, 49, 17)
GUICtrlSetColor(-1, 0x008000)
GUICtrlSetBkColor(-1, 0x000000)
$Input0 = GUICtrlCreateInput("", 24, 232, 249, 21)
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("0", 8, 232, 10, 17)
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0x000000)
$In_Delay = GUICtrlCreateInput("40", 24, 256, 57, 21)
GUICtrlSetColor(-1, 0x008080)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("gamepin126", 88, 256, 88, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x000000)
GUISetState(@SW_SHOW)
 
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case _IsPressed($KeyMod)
            If _IsPressed("31") Then
                $ms = GUICtrlRead($In_Delay)
                $Msg1 = GUICtrlRead($Input1)
                Send("{ENTER}")
                Sleep($ms)
                Send($Msg1, 1)
                Send("{ENTER}")
            ElseIf _IsPressed("32") Then
                $ms = GUICtrlRead($In_Delay)
                $Msg2 = GUICtrlRead($Input2)
                Send("{ENTER}")
                Sleep($ms)
                Send($Msg2, 1)
                Send("{ENTER}")
            ElseIf _IsPressed("33") Then
                $ms = GUICtrlRead($In_Delay)
                $Msg3 = GUICtrlRead($Input3)
                Send("{ENTER}")
                Sleep($ms)
                Send($Msg3, 1)
                Send("{ENTER}")
            ElseIf _IsPressed("34") Then
                $ms = GUICtrlRead($In_Delay)
                $Msg4 = GUICtrlRead($Input4)
                Send("{ENTER}")
                Sleep($ms)
                Send($Msg4, 1)
                Send("{ENTER}")
            ElseIf _IsPressed("35") Then
                $ms = GUICtrlRead($In_Delay)
                $Msg5 = GUICtrlRead($Input5)
                Send("{ENTER}")
                Sleep($ms)
                Send($Msg5, 1)
                Send("{ENTER}")
            ElseIf _IsPressed("36") Then
                $ms = GUICtrlRead($In_Delay)
                $Msg6 = GUICtrlRead($Input6)
                Send("{ENTER}")
                Sleep($ms)
                Send($Msg6, 1)
                Send("{ENTER}")
            ElseIf _IsPressed("37") Then
                $ms = GUICtrlRead($In_Delay)
                $Msg7 = GUICtrlRead($Input7)
                Send("{ENTER}")
                Sleep($ms)
                Send($Msg7, 1)
                Send("{ENTER}")
            ElseIf _IsPressed("38") Then
                $ms = GUICtrlRead($In_Delay)
                $Msg8 = GUICtrlRead($Input8)
                Send("{ENTER}")
                Sleep($ms)
                Send($Msg8, 1)
                Send("{ENTER}")
            ElseIf _IsPressed("39") Then
                $ms = GUICtrlRead($In_Delay)
                $Msg9 = GUICtrlRead($Input9)
                Send("{ENTER}")
                Sleep($ms)
                Send($Msg9, 1)
                Send("{ENTER}")
            ElseIf _IsPressed("30") Then
                $ms = GUICtrlRead($In_Delay)
                $Msg0 = GUICtrlRead($Input0)
                Send("{ENTER}")
                Sleep($ms)
                Send($Msg0, 1)
                Send("{ENTER}")
            EndIf
    Sleep(100)
    Case $msg = $Rad_Ctrl And BitAND(GUICtrlRead($Rad_Ctrl), $GUI_CHECKED) = $GUI_CHECKED
        $KeyMod = 11
    Case $msg = $Rad_Alt And BitAND(GUICtrlRead($Rad_Alt), $GUI_CHECKED) = $GUI_CHECKED
        $KeyMod = 12
    Case Else
        ;;;;;;;
EndSelect
WEnd
Exit

Share this post


Link to post
Share on other sites

Good idea, updated :P

-Bob

You have wrong code:

Func F9()
     If $Checkbox1=true Then
         Send("{Enter}")
         EndIf
     Send(GuiCtrlRead($F9))
      If $Checkbox1=true Then
         Send("{Enter}")
         EndIf
EndFunc

You must accordingly correct also other functions ...

Share this post


Link to post
Share on other sites

You have wrong code:

Func F9()
     If $Checkbox1=true Then
         Send("{Enter}")
         EndIf
     Send(GuiCtrlRead($F9))
      If $Checkbox1=true Then
         Send("{Enter}")
         EndIf
EndFunc

You must accordingly correct also other functions ...

Does it actually matter which way it is done? I don't see any advantage to that way.

-Bob


Photoshop User and Noob AutoIt user.

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  

×
×
  • Create New...