Ealric Posted January 12, 2008 Share Posted January 12, 2008 Basically, Here's my beginning script. You can compile it and then test it using "Insert > Assist" and playing with some of the enabled features. #showtooltip and Assist are the only enabled features right now. The rest are placeholders. Test using assist. Again, some of the features within assist are not working but you can play with it to get the idea. The issue I'm having is this: On one machine, all messages are properly appended to the end of the line within the control. So, they continually build upon one another (which is the expected behavior). On the other machine, all of the boxes show a highlighted response meaning that for some reason my mouse cursor has highlighted all of the text by default. Therefore, when the messages are written to the control, instead of "appending" them, they are deleted and replaced. I'm not sure what is causing this but would like some assistance. Here's my script: expandcollapse popup;=============================================================================== ; ; Program Name: WowMacroCreator() ; Description: Creates a customized macro for the World of Warcraft game. ; Version: 1.1.7 ; 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 $checkbox,$invert,$status,$settarget Global $version = "ver 1.1.7" $parent=GUICreate("WoW Macro Creator " & $version, 800, 360) ; 800 x 360 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)) ; #################################################################################################################### ; ############################################## RUN OUR MAIN GUI #################################################### ; #################################################################################################################### GUISetState () While 1 $msg = GUIGetMsg() GUICtrlSetData($statuslabel, StringLen(GUICtrlRead($MACRO)) & $character) If $msg = $fileitem Then $file = FileOpenDialog("Choose file...",@TempDir,"All (;.;)") If @error <> 1 Then GUICtrlCreateMenuitem ($file,$recentfilesmenu) EndIf If $msg = $securecommandmenuitem2 Then $prompta = "Enter the SPELL or ABILITY name here and click OK." $promptn = "Note: This is case sensitive." $promptb = "Example: Frost Bolt" _macrowrite($MACRO,$prompta & @CRLF & $promptn & @CRLF & @CRLF & $promptb & @CRLF,"#showtooltip",$parent,1,0) EndIf If $msg = $securecommandmenuitem3 Then _promptconditions($MACRO,"/assist",$parent,0,0) ; add parameter here _write(@CRLF) 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) WEnd GUIDelete() Exit ; #################################################################################################################### ; ############################################## END OF MAIN GUI ##################################################### ; #################################################################################################################### ; ################################################ START FUNCTIONS ################################################### ; || _macrowrite() function ; || _macrowrite is a function that creates a small gui window that inputs parameters into the macro ; || which is then appended to the parent screen Func _macrowrite($control,$label,$command,$window,$append,$options) $gctemp = GUICreate(" Command = " & $command,300,135,-1,-1,-1,$WS_EX_TOOLWINDOW,$window) $ltemp = GUICtrlCreateLabel ($label,10,10,270,60) $getemp = GUICtrlCreateEdit("", 10, 80, 280, 20, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_MULTILINE + $ES_WANTRETURN) GUISetState (@SW_SHOW,$gctemp) $OKc = GUICtrlCreateButton("&OK", 10, 110, 100, 20) GUICtrlSetTip(-1, "Adds the command to the macro window.") if $append=1 Then $creturn = @CRLF Else $creturn = " " EndIf While 1 $msg = GUIGetMsg() If $msg = $OKc Then $tempread = GUICtrlRead($getemp) $final = $command & " " & $tempread & $creturn GUICtrlSetData($control,$final,$final) GUIDelete($gctemp) ExitLoop EndIf WEnd EndFunc ; || _promptconditions() function ; || _promptconditions is a function that determines how many option groups will be placed in the command line of the macro ; || It does not determine the "type" of options that will be used Func _promptconditions($control,$command,$window,$append,$options) $status=0 $pctemp = guicreate(" Number of Conditions | Normally set this to 1 or 0",400,170,-1,-1,-1,$WS_EX_TOOLWINDOW,$window) $text1 = "Enter the number of conditions you wish to check true or false against" $text2 = "for the next macro parameter." $text3 = "Example: If you set this to 2 then you will have two sets of option groups " $text4 = "to check conditions against. If you don't want any options, set to 0." $text5 = "/command [conditon1:options] [condition2:options] Parameter" $pcltemp = GUICtrlCreateLabel($text1 & @CRLF & $text2 & @CRLF & @CRLF & $text3 & @CRLF & $text4 & @CRLF & @CRLF & $text5,10,10,370,100) $pdtemp = GUICtrlCreateInput(0,10,120,30,20) GUISetState(@SW_SHOW,$pctemp) $OKc = GUICtrlCreateButton("&OK", 10, 150, 100, 20) GUICtrlSetTip(-1, "Adds the command to the macro window.") if $append=1 Then $creturn = @CRLF Else $creturn = " " EndIf While 1 $msg = GUIGetMsg() If $msg = $OKc Then $tempread = GUICtrlRead($pdtemp) $status = $tempread $final = $command & $creturn GUICtrlSetData($control,$final,$final) GUIDelete($pctemp) if $status > 0 Then _promptoptions($control,$command,$window,$append,$options) Else Return EndIf ExitLoop EndIf WEnd EndFunc ; || _promptoptions() function ; || _promptoptions is a function that creates an option set panel from which you can select the various options to use with each macro ; || The number of option panels remaining refers to the number of conditions set in _promptconditions() Func _promptoptions($control,$command,$window,$append,$options) For $i = $status to 1 Step -1 $checkbox=0 $invert = "" $settarget = "" $setactionbar = "" $potemp = guicreate(" Choosing Option Sets (" & $i & ") panels remaining.",500,520,-1,-1,-1,$WS_EX_TOOLWINDOW,$window) GUICtrlCreateLabel ("Place a checkmark next to the options you wish to use in this option set. If you " & _ "select NO then you are stating you want to invert the option (i.e. dead = nodead, " & _ "combat = nocombat).", 20,5,480,40) ;Adding NO for macros wanting invert true/False (ex. nodead, noexists) ;Applies to lefthand side of checkboxes $checkopt2 = GUICtrlCreateCheckbox ("NO", 20, 40, 40, 20) $checkopt3 = GUICtrlCreateCheckbox ("NO", 20, 60, 40, 20) $checkopt4 = GUICtrlCreateCheckbox ("NO", 20, 80, 40, 20) $checkopt5 = GUICtrlCreateCheckbox ("NO", 20, 100, 40, 20) $checkopt6 = GUICtrlCreateCheckbox ("NO", 20, 120, 40, 20) $checkopt7 = GUICtrlCreateCheckbox ("NO", 20, 140, 40, 20) $checkopt8 = GUICtrlCreateCheckbox ("NO", 20, 160, 40, 20) $checkopt9 = GUICtrlCreateCheckbox ("NO", 20, 180, 40, 20) $checkopt11 = GUICtrlCreateCheckbox ("NO", 20, 200, 40, 20) $checkopt12 = GUICtrlCreateCheckbox ("NO", 20, 220, 40, 20) $checkopt13 = GUICtrlCreateCheckbox ("NO", 20, 240, 40, 20) $checkopt14 = GUICtrlCreateCheckbox ("NO", 20, 260, 40, 20) $checkopt15 = GUICtrlCreateCheckbox ("actionbar", 60, 40, 80, 20) $checkopt16 = GUICtrlCreateCheckbox ("button:#", 60, 60, 80, 20) $checkopt17 = GUICtrlCreateCheckbox ("channelling", 60, 80, 80, 20) $checkopt18 = GUICtrlCreateCheckbox ("combat", 60, 100, 80, 20) $checkopt19 = GUICtrlCreateCheckbox ("dead", 60, 120, 80, 20) $checkopt20 = GUICtrlCreateCheckbox ("equipped", 60, 140, 80, 20) $checkopt21 = GUICtrlCreateCheckbox ("exists", 60, 160, 80, 20) $checkopt22 = GUICtrlCreateCheckbox ("flying", 60, 180, 80, 20) $checkopt24 = GUICtrlCreateCheckbox ("group:type", 60, 200, 80, 20) $checkopt25 = GUICtrlCreateCheckbox ("harm", 60, 220, 80, 20) $checkopt26 = GUICtrlCreateCheckbox ("help", 60, 240, 80, 20) $checkopt27 = GUICtrlCreateCheckbox ("indoors", 60, 260, 80, 20) $checkopt30 = GUICtrlCreateCheckbox ("NO", 20, 280, 40, 20) $checkopt31 = GUICtrlCreateCheckbox ("NO", 20, 300, 40, 20) $checkopt32 = GUICtrlCreateCheckbox ("NO", 20, 320, 40, 20) $checkopt33 = GUICtrlCreateCheckbox ("NO", 20, 340, 40, 20) $checkopt35 = GUICtrlCreateCheckbox ("NO", 20, 360, 40, 20) $checkopt36 = GUICtrlCreateCheckbox ("NO", 20, 380, 40, 20) $checkopt38 = GUICtrlCreateCheckbox ("NO", 20, 400, 40, 20) $checkopt39 = GUICtrlCreateCheckbox ("NO", 20, 420, 40, 20) $checkopt40 = GUICtrlCreateCheckbox ("NO", 20, 440, 40, 20) $checkopt41 = GUICtrlCreateCheckbox ("NO", 20, 460, 40, 20) $checkopt43 = GUICtrlCreateCheckbox ("modifier:key", 60, 280, 80, 20) $checkopt44 = GUICtrlCreateCheckbox ("mounted", 60, 300, 80, 20) $checkopt45 = GUICtrlCreateCheckbox ("outdoors", 60, 320, 80, 20) $checkopt46 = GUICtrlCreateCheckbox ("party", 60, 340, 80, 20) $checkopt48 = GUICtrlCreateCheckbox ("pet:name|type", 60, 360, 90, 20) $checkopt49 = GUICtrlCreateCheckbox ("raid", 60, 380, 80, 20) $checkopt51 = GUICtrlCreateCheckbox ("stance:#", 60, 400, 80, 20) $checkopt52 = GUICtrlCreateCheckbox ("stealth", 60, 420, 80, 20) $checkopt53 = GUICtrlCreateCheckbox ("swimming", 60, 440, 80, 20) $checkopt54 = GUICtrlCreateCheckbox ("target", 60, 460, 80, 20) GUISetState(@SW_SHOW,$potemp) $OKc = GUICtrlCreateButton("&OK", 20, 490, 100, 20) While 1 $msg = GUIGetMsg() if $msg = $checkopt2 Then _checkbox($checkopt2,$checkopt15) EndIf if $msg = $checkopt3 Then _checkbox($checkopt3,$checkopt16) EndIf if $msg = $checkopt4 Then _checkbox($checkopt4,$checkopt17) EndIf if $msg = $checkopt5 Then _checkbox($checkopt5,$checkopt18) EndIf if $msg = $checkopt6 Then _checkbox($checkopt6,$checkopt19) EndIf if $msg = $checkopt7 Then _checkbox($checkopt7,$checkopt20) EndIf if $msg = $checkopt8 Then _checkbox($checkopt8,$checkopt21) EndIf if $msg = $checkopt9 Then _checkbox($checkopt9,$checkopt22) EndIf if $msg = $checkopt11 Then _checkbox($checkopt11,$checkopt24) EndIf if $msg = $checkopt12 Then _checkbox($checkopt12,$checkopt25) EndIf if $msg = $checkopt13 Then _checkbox($checkopt13,$checkopt26) EndIf if $msg = $checkopt14 Then _checkbox($checkopt14,$checkopt27) EndIf ;special notify msgs ############################### if $msg = $checkopt19 Then _notify($checkopt19,$checkopt54) EndIf if $msg = $checkopt21 Then _notify($checkopt21,$checkopt54) EndIf if $msg = $checkopt25 Then _notify($checkopt25,$checkopt54) EndIf if $msg = $checkopt26 Then _notify($checkopt26,$checkopt54) EndIf if $msg = $checkopt46 Then _notify($checkopt46,$checkopt54) EndIf if $msg = $checkopt49 Then _notify($checkopt49,$checkopt54) EndIf ;special notify msgs end ########################### if $msg = $checkopt30 Then _checkbox($checkopt30,$checkopt43) EndIf if $msg = $checkopt31 Then _checkbox($checkopt31,$checkopt44) EndIf if $msg = $checkopt32 Then _checkbox($checkopt32,$checkopt45) EndIf if $msg = $checkopt33 Then _checkbox($checkopt33,$checkopt46) EndIf if $msg = $checkopt35 Then _checkbox($checkopt35,$checkopt48) EndIf if $msg = $checkopt36 Then _checkbox($checkopt36,$checkopt49) EndIf if $msg = $checkopt38 Then _checkbox($checkopt38,$checkopt51) EndIf if $msg = $checkopt39 Then _checkbox($checkopt39,$checkopt52) EndIf if $msg = $checkopt40 Then _checkbox($checkopt40,$checkopt53) EndIf if $msg = $checkopt41 Then _checkbox($checkopt41,$checkopt54) EndIf if $msg = $checkopt54 Then _notifytarget($checkopt54,$checkopt19,$checkopt21,$checkopt25,$checkopt26,$checkopt46,$checkopt49) EndIf If $msg = $OKc Then $obrack = "[" ;open brackets $cbrack = "] " ;close brackets $sepval = "" ;separate values $val2 = GUICtrlRead($checkopt15) ;actionbar $val3 = GUICtrlRead($checkopt16) ;button $val4 = GUICtrlRead($checkopt17) ;channelling $val5 = GUICtrlRead($checkopt18) ;combat $val6 = GUICtrlRead($checkopt19) ;dead $val7 = GUICtrlRead($checkopt20) ;equipped $val8 = GUICtrlRead($checkopt21) ;exists $val9 = GUICtrlRead($checkopt22) ;flying $val11 = GUICtrlRead($checkopt24) ;group:type $val12 = GUICtrlRead($checkopt25) ;harm $val13 = GUICtrlRead($checkopt26) ;help $val14 = GUICtrlRead($checkopt27) ;indoors $val30 = GUICtrlRead($checkopt43) ;modifier:key $val31 = GUICtrlRead($checkopt44) ;mounted $val32 = GUICtrlRead($checkopt45) ;outdoors $val33 = GUICtrlRead($checkopt46) ;party $val35 = GUICtrlRead($checkopt48) ;pet:name|type $val36 = GUICtrlRead($checkopt49) ;raid $val38 = GUICtrlRead($checkopt51) ;stance:n $val39 = GUICtrlRead($checkopt52) ;stealth $val40 = GUICtrlRead($checkopt53) ;swimming $val41 = GUICtrlRead($checkopt54) ;target _write($obrack) ; Write an [ open bracket with no spacing if $val41 = 1 Then ; Target option is being applied _invert($checkopt41) ; check to see if this is being inverted _target() ; apply a target to the option _errorinvert() ; Check to make sure this particular option is not inverted as it cannot be $final = "target=" & $settarget ; Format the final option set _write($final) ; Write the final option set EndIf ; Placeholder for $val2 ; Placeholder for $val3 ; Placeholder for $val4 if $val5 = 1 Then _separator() _invert($checkopt5) $final = $invert & "combat" _write($final) EndIf if $val6 = 1 Then _separator() _invert($checkopt6) $final = $invert & "dead" _write($final) EndIf ; Placholder for $val7 if $val8 = 1 Then _separator() _invert($checkopt8) $final = $invert & "exists" _write($final) EndIf if $val9 = 1 Then _separator() _invert($checkopt9) $final = $invert & "flying" _write($final) EndIf if $val12 = 1 Then ; Harm option is being applied _separator() ; apply a separator or ignore a separator depending on the position of the option _invert($checkopt12) $final = $invert & "harm" _write($final) EndIf if $val13 = 1 Then _separator() _invert($checkopt13) $final = $invert & "help" _write($final) EndIf if $val14 = 1 Then _separator() _invert($checkopt14) $final = $invert & "indoors" _write($final) EndIf ; Placeholder for $val30 if $val31 = 1 Then _separator() _invert($checkopt31) $final = $invert & "mounted" _write($final) EndIf if $val32 = 1 Then _separator() _invert($checkopt32) $final = $invert & "outdoors" _write($final) EndIf if $val33 = 1 Then _separator() _invert($checkopt33) $final = $invert & "party" _write($final) EndIf ; Placeholder for $val34 ; Placeholder for $val35 if $val36 = 1 Then _separator() _invert($checkopt36) $final = $invert & "raid" _write($final) EndIf ; Placeholder for $val37 ; Placeholder for $val38 if $val39 = 1 Then _separator() _invert($checkopt39) $final = $invert & "stealth" _write($final) EndIf if $val40 = 1 Then _separator() _invert($checkopt40) $final = $invert & "swimming" _write($final) EndIf ; GUI OPTIONS LISTED BELOW (other than target) if $val2 = 1 Then _separator() _invert($checkopt2) _actionbar() $final = $invert & "actionbar:" & $setactionbar _write($final) EndIf _write($cbrack) ; Write a ] close bracket with one space after GUIDelete($potemp) ExitLoop EndIf WEnd Next EndFunc ; || _checkbox() function ; || _checkbox is just a little visual function I wrote to check and disable the command option next to it when you check NO Func _checkbox($var1,$var2) If BitAnd(GUICtrlRead($var1),$GUI_CHECKED) = $GUI_CHECKED Then GUICtrlSetState($var2,$GUI_CHECKED) GUICtrlSetState($var2,$GUI_DISABLE) $checkbox = $checkbox + 1 Else GUICtrlSetState($var2,$GUI_UNCHECKED) GUICtrlSetState($var2,$GUI_ENABLE) $checkbox = $checkbox - 1 EndIf EndFunc ; || notify() function ; || notify() checks to see if the target box is checked on an option that requires it. If an option is checked that requires the target box, ; the target box automatically has a state change to checked and the user receives a msgbox informing them of the options that require target to be set. Func _notify($var1,$var2) If BitAND(GUICtrlRead($var1),GUICtrlRead($var2)) = $GUI_UNCHECKED Then Return ElseIf BitAND(GUICtrlRead($var2),$GUI_CHECKED) = $GUI_CHECKED Then Return Else GUICtrlSetState($var2,$GUI_CHECKED) MsgBox(0,"Target Box Set","When checking the following option types, the target box must also be" & @CRLF & _ " checked in order for them to work. The target box has automatically" & @CRLF & _ " been checked for you." & @CRLF & @CRLF & _ "DEAD" & @TAB & @TAB & "Target Box Must Be Checked" & @CRLF & _ "EXISTS" & @TAB & @TAB & "Target Box Must Be Checked" & @CRLF & _ "HARM" & @TAB & @TAB & "Target Box Must Be Checked" & @CRLF & _ "HELP" & @TAB & @TAB & "Target Box Must Be Checked" & @CRLF & _ "PARTY" & @TAB & @TAB & "Target Box Must Be Checked" & @CRLF & _ "RAID" & @TAB & @TAB & "Target Box Must Be Checked") EndIf EndFunc ; || _notifytarget() function ; || _notifytarget checks against all other options that require the target box to be set. If the target box is unchecked and those boxes are still checked, ; || their states will automatically be changed to unchecked. Func _notifytarget($var1,$var2,$var3,$var4,$var5,$var6,$var7) If BitAND(GUICtrlRead($var1),GUICtrlRead($var2),GUICtrlRead($var3),GUICtrlRead($var4),GUICtrlRead($var5),GUICtrlRead($var6),GUICtrlRead($var7)) = $GUI_UNCHECKED Then Return Else GUICtrlSetState($var2,$GUI_UNCHECKED) GUICtrlSetState($var3,$GUI_UNCHECKED) GUICtrlSetState($var4,$GUI_UNCHECKED) GUICtrlSetState($var5,$GUI_UNCHECKED) GUICtrlSetState($var6,$GUI_UNCHECKED) GUICtrlSetState($var7,$GUI_UNCHECKED) EndIf EndFunc ; || _separator() function ; || _separator is a small function that decides on whether or not to add a comma delimiter to the macro Func _separator() $rstring = StringRight(guictrlread($MACRO),1) ;msgbox(0,"rstring = ",$rstring) if $rstring = "[" Then Return Else $sepval = "," _write($sepval) EndIf EndFunc ; || _invert() function ; || _invert is a function that decides on whether or not to invert (place a no) in front of the option Func _invert($var1) if GUICtrlRead($var1) = $GUI_CHECKED Then $invert = "no" Else $invert = "" EndIf EndFunc ; || _write() function ; || _write sets the guictrlsetdata to the appropriate strings presented in the function argument chains Func _write($var1) GUICtrlSetData($MACRO,$var1,$var1) ;msgbox(0,"Writing",$var1) EndFunc ; ################################################################## Options - Special GUIs ######################################### ; || _actionbar() function ; || _actionbar() is a function that presents a gui choice for the action bar numbers to be used in the option Func _actionbar() ; NEEDS WORK******************************************************************************************************* $setactionbar = "1" EndFunc ; || _button() function ; || _button is a function that determines what button you want to set for the option Func _button() $setbutton = "1" ;button:# EndFunc ; || _channelling() function ; || _channelling is a function that determines what spell is being channelled Func _channelling() $setchanneledspell = "Frost Bolt" ;channelling <name of spell> EndFunc ; || _equipped() function ; || _equipped is a function that determines what itemtype is being equipped Func _equipped() $setequipped = "trinket" ;equipped:itemtype EndFunc ; || _group() function ; || _group is a function that determines what group type you are a part of (group,raid) Func _group() $setgroup = "party" ;group:party|raid EndFunc ; || _modifier() function ; || _modifier is a function that determines what key press you are using with the macro (shift, alt, ctrl) Func _modifier() $setmodifier = "shift" ;modifier:key EndFunc ; || _pet() function ; || _pet is a function that determines what type of pet you are currently using. Func _pet() $setpet = "Imp" ;pet:type EndFunc ; || _stance() function ; || _stance determines what stance you are currently in Func _stance() $setstance = "1" ;stance:# EndFunc ; || _target() function ; || _target is a function that presents a gui choice selection for the type of unit target to be used in the option Func _target() ; NEEDS WORK********************************************************************************************************* $settarget = "focus" ;Define a small gui and show the target types ;Set the target type and formatting EndFunc ; ################################################################## Error Messages ################################################# ; || _error() function ; || _error() is just a formatting error message function accepting what type of error occurred and the message of why it occurred Func _error($type,$message) MsgBox(0,"Error - " & $type, $message) EndFunc ; || _errorinvert() function ; || _errorinvert is a small function that checks to see if an option was inverted when it can't be. If it can't, it errors. Func _errorinvert() if $invert = "no" Then _error("Bad Syntax","You cannot invert this. Proper formatting is now being applied to correct this.") EndIf EndFunc ; ################################################################################################################################### ; ################################################################# End of File ##################################################### ; ################################################################################################################################### ;-Looting ;/ffa (free for all looting) ;/master (masterlooting) ;/roundrobin (round robin) ;-Console ;/console reloadui ;-Script ;/script (custom) ;-target types ;focus ;player ;pet ;partyN ;partypetN (person's pet) ;raidN ;raidpetN ;target (append target to any listed here) ;playertarget ;mouseover ;none ;custom() ;help - Can cast helpful spells on the target (TARGET) ;harm - Can cast harmful spells on the target (TARGET) ;exists - Target exists (TARGET) ;dead - Target is dead (TARGET) ;stance:0/1/2/.../n - In a stance ;stealth - Stealthed ;modifier:shift/ctrl/alt - Holding the given key ;button:1/.../5/<virtual click> - Macro activated with the given mouse button ;equipped:<item type> - item type is equipped (item type can be an inventory slot, item type, or item subtype) ;channeling:<spell name> - Channeling the given spell ;actionbar:1/.../6 - Given action bar page is selected ;pet:<pet name or type> - The given pet is out ;combat - In combat ;mounted - Self explanatory ;swimming - Self explanatory ;flying - Mounted or in flight form AND in the air ;flyable - In a zone where flying is allowed ;indoors - Self explanatory ;outdoors - Self explanatory ;party - Target is in your party (TARGET) ;raid - Target is in your raid/party (TARGET) ;group:party/raid - You are in the given type of group ;-slotids ;0 = ammo ;1 = head ;2 = neck ;3 = shoulder ;4 = shirt ;5 = chest ;6 = belt ;7 = legs ;8 = feet ;9 = wrist ;10 = gloves ;11 = finger 1 ;12 = finger 2 ;13 = trinket 1 ;14 = trinket 2 ;15 = back ;16 = main hand ;17 = off hand ;18 = ranged ;19 = tabard ;20 = first bag (the rightmost one) ;21 = second bag ;22 = third bag ;23 = fourth bag (the leftmost one) Perhaps it's a behavior on my own computer but I'd like to know what might be happening. Or, if I can program against it or figure out what option might cause all "input boxes" to be highlighted by default. 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] Link to comment Share on other sites More sharing options...
Ealric Posted January 12, 2008 Author Share Posted January 12, 2008 Test using Insert > Secure Commands > Assist. Add 1 to the conditions box. Check mark dead, exists, target and then click OK. If it's working right for you then it should append and create a fully functional line such as: /assist [target=focus,dead,exists] If it's not working right, all of it will be blank and an additional line space will have been input. Again, on one machine, the above works perfect. On the other machine, it just deletes everything because the text within the control is defaulting to an "automatically highlighted/selected" state for some reason. I'm not sure if this is due to my OS options (windows xp on both). It's just a weird thing that I can't quite figure out. 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] Link to comment Share on other sites More sharing options...
Ealric Posted January 12, 2008 Author Share Posted January 12, 2008 I resolved my own issue. I set: GUICtrlSetState(-1,$GUI_FOCUS) .. after each $OKc button so that the focus shifted off the form fields and onto the buttons themselves. This fixed the issue. 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] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now