Jump to content
Sign in to follow this  
Ealric

Need Advice and Help with Macro Creator

Recommended Posts

Ealric

I'm working on a Macro Creator for World of Warcraft that will allow people to create "legal in-game" macros out of game using a more user friendly utility. So far, I'm just working on concept and design. Here's what I have thus far (compile and see it for yourself):

;===============================================================================
;
; Program Name:     WowMacroCreator()
; Description:      Creates a customized macro for the World of Warcraft game. 
; Version:          1.0.3                  
; Requirement(s):   None
; Return Value(s):  None
; Author(s):        Ealric 
;
;===============================================================================
;
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <EditConstants.au3>

Global $character = "- 255 (Characters Used)"                ; Display for characters used
Global $count = 0                                          ; beginning count of number of characters used
Global $status                                             ; not yet defined

$parent=GUICreate("WoW Macro Creator v.1.0", 800, 360)             ; 800 x 600 GUI Frame 
;GUISetBkColor(0x00F3FFFF)



; FILE MENU START 
; POSITION -1,0
$filemenu = GUICtrlCreateMenu ("File")
$fileitem = GUICtrlCreateMenuitem ("Open",$filemenu)
GUICtrlSetState(-1,$GUI_DEFBUTTON)
$closeitem = GUICtrlCreateMenuitem ("Close",$filemenu)
GUICtrlSetState(-1,$GUI_DISABLE)
$saveitem = GUICtrlCreateMenuitem ("Save",$filemenu)
GUICtrlSetState(-1,$GUI_DISABLE)
$saveasitem = GUICtrlCreateMenuitem ("Save As..",$filemenu)
GUICtrlSetState(-1,$GUI_DISABLE)
$separator1 = GUICtrlCreateMenuitem ("",$filemenu,4)    ; create a separator line
$recentfilesmenu = GUICtrlCreateMenu ("Recent Files",$filemenu)
$exititem = GUICtrlCreateMenuitem ("Exit",$filemenu)
; FILE MENU END 


; INSERT MENU START
; POSITION -1,1
$insertmenu = GUICtrlCreateMenu("Insert",-1,1)
$securecommandmenu = GUICtrlCreateMenu("Secure Commands",$insertmenu)
$securecommandmenuitem1 = GUICtrlCreateMenuItem("#show",$securecommandmenu)
;#show <name of ability/spell>
$securecommandmenuitem2 = GUICtrlCreateMenuItem("#showtooltip",$securecommandmenu)
;#showtooltip <name of ability/spell>
$securecommandmenuitem3 = GUICtrlCreateMenuItem("Assist",$securecommandmenu)
;/assist <options> <targettype>
$securecommandmenuitem4 = GUICtrlCreateMenuItem("Cancelaura",$securecommandmenu)
;/cancelaura <options> (name of buff to be cancelled)
$securecommandmenuitem5 = GUICtrlCreateMenuItem("Cancelform",$securecommandmenu)
;/cancelform <options>
$securecommandmenuitem6 = GUICtrlCreateMenuItem("Cast",$securecommandmenu)
;/cast [<first set of options>] <spell1>; [<second set of options>] <spell2> ; [<third set of options>] <spell3>
;/cast [<options 1 value true/false>] [<options 2 value true/false>] [<options 3 value true/false>]<spell1>;<spell2>
$securecommandmenuitem7 = GUICtrlCreateMenuItem("Castrandom",$securecommandmenu)
;castrandom <options> <spell1>,<spell2>,<spell3> (randomly cast between the spells)
$securecommandmenuitem8 = GUICtrlCreateMenuItem("Castsequence",$securecommandmenu)
;/castsequence [<options>] reset=<#>/target/combat/alt/shift/ctrl <spell1>, <spell2>, <spell3>
$securecommandmenuitem9 = GUICtrlCreateMenuItem("Changeactionbar",$securecommandmenu)
;/changeactionbar # (1 or 2 depending on which bar you want to use)
$securecommandmenuitem10 = GUICtrlCreateMenuItem("Clearfocus",$securecommandmenu)
;/clearfocus <options> <targettype>
$securecommandmenuitem11 = GUICtrlCreateMenuItem("Cleartarget",$securecommandmenu)
$securecommandmenuitem12 = GUICtrlCreateMenuItem("Click",$securecommandmenu)
;/click <options> <button?>
$securecommandmenuitem13 = GUICtrlCreateMenuItem("Dismount",$securecommandmenu)
;/dismount <options>
$securecommandmenuitem14 = GUICtrlCreateMenuItem("Equip",$securecommandmenu)
;/equip <options> 
$securecommandmenuitem15 = GUICtrlCreateMenuItem("Equipslot",$securecommandmenu)
;/equipslot <options> 
$securecommandmenuitem16 = GUICtrlCreateMenuItem("Focus",$securecommandmenu)
;/focus <options> <targettype>
$securecommandmenuitem17 = GUICtrlCreateMenuItem("Pet",$securecommandmenu)
;/pet
$securecommandmenuitem18 = GUICtrlCreateMenuItem("Petaggressive",$securecommandmenu)
;/petaggressive <options> 
$securecommandmenuitem19 = GUICtrlCreateMenuItem("Petattack",$securecommandmenu)
;/petattack <options>
$securecommandmenuitem20 = GUICtrlCreateMenuItem("Petautocastoff",$securecommandmenu)
;/petautocastoff <options>
$securecommandmenuitem21 = GUICtrlCreateMenuItem("Petautocaston",$securecommandmenu)
;/petautocaston <options>
$securecommandmenuitem22 = GUICtrlCreateMenuItem("Petdefensive",$securecommandmenu)
;/petdefensive <options>
$securecommandmenuitem23 = GUICtrlCreateMenuItem("Petfollow",$securecommandmenu)
;/petfollow <options>
$securecommandmenuitem24 = GUICtrlCreateMenuItem("Petpassive",$securecommandmenu)
;/petpassive <options>
$securecommandmenuitem25 = GUICtrlCreateMenuItem("Petstay",$securecommandmenu)
;/petstay <options>
$securecommandmenuitem26 = GUICtrlCreateMenuItem("Startattack",$securecommandmenu)
;/startattack <options>
$securecommandmenuitem27 = GUICtrlCreateMenuItem("Stopattack",$securecommandmenu)
;/stopattack <options>
$securecommandmenuitem28 = GUICtrlCreateMenuItem("Stopcasting", $securecommandmenu)
;/stopcasting <options>
$securecommandmenuitem29 = GUICtrlCreateMenuItem("Stopmacro",$securecommandmenu)
;/stopmacro <options> 
$securecommandmenuitem30 = GUICtrlCreateMenuItem("Swapactionbar",$securecommandmenu)
;/swapactionbar <options> 1 2 (swaps between two pages back and forth - cycling)
$securecommandmenuitem31 = GUICtrlCreateMenuItem("Target",$securecommandmenu)
;/target <options> [<targettype><target>]
$securecommandmenuitem32 = GUICtrlCreateMenuItem("Targetenemy",$securecommandmenu)
;/targetenemy <options> 
$securecommandmenuitem33 = GUICtrlCreateMenuItem("Targetfriend",$securecommandmenu)
;/targetfriend <options> 
$securecommandmenuitem34 = GUICtrlCreateMenuItem("Targetlasttarget",$securecommandmenu)
;/targetlasttarget <options>
$securecommandmenuitem35 = GUICtrlCreateMenuItem("Targetparty",$securecommandmenu)
;/targetparty 
$securecommandmenuitem36 = GUICtrlCreateMenuItem("Targetraid",$securecommandmenu)
;/targetraid
$securecommandmenuitem37 = GUICtrlCreateMenuItem("Use",$securecommandmenu)
;/use <options> <item or itemtype>
$securecommandmenuitem38 = GUICtrlCreateMenuItem("Userandom",$securecommandmenu)
;/userandom <options> item1,item2,item3
;##########-basic menu-##########
$basiccommandmenu = GUICtrlCreateMenu("Basic Commands",$insertmenu)
$basiccommandmenuitem1 = GUICtrlCreateMenuItem("Follow",$basiccommandmenu)
;/follow <unittype>
;##########-chat menu-##########
$chatcommandmenu = GUICtrlCreateMenu("Chat Commands",$insertmenu)
$chatcommandmenuitem1 = GUICtrlCreateMenuItem("Battleground",$chatcommandmenu)
;/bg <message>
$chatcommandmenuitem2 = GUICtrlCreateMenuItem("Emote",$chatcommandmenu)
;/e <message>
$chatcommandmenuitem3 = GUICtrlCreateMenuItem("Guild",$chatcommandmenu)
;/g <message>
$chatcommandmenuitem4 = GUICtrlCreateMenuItem("Officer",$chatcommandmenu)
;/o <message>
$chatcommandmenuitem5 = GUICtrlCreateMenuItem("Party",$chatcommandmenu)
;/p <message>
$chatcommandmenuitem6 = GUICtrlCreateMenuItem("Raid",$chatcommandmenu)
;/ra <message>
$chatcommandmenuitem7 = GUICtrlCreateMenuItem("Raid Warning",$chatcommandmenu)
;/rw <message>
$chatcommandmenuitem8 = GUICtrlCreateMenuItem("Ready Check",$chatcommandmenu)
;/readycheck
$chatcommandmenuitem9 = GUICtrlCreateMenuItem("Reply",$chatcommandmenu)
;/r <message>
$chatcommandmenuitem10 = GUICtrlCreateMenuItem("Say",$chatcommandmenu)
;/s <message>
$chatcommandmenuitem11 = GUICtrlCreateMenuItem("Voice",$chatcommandmenu)
;/v <voice macro> <name>
$chatcommandmenuitem12 = GUICtrlCreateMenuItem("Yell",$chatcommandmenu)
;/y <message>
; INSERT MENU END 


; VIEW MENU START
; POSITION -1,2
$viewmenu = GUICtrlCreateMenu("View",-1,2)  
$viewstatusitem = GUICtrlCreateMenuitem ("Statusbar",$viewmenu)
GUICtrlSetState(-1,$GUI_CHECKED)
; VIEW MENU END 


; HELP MENU START
; POSITION -1,3
$helpmenu = GUICtrlCreateMenu ("Help",-1,3)
$aboutitem = GUICtrlCreateMenuitem ("About",$helpmenu)
$optionsitem = GUICtrlCreateMenuItem("Options",$helpmenu)
$targetsitem = GUICtrlCreateMenuItem("Targets",$helpmenu)
; HELP MENU END 

$MACRO = GUICtrlCreateEdit("", 10, 10, 780, 300, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_MULTILINE + $ES_WANTRETURN)
GUICtrlSetTip(-1, "Your Macro")

$BTNCHECK = GUICtrlCreateButton("&Check Macro", 10, 315, 100, 20)
GUICtrlSetTip(-1, "Check the syntax of your macro.")
$BTNEXIT = GUICtrlCreateButton("&Exit", 120, 315, 100, 20)
GUICtrlSetTip(-1, "Quit the program.")

$statuslabel = GUICtrlCreateLabel ($count & $character,330,315,150,16,BitOr($SS_SIMPLE,$SS_SUNKEN))

GUISetState ()
While 1
    $msg = GUIGetMsg()
    
    If $msg = $fileitem Then
        $file = FileOpenDialog("Choose file...",@TempDir,"All (;.;)")
        If @error <> 1 Then GUICtrlCreateMenuitem ($file,$recentfilesmenu)
    EndIf 
    If $msg = $securecommandmenuitem2 Then
        GUICtrlSetData ($MACRO,"#showtooltip ")
    EndIf   
    If $msg = $viewstatusitem Then
        If BitAnd(GUICtrlRead($viewstatusitem),$GUI_CHECKED) = $GUI_CHECKED Then
            GUICtrlSetState($viewstatusitem,$GUI_UNCHECKED)
            GUICtrlSetState($statuslabel,$GUI_HIDE)
        Else
            GUICtrlSetState($viewstatusitem,$GUI_CHECKED)
            GUICtrlSetState($statuslabel,$GUI_SHOW)
        EndIf
    EndIf
    If $msg = $GUI_EVENT_CLOSE Or $msg = $BTNEXIT Then ExitLoop
    If $msg = $aboutitem Then Msgbox(0,"About","WoW Macro Creator Version 1.0.3")
WEnd
GUIDelete()

Exit

It's rather simplistic in nature and that's how I want it to be. The core functions are going to work with the "insert" features where the commands will initiate further responses via checkbox/input/etc. However, I need some advice and some help.

After compiling and running, take a look at Insert > #showtooltip. It will place the #showtooltip in the edit box. What I would like to do is set the state for #showtooltip but in addition, create a floating input box that allows someone to type the name of the tooltip and then that is appended to the #showtooltip. As an example:

User clicks insert > #showtooltip.

A floating input box appears asking for them to type in a name for the tooltip.

After inputting and pressing OK on the floating box, the name is appended to #showtooltip and a carriage return occurs.

The edit box on the parent window now shows #showtooltip (whatever was inputted).

However, I'm an "older" autoit user and have recently come back and just need some help with the new graphical controls.

The features I want to include are: character counting (max 255 chars allowed), macro checking (checking the macro to make sure it's properly formatted).

Thanks in advance.


My Projects: [topic="89413"]GoogleHack Search[/topic], [topic="67095"]Swiss File Knife GUI[/topic], [topic="69072"]Mouse Location Pointer[/topic], [topic="86040"]Standard Deviation Calculator[/topic]

Share this post


Link to post
Share on other sites
Ealric

I learn fast. :)

I figured it out on my own. I wrote a function that created a new gui and set the guistate for the parent edit box and closed after it was finished. However, if anyone sees something I'm doing wrong in the above script or can still offer advice, I'd like to have it.

Thanks,


My Projects: [topic="89413"]GoogleHack Search[/topic], [topic="67095"]Swiss File Knife GUI[/topic], [topic="69072"]Mouse Location Pointer[/topic], [topic="86040"]Standard Deviation Calculator[/topic]

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.