Jump to content

FFXI Macro/Timer Helper


Aceguy
 Share

Recommended Posts

Here it is....

Thanks to ALL that helped me with this script......(many questions asked).

This to me shows what a FANTASTIC program Autoit is...... :)

BTW, this is not a HACK, CRACK or anything like that. its a timer that listens to keystrokes and gives a graphical update to how long you can recast you spells/abilities.

it does also send the code to the game, i.e. /ma "Cure" <bt>

#include<GUIConstants.au3>
#include<Array.au3>
#include<Misc.au3>
#include <Sound.au3>
#include <GUICombo.au3>

Opt("GUIOnEventMode", 1)
Opt("SendKeyDownDelay", 1)
Opt("SendKeyDelay", 5);

Global $height, $Labela1, $group_i, $target, $com_read, $t_clock, $t_clock2, $t_listen

$t_clock = 500
$t_clock2 = 0.5
$t_listen = 50

$Form1 = GUICreate("Countdown", 450, 80, 810, 74, -1, BitOR($WS_EX_TOOLWINDOW, $WS_EX_WINDOWEDGE, $WS_EX_TOPMOST))
GUISetOnEvent($GUI_EVENT_CLOSE, "quit")
GUICtrlSetResizing(-1, $GUI_DOCKALL)
$add = GUICtrlCreateButton("Add", 8, 8, 49, 25, 0)
GUICtrlSetOnEvent(-1, "addrow")
GUICtrlSetResizing(-1, $GUI_DOCKALL)
$remove = GUICtrlCreateButton("Delete", 64, 8, 49, 25, 0)
GUICtrlSetResizing(-1, $GUI_DOCKALL)
GUICtrlSetOnEvent(-1, "remove")
$save = GUICtrlCreateButton("Clear List", 120, 8, 57, 25, 0)
GUICtrlSetResizing(-1, $GUI_DOCKALL)
GUICtrlSetOnEvent(-1, "clear")
$reset= GUICtrlCreateButton("Reset " ,375, 58, 60, 15)
GUICtrlSetResizing(-1, $GUI_DOCKALL)
GUICtrlSetOnEvent(-1, "Reset")
GUICtrlSetTip(-1,"Resets All Counters to Start Time.!!")
$Combo1 = GUICtrlCreateCombo("Combo1", 8, 40, 73, 25)
GUICtrlSetData(-1, "CTRL|ALT")
GUICtrlSetResizing(-1, $GUI_DOCKALL)
$Combo2 = GUICtrlCreateCombo("Combo2", 88, 40, 73, 25)
GUICtrlSetData(-1, "1|2|3|4|5|6|7|8|9|0|b")
GUICtrlSetResizing(-1, $GUI_DOCKALL)
$name = GUICtrlCreateInput("name", 184, 8, 73, 21)
GUICtrlSetResizing(-1, $GUI_DOCKALL)
$Combo3 = GUICtrlCreateCombo("Combo3", 168, 40, 81, 25)
GUICtrlSetData(-1, "3 Secs|5 Secs|10 Secs|15 Secs|20 Secs|30 Secs|45 Secs|1 Min|1 Min 30 Secs|2 Mins|3 Mins|4 Mins|5 Mins|10 Mins|15 Mins|30 Mins|2 Hrs")
GUICtrlSetResizing(-1, $GUI_DOCKALL)
$Checkbox1 = GUICtrlCreateCheckbox("Custon Macro", 264, 8, 85, 25)
GUICtrlSetResizing(-1, $GUI_DOCKALL)
$Label_target = GUICtrlCreateLabel("Target", 264, 40, 100, 26,$SS_SUNKEN,-1)
GUICtrlSetFont(-1, 16, 800, 0, "MS Sans Serif")
GUICtrlSetResizing(-1, $GUI_DOCKALL)
$combo_group = GUICtrlCreateCombo('', 355, 8, 89, 21, BitOR($CBS_DROPDOWN, $CBS_SORT, $ES_READONLY), 0)
GUICtrlSetOnEvent(-1, "combo_change")
GUICtrlSetData(-1, "Beastmaster|Ranger|Bard|Warrior|Theif|Red Mage|White Mage|Blue Mage|Black Mage|Palladin|Monk|Ninja|Samurai|Pupateer|Summoner|Scholar|Dancer|Dragoon|Dark Knight|Corinthian|Custom Set #1|Custom Set #2")
GUICtrlSetResizing(-1, $GUI_DOCKALL)
$settings = GUICtrlCreateButton("Settings", 375, 40, 60, 15)
GUICtrlSetTip(-1,"Right Click"&@CRLF&"How Quick in Milliseconds it will"&@CRLF&"detect your Key-Strokes / Green&Red Progress bars")
GUICtrlSetResizing(-1, $GUI_DOCKALL)
GUICtrlSetOnEvent(-1,"but_save")
$buttoncontext = GUICtrlCreateContextMenu($settings)
$buttonitem = GUICtrlCreateMenu("Listen Time", $buttoncontext)

$buttonitem1 = GUICtrlCreateMenu("Bar Update", $buttoncontext)
$key0 = GUICtrlCreateMenuItem("200", $buttonitem)

GUICtrlSetOnEvent(-1, "listen")
$key1 = GUICtrlCreateMenuItem("100", $buttonitem)
GUICtrlSetOnEvent(-1, "listen")
$key2 = GUICtrlCreateMenuItem("75", $buttonitem)
GUICtrlSetOnEvent(-1, "listen")
$key3 = GUICtrlCreateMenuItem("50", $buttonitem)
GUICtrlSetOnEvent(-1, "listen")
$key2 = GUICtrlCreateMenuItem("25", $buttonitem)
GUICtrlSetOnEvent(-1, "listen")

$bar1 = GUICtrlCreateMenuItem("1000", $buttonitem1)
GUICtrlSetOnEvent(-1, "bars")
$bar2 = GUICtrlCreateMenuItem("500", $buttonitem1)
GUICtrlSetOnEvent(-1, "bars")
$bar2 = GUICtrlCreateMenuItem("250", $buttonitem1)
GUICtrlSetOnEvent(-1, "bars")

Dim $group_i[1]
Dim $Label_i[1]
Dim $Input_i[1]
Dim $i_key[1]
Dim $i_key_a[1]
Dim $i_key_b[1]
Dim $timer_init[1]
Dim $Input_i_2[1]
Dim $t_start[1]
Dim $init[1]
Dim $Labela1[1]
Dim $Inputa1[1]
Dim $macro[1]
dim $b[1]

$stress=False
$save = False
$combo_sent=False

$line = 0
$b2y = 0
$num = 50
$bY = 0
$bx = 0
$alt = 0
$ctrl = 0
$box = 0
$done = 0
$t_clock3=1
$diff2=0
$diff3=0
$wait_len = 1
Dim $IniFile = @MyDocumentsDir & "\coutdown.ini"
$op = FileOpen($IniFile, 0)
If $op = -1 Then
    $c_list = _GUICtrlComboGetList($combo_group)
    MsgBox(0, "", $c_list, 0)
    $c_list1 = StringSplit($c_list, "|")
    For $c_l = 1 To $c_list1[0]
        IniWrite($IniFile, $c_list1[$c_l], "0", "0")
    Next
EndIf
$ir1=IniRead($IniFile,"settings",0,"")
if $ir1 <> "" Then
    if $ir1 = 22 then
            $t_clock = 1000
            $t_clock2 = $t_clock / 1000
        elseif $ir1 = 23 Then
            $t_clock = 500
            $t_clock2 = $t_clock / 1000
        elseif $ir1 = 24 Then
            $t_clock = 250
            $t_clock2 = $t_clock / 1000
        EndIf
        
        GUICtrlSetState($ir1, $GUI_CHECKED)
        EndIf
$ir2=IniRead($IniFile,"settings",1,"")
    if $ir2 <> "" Then
        if $ir2 = 17 Then
            $t_listen = 200
        elseif $ir2 = 18 Then
            $t_listen = 100
        elseif $ir2 = 19 Then
            $t_listen = 75
        elseif $ir2 = 20 Then
            $t_listen = 50
        Elseif $ir2 = 21 Then
            $t_listen = 25
        EndIf
        
        GUICtrlSetState($ir2, $GUI_CHECKED)
    EndIf
    
$ir3=iniread($IniFile,"Last",0,"")
if $ir3 <> "" Then
_GUICtrlComboSelectString ( $combo_group,1,$ir3)
EndIf
    
    
    
    
    
AdlibEnable("time", $t_clock)
GUISetState(@SW_SHOW)
combo_change()
While 1
    For $c = 1 To $group_i[0]
        If _IsPressed($i_key_a[$c]) And _IsPressed($i_key_b[$c])  Then
            GUICtrlSetBkColor($Input_i[$c], 0xff0000)
            _SoundPlay(@WindowsDir & "\media\notify.wav", 0)
            If $t_start[$c] = False Then
                $t_start[$c] = True
            ElseIf $t_start[$c] = True Then
                $timer_init[$c] = $init[$c]
            EndIf
            If $macro[$c] <> '0' Then
                If GUICtrlRead($Label_target) = "Target" Then
                    $target = '<t>'
                
                elseif GUICtrlRead($Label_target) = "ME" Then 
                    $target = '<me>'
                
                elseif GUICtrlRead($Label_target) = "F2" Then 
                    $target = '<p1>'
                
                elseif GUICtrlRead($Label_target) = "F3" Then 
                    $target = '<p2>'
                
                elseif GUICtrlRead($Label_target) = "F4" Then 
                    $target = '<p3>'
                
                elseif GUICtrlRead($Label_target) = "F5" Then 
                    $target = '<p4>'
                
                elseif GUICtrlRead($Label_target) = "F6" Then 
                    $target = '<p5>'
                
                elseif GUICtrlRead($Label_target) = "Battle" Then 
                    $target = '<bt>'
                
                EndIf
            EndIf
        EndIf
    Next
    If _IsPressed("09") Then 
        GUICtrlSetData($Label_target, "Target")
        GUICtrlSetBkColor($Label_target,0xFFFFaa)
    elseif _IsPressed("70") Then 
        GUICtrlSetData($Label_target, "ME")
        GUICtrlSetBkColor($Label_target, 0xFFFFFF)
    elseif _IsPressed("71") Then 
    gUICtrlSetData($Label_target, "F2")
    GUICtrlSetBkColor($Label_target, 0xA6CAF0)
    elseif _IsPressed("72") Then 
        GUICtrlSetData($Label_target, "F3")
        GUICtrlSetBkColor($Label_target, 0xA6CAF0)
    elseif _IsPressed("73") Then 
        GUICtrlSetData($Label_target, "F4")
        GUICtrlSetBkColor($Label_target, 0xA6CAF0)
    elseif _IsPressed("74") Then 
        GUICtrlSetData($Label_target, "F5")
        GUICtrlSetBkColor($Label_target, 0xA6CAF0)
    elseif _IsPressed("75") Then 
        GUICtrlSetData($Label_target, "F6")
        GUICtrlSetBkColor($Label_target, 0xA6CAF0)
    elseif _IsPressed("77") Then 
        GUICtrlSetData($Label_target, "Battle")
    GUICtrlSetBkColor($Label_target, 0xFF0000)
    EndIf
    Sleep($t_listen)

WEnd

Func addrow()
;*********************** CHECKS IS KEY EXISTS ***********************
    $match = False
    If GUICtrlRead($Combo1) = "CTRL" Then $c_r = "11"
    If GUICtrlRead($Combo1) = "ALT" Then $c_r = "12"
    If GUICtrlRead($Combo2) = '1' Then $c_s = "31"
    If GUICtrlRead($Combo2) = '2' Then $c_s = "32"
    If GUICtrlRead($Combo2) = '3' Then $c_s = "33"
    If GUICtrlRead($Combo2) = '4' Then $c_s = "34"
    If GUICtrlRead($Combo2) = '5' Then $c_s = "35"
    If GUICtrlRead($Combo2) = '6' Then $c_s = "36"
    If GUICtrlRead($Combo2) = '7' Then $c_s = "37"
    If GUICtrlRead($Combo2) = '8' Then $c_s = "38"
    If GUICtrlRead($Combo2) = '9' Then $c_s = "39"
    If GUICtrlRead($Combo2) = '0' Then $c_s = "30"
    If GUICtrlRead($Combo2) = 'b' Then $c_s = "42"
    For $c = 1 To $group_i[0]
        If $i_key_a[$c] = $c_r And $i_key_b[$c] = $c_s Then
            $match = True
        EndIf
    Next
;*******************************************************************


    If $match = False Then
        If GUICtrlRead($name) <> "name" And GUICtrlRead($name) <> "" And GUICtrlRead($Combo1) <> "Combo1" And GUICtrlRead($Combo2) <> "Combo2" And GUICtrlRead($Combo3) <> "Combo3" Then

            $group_i[0] += 1
            $Label_i[0] += 1
            $Input_i[0] += 1
            $i_key_a[0] += 1
            $i_key_b[0] += 1
            $timer_init[0] += 1
            $Input_i_2[0] += 1
            $t_start[0] += 1
            $init[0] += 1
            $macro[0] += 1
            $b[0] +=1
            
            ReDim $group_i[$group_i[0] + 1]
            ReDim $Label_i[$Label_i[0] + 1]
            ReDim $Input_i[$Input_i[0] + 1]
            ReDim $i_key_a[$i_key_a[0] + 1]
            ReDim $i_key_b[$i_key_b[0] + 1]
            ReDim $timer_init[$timer_init[0] + 1]
            ReDim $Input_i_2[$Input_i_2[0] + 1]
            ReDim $t_start[$t_start[0] + 1]
            ReDim $init[$init[0] + 1]
            ReDim $macro[$macro[0] + 1]
            ReDim $b[$b[0] +1]
            
            $Ypos = WinGetPos("Countdown")

            If GUICtrlRead($Combo1) = "ALT" Then
                $bx = 220
                $alt += 1
                If $alt = $ctrl Then
                    $height = ($alt * $num) + 100
                    $box = ($alt * $num)
                ElseIf $alt > $ctrl Then
                    $height = ($alt * $num) + 100
                    $box = ($alt * $num)
                ElseIf $alt < $ctrl Then
                    $box = ($alt * $num)
                EndIf
            ElseIf GUICtrlRead($Combo1) = "CTRL" Then
                $bx = 0
                $ctrl += 1
                If $alt = $ctrl Then
                    $height = ($alt * $num) + 100
                    $box = ($ctrl * $num)
                ElseIf $ctrl > $alt Then
                    $box = ($ctrl * $num)
                    $height = ($ctrl * $num) + 100
                ElseIf $ctrl < $alt Then
                    $box = $ctrl * $num
                EndIf
            EndIf


            WinMove("Countdown", '', $Ypos[0], $Ypos[1], $Ypos[2], $height, 0)



            $group_i[$group_i[0]] = GUICtrlCreateGroup(GUICtrlRead($Combo1) & "+" & GUICtrlRead($Combo2), 3 + $bx, 22 + $box, 215, 49)
            GUICtrlSetResizing(-1, $GUI_DOCKALL)
            $Label_i[$Label_i[0]] = GUICtrlCreateLabel(GUICtrlRead($name), 10 + $bx, 37 + $box, 150, 20)
            GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
            GUICtrlSetResizing(-1, $GUI_DOCKALL)
            $Input_i[$Input_i[0]] = GUICtrlCreateProgress(10 + $bx, 56 + $box, 200, 10)
            GUICtrlSetColor(-1, 0x00FF00)
            GUICtrlSetBkColor(-1, 0x00ff00)
            GUICtrlSetCursor(-1, 7)
            DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", " ", "wstr", " ")
            GUICtrlSetStyle(-1, 1)
            GUICtrlSetResizing(-1, $GUI_DOCKALL)
            $Input_i_2[$Input_i_2[0]] = GUICtrlCreateLabel("", 160 + $bx, 35 + $box, 50, 15,bitor($SS_SUNKEN,$SS_RIGHT),-1)
            GUICtrlSetCursor(-1, 7)
            GUICtrlSetResizing(-1, $GUI_DOCKALL)
            GUICtrlSetBkColor(-1, 0xFFFFFF)
            GUICtrlCreateGroup ("",-99,-99,1,1)
            
            If GUICtrlRead($Combo1) = "CTRL" Then $i_key_a[$i_key_a[0]] = "11"
            If GUICtrlRead($Combo1) = "ALT" Then $i_key_a[$i_key_a[0]] = "12"
            If GUICtrlRead($Combo2) = '1' Then $i_key_b[$i_key_b[0]] = "31"
            If GUICtrlRead($Combo2) = '2' Then $i_key_b[$i_key_b[0]] = "32"
            If GUICtrlRead($Combo2) = '3' Then $i_key_b[$i_key_b[0]] = "33"
            If GUICtrlRead($Combo2) = '4' Then $i_key_b[$i_key_b[0]] = "34"
            If GUICtrlRead($Combo2) = '5' Then $i_key_b[$i_key_b[0]] = "35"
            If GUICtrlRead($Combo2) = '6' Then $i_key_b[$i_key_b[0]] = "36"
            If GUICtrlRead($Combo2) = '7' Then $i_key_b[$i_key_b[0]] = "37"
            If GUICtrlRead($Combo2) = '8' Then $i_key_b[$i_key_b[0]] = "38"
            If GUICtrlRead($Combo2) = '9' Then $i_key_b[$i_key_b[0]] = "39"
            If GUICtrlRead($Combo2) = '0' Then $i_key_b[$i_key_b[0]] = "30"
            If GUICtrlRead($Combo2) = 'b' Then $i_key_b[$i_key_b[0]] = "42"
            If GUICtrlRead($Combo3) = '3 Secs' Then $timer_init[$timer_init[0]] = 3000
            If GUICtrlRead($Combo3) = '5 Secs' Then $timer_init[$timer_init[0]] = 5000
            If GUICtrlRead($Combo3) = '10 Secs' Then $timer_init[$timer_init[0]] = 10000
            If GUICtrlRead($Combo3) = '15 Secs' Then $timer_init[$timer_init[0]] = 15000
            If GUICtrlRead($Combo3) = '20 Secs' Then $timer_init[$timer_init[0]] = 20000
            If GUICtrlRead($Combo3) = '30 Secs' Then $timer_init[$timer_init[0]] = 30000
            If GUICtrlRead($Combo3) = '45 Secs' Then $timer_init[$timer_init[0]] = 45000
            If GUICtrlRead($Combo3) = '1 Min' Then $timer_init[$timer_init[0]] = 60000
            If GUICtrlRead($Combo3) = '1 Min 30 Secs' Then $timer_init[$timer_init[0]] = 90000
            If GUICtrlRead($Combo3) = '2 Mins' Then $timer_init[$timer_init[0]] = 120000
            If GUICtrlRead($Combo3) = '3 Mins' Then $timer_init[$timer_init[0]] = 3 * 60000
            If GUICtrlRead($Combo3) = '4 Mins' Then $timer_init[$timer_init[0]] = 4 * 60000
            If GUICtrlRead($Combo3) = '5 Mins' Then $timer_init[$timer_init[0]] = 5 * 60000
            If GUICtrlRead($Combo3) = '10 Mins' Then $timer_init[$timer_init[0]] = 10 * 60000
            If GUICtrlRead($Combo3) = '15 Mins' Then $timer_init[$timer_init[0]] = 15 * 60000
            If GUICtrlRead($Combo3) = '30 Mins' Then $timer_init[$timer_init[0]] = 30 * 60000
            If GUICtrlRead($Combo3) = '2 Hrs' Then $timer_init[$timer_init[0]] =  7200000
            GUICtrlSetData($Input_i_2[$Input_i_2[0]], $timer_init[$timer_init[0]])
            $init[$init[0]] = $timer_init[$timer_init[0]]
            $t_start[$t_start[0]] = False


            GUICtrlSetData($name, '')

            If GUICtrlRead($Checkbox1) = 1 Then
                newgui()
            Else
                $macro[$macro[0]] = 0
            EndIf


            $save = True
            GUICtrlSetBkColor($settings,0xff0000)
            GUICtrlSetData($settings,"Save")
        Else
            MsgBox(0, "", "Boxes not set", 0)
        EndIf
    Else
        MsgBox(0, "", "Key Combination Found", 0)
    EndIf
EndFunc  ;==>addrow

Func newgui()
    
    $Forma2 = GUICreate("Command Edit", 417, 42, 498, 358, -1, BitOR($WS_EX_TOOLWINDOW, $WS_EX_WINDOWEDGE, $WS_EX_TOPMOST))
    $Buttona1 = GUICtrlCreateButton("New Line", 280, 8, 57, 17, 0)
    GUICtrlSetOnEvent(-1, "addcommand")
    
    GUICtrlSetResizing(-1, $GUI_DOCKALL)
    $Buttona2 = GUICtrlCreateButton("Accept", 344, 8, 65, 17, 0)
    GUICtrlSetResizing(-1, $GUI_DOCKALL)
    GUICtrlSetOnEvent(-1, "Macroaccept")
    $line = 0
    $b2y = 0
    Dim $Labela1[1]
    Dim $Inputa1[1]

    GUISetState(@SW_SHOW, $Forma2)
EndFunc  ;==>newgui

Func addcommand()
    $Ypos2 = WinGetPos("Command Edit")
    $Labela1[0] += 1
    $Inputa1[0] += 1
    ReDim $Labela1[$Labela1[0] + 1]
    ReDim $Inputa1[$Inputa1[0] + 1]
    $line += 1
    $Labela1[$Labela1[0]] = GUICtrlCreateLabel("", 8, 8 + $b2y, 58, 24)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    GUICtrlSetResizing(-1, $GUI_DOCKALL)
    GUICtrlSetData(-1, "Line " & $line)
    $Inputa1[$Inputa1[0]] = GUICtrlCreateInput("", 72, 8 + $b2y, 201, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKALL)
    GUICtrlSetTip(-1, "Use <gui> for targeting with Prog.!")
    GUICtrlSetState(-1, $GUI_FOCUS)
    WinMove("Command Edit", '', $Ypos2[0], $Ypos2[1], $Ypos2[2], $Ypos2[3] + 25, 0)
    $b2y += 25
EndFunc  ;==>addcommand

Func time()

    For $d = 1 To $group_i[0]
        If $t_start[$d] = True And $timer_init[$d] >= 0 Then
            If $timer_init[$d] >= $t_clock Then
                GUICtrlSetState($settings, $GUI_DISABLE)
                
                If $macro[$d] <> '0' Then
                    $split = StringSplit($macro[$d], ',')
        
                    If $timer_init[$d] = $init[$d] Then 
                        $b[$d] = 1
                    GUICtrlSetBkColor($Input_i[$d],0xA6CAF0)
                
                ElseIf $b[$d] > $split[0] Then
                    GUICtrlSetBkColor($Input_i[$d],0xFF0000)
                    
                    EndIf
                    
                    If IsInt($b[$d]) And $b[$d] <= $split[0] Then
                        
                        $string = StringInStr($split[$b[$d]], '/wait')
                        $string2 = StringInStr($split[$b[$d]], '<gui>')
                        
                        If $string = 0 Then
                            If $string2 > 0 Then
                                sleep(150)
                                $text = StringReplace($split[$b[$d]], '<gui>', $target)
                                Send($text & "{enter}")
                            Else
                                sleep(150)
                                Send($split[$b[$d]] & "{enter}")
                            EndIf
                        EndIf
                    EndIf
                    
                    If  $b[$d] <= $split[0] Then
                        $s = StringInStr($split[$b[$d]], '/wait')
                        If $s > 0 Then
                            $wait = StringSplit($split[$b[$d]], ' ')
                            
                            If @error = 0 Then
                                If $wait_len <= $wait[2] Then
                                    $wait_len += $t_clock2
                                Else
                                    $wait_len = 1
                                    $b[$d] += $t_clock2
                                EndIf
                            EndIf
                        EndIf
                        
                        
                        If $wait_len = 1 And $b <= $split[0] Then
                            $b[$d] += $t_clock2
                        EndIf
                    EndIf
                EndIf
                
                $timer_init[$d] -= $t_clock

                GUICtrlSetData($Input_i[$d], Int(100 - ($timer_init[$d] / $init[$d]) * 100))

                $time = $timer_init[$d] / 1000
                $hour= floor($time/6000)
                $minute = Floor(Mod(($time / 60), 60));
                
                If $minute < 10 Then
                    $minute = '0' & $minute
                EndIf
                $second = Floor(Mod($time, 60))
                If $second < 10 Then
                    $second = '0' & $second
                EndIf
                GUICtrlSetData($Input_i_2[$d], $hour&":"&$minute & ":" & $second)
            Else
                _SoundPlay(@WindowsDir & "\media\Tada.wav", 0)
                $t_start[$d] = False
                $timer_init[$d] = $init[$d]
                GUICtrlSetData($Input_i_2[$d], $timer_init[$d])
                GUICtrlSetColor($Input_i[$d], 0x00FF00)
                GUICtrlSetBkColor($Input_i[$d], 0x00ff00)
                GUICtrlSetState($settings, $GUI_ENABLE)
            EndIf
        EndIf
    Next
EndFunc  ;==>time

Func save()
    ConsoleWrite("Saving")
    If GUICtrlRead($combo_group) <> 'Set' Then
        IniDelete($IniFile, $com_read)
        
        If $alt = 0 And $ctrl = 0 Then

            IniWrite($IniFile, $com_read, "0", "0")
            
        Else
            For $a = 1 To $group_i[0]
                IniWrite($IniFile, $com_read, $a - 1, GUICtrlRead($Label_i[$a]) & "|" & $i_key_a[$a] & "|" & $i_key_b[$a] & "|" & $timer_init[$a] & "|" & $macro[$a])
            Next

        EndIf
        GUICtrlSetData($settings,"Settings")
        GUICtrlSetBkColor($settings,0xFFFFFF)
    EndIf

    $save = False
EndFunc  ;==>save

Func load_settings()
    $var_open = IniReadSection($IniFile, GUICtrlRead($combo_group))
    
    For $e = 1 To $var_open[0][0]
        $s_s = StringSplit($var_open[$e][1], "|")



        $group_i[0] += 1
        $Label_i[0] += 1
        $Input_i[0] += 1
        $i_key_a[0] += 1
        $i_key_b[0] += 1
        $timer_init[0] += 1
        $Input_i_2[0] += 1
        $t_start[0] += 1
        $init[0] += 1
        $macro[0] += 1
        $b[0] +=1
        
        ReDim $group_i[$group_i[0] + 1]
        ReDim $Label_i[$Label_i[0] + 1]
        ReDim $Input_i[$Input_i[0] + 1]
        ReDim $i_key_a[$i_key_a[0] + 1]
        ReDim $i_key_b[$i_key_b[0] + 1]
        ReDim $timer_init[$timer_init[0] + 1]
        ReDim $Input_i_2[$Input_i_2[0] + 1]
        ReDim $t_start[$t_start[0] + 1]
        ReDim $init[$init[0] + 1]
        ReDim $macro[$macro[0] + 1]
        ReDim $b[$b[0] + 1]

        If $s_s[2] = 11 Then $s_s2 = 'CTRL'
        If $s_s[2] = 12 Then $s_s2 = 'ALT'

        If $s_s[3] = '31' Then $s_s3 = "1"
        If $s_s[3] = '32' Then $s_s3 = "2"
        If $s_s[3] = '33' Then $s_s3 = "3"
        If $s_s[3] = '34' Then $s_s3 = "4"
        If $s_s[3] = '35' Then $s_s3 = "5"
        If $s_s[3] = '36' Then $s_s3 = "6"
        If $s_s[3] = '37' Then $s_s3 = "7"
        If $s_s[3] = '38' Then $s_s3 = "8"
        If $s_s[3] = '39' Then $s_s3 = "9"
        If $s_s[3] = '30' Then $s_s3 = "0"
        If $s_s[3] = '42' Then $s_s3 = "b"

        $Ypos = WinGetPos("Countdown")
        If $s_s2 = 'ALT' Then
            $bx = 220
            $alt += 1
            If $alt = $ctrl Then
                $height = ($alt * $num) + 100
                $box = ($alt * $num)
            ElseIf $alt > $ctrl Then
                $height = ($alt * $num) + 100
                $box = ($alt * $num)
            ElseIf $alt < $ctrl Then
                $box = ($alt * $num)
            EndIf
        ElseIf $s_s2 = 'CTRL' Then
            $bx = 0
            $ctrl += 1
            If $alt = $ctrl Then
                $height = ($alt * $num) + 100
                $box = ($ctrl * $num)
            ElseIf $ctrl > $alt Then
                $box = ($ctrl * $num)
                $height = ($ctrl * $num) + 100
            ElseIf $ctrl < $alt Then
                $box = $ctrl * $num
            EndIf
        EndIf
        WinMove("Countdown", '', $Ypos[0], $Ypos[1], $Ypos[2], $height, 0)

        $group_i[$group_i[0]] = GUICtrlCreateGroup($s_s2 & "+" & $s_s3, 3 + $bx, 22 + $box, 215, 49)
        GUICtrlSetResizing(-1, $GUI_DOCKALL)
        $Label_i[$Label_i[0]] = GUICtrlCreateLabel($s_s[1], 10 + $bx, 37 + $box, 150, 20)
        GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
        GUICtrlSetResizing(-1, $GUI_DOCKALL)
        $Input_i[$Input_i[0]] = GUICtrlCreateProgress(10 + $bx, 56 + $box, 200, 10)
        GUICtrlSetColor(-1, 0x00FF00)
        GUICtrlSetBkColor(-1, 0x00ff00)
        GUICtrlSetCursor(-1, 7)
        DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", " ", "wstr", " ")
        GUICtrlSetStyle(-1, 1)
        GUICtrlSetResizing(-1, $GUI_DOCKALL)
        $Input_i_2[$Input_i_2[0]] = GUICtrlCreateLabel("", 160 + $bx, 35 + $box, 50, 15,bitor($SS_SUNKEN,$SS_RIGHT),-1)
        GUICtrlSetCursor(-1, 7)
        GUICtrlSetResizing(-1, $GUI_DOCKALL)
        GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlCreateGroup ("",-99,-99,1,1)
        $i_key_a[$i_key_a[0]] = $s_s[2]
        $i_key_b[$i_key_b[0]] = $s_s[3]

        $timer_init[$timer_init[0]] = $s_s[4]

        GUICtrlSetData($Input_i_2[$Input_i_2[0]], $timer_init[$timer_init[0]])
        $init[$init[0]] = $timer_init[$timer_init[0]]
        $t_start[$t_start[0]] = False
        $macro[$macro[0]] = $s_s[5]

    Next


EndFunc  ;==>load_settings

Func quit()
if $save=true Then  
    save()
    EndIf
if GUICtrlRead($combo_group) <> "Set" Then
IniWrite($IniFile,"last",0,GUICtrlRead($combo_group))
EndIf   
    Exit
    GUIDelete($Form1)
EndFunc  ;==>quit

Func Macroaccept()
    $wait_count = 0
    Dim $read[$Labela1[0] + 1]
    For $r = 1 To $Labela1[0]
        If GUICtrlRead($Inputa1[$r]) <> "" Then
            $read[$r] = GUICtrlRead($Inputa1[$r])
            $str = StringInStr($read[$r], "/wait")
            
            If $str > 0 Then
                $w_split = StringSplit($read[$r], ' ')
                
                $wait_count += $w_split[2]
            Else
                $wait_count += 1
            EndIf
        EndIf
    Next
    
    If $wait_count >= ($timer_init[$timer_init[0]] / 1000) Then
        MsgBox(0, "Error", "Your /wait commands Total, exceeds you timer!!!" & @CRLF & "Remeber.. Even if your command doesnt contain a /wait it still counts as 1 Second!!", 0)
    Else
        $aray_strin = _ArrayToString($read, ',', 1, $Labela1[0])
        
        $macro[$macro[0]] = $aray_strin
        GUISetState(@SW_HIDE, "Command Edit")
        GUISwitch($Form1)
    EndIf
EndFunc  ;==>Macroaccept

Func remove()
    If GUICtrlRead($Combo1) = 'Combo1' Or GUICtrlRead($Combo2) = 'Combo2' Then
        MsgBox(0, "", "Set Combo boxes to selecet what macro to delete", 0)
    Else
    $save = True
    GUICtrlSetBkColor($settings,0xff0000)
GUICtrlSetData($settings,"Save")    
    Dim $read_labels[$group_i[0] + 1]
        Dim $read_input[$group_i[0] + 1]
        For $rl = 1 To $group_i[0]
            $read_labels[$rl] = GUICtrlRead($Label_i[$rl])
            $read_input[$rl] = GUICtrlRead($Input_i_2[$rl])
        Next

        $found = 0
        For $str = $group_i[0] To 1 Step - 1
            If $i_key_a[$str] = 11 And GUICtrlRead($Combo1) = 'CTRL' And $found = 0 Then
                $ss = $str
                $found = 1
            ElseIf $i_key_a[$str] = 12 And GUICtrlRead($Combo1) = 'ALT' And $found = 0 Then
                $ss = $str
                $found = 1
            EndIf
        Next




        Dim $gh[$group_i[0] + 1]

        For $g = 1 To $group_i[0]
            If $i_key_a[$g] = 11 Then
                $gh[$g] = 1
            Else
                $gh[$g] = 0
            EndIf
        Next



        _ArrayDelete($gh, $ss)
        $gh[0] -= 1




        GUICtrlDelete($group_i[$ss])
        _ArrayDelete($group_i, $ss)
        GUICtrlDelete($Label_i[$ss])
        _ArrayDelete($Label_i, $ss)
        GUICtrlDelete($Input_i[$ss])
        _ArrayDelete($Input_i, $ss)
        GUICtrlDelete($Input_i_2[$ss])
        _ArrayDelete($Input_i_2, $ss)
        $group_i[0] -= 1
        $Label_i[0] -= 1
        $Input_i[0] -= 1
        $Input_i_2[0] -= 1

        $found = 0
        For $str = 1 To $i_key_a[0]
            If $i_key_a[$str] = '11' And GUICtrlRead($Combo1) = 'CTRL' And $i_key_b[$str] = GUICtrlRead($Combo2) + 30 And $found = 0 Then
                $ss = $str
                $found = 1
                $ctrl -= 1
            ElseIf $i_key_a[$str] = '12' And GUICtrlRead($Combo1) = 'ALT' And $i_key_b[$str] = GUICtrlRead($Combo2) + 30 And $found = 0 Then
                $ss = $str
                $found = 1
                $alt -= 1
            EndIf
        Next


        _ArrayDelete($i_key_a, $ss)
        _ArrayDelete($i_key_b, $ss)
        _ArrayDelete($timer_init, $ss)
        _ArrayDelete($t_start, $ss)
        _ArrayDelete($init, $ss)
        _ArrayDelete($macro, $ss)
        _ArrayDelete($read_labels, $ss)
        _ArrayDelete($read_input, $ss)
        
        
        $i_key_a[0] -= 1
        $i_key_b[0] -= 1
        $timer_init[0] -= 1
        $t_start[0] -= 1
        $init[0] -= 1
        $read_labels[0] -= 1
        $read_input[0] -= 1
        $macro[0] -= 1

        Dim $found_it[$group_i[0] + 1]
        Dim $found_it_aa[$group_i[0] + 1]
        For $ct = 1 To $group_i[0]
            $found_it[$ct] = False
            $found_it_aa[$ct] = False
        Next


        For $aa = 1 To $group_i[0]
            
            
            If $i_key_a[$aa] = 11 Then
                
                For $bb = 1 To $group_i[0]
                    If $gh[$bb] = 1 And $found_it[$bb] = False And $found_it_aa[$aa] = False Then
                        $found_it[$bb] = True
                        $found_it_aa[$aa] = True
                        ConsoleWrite("setting box CTRL to $bb" & $bb & "   $aa=" & $aa & "  keya[$aa]=" & $i_key_a[$aa] & "  keyb[$aa]=" & $i_key_b[$aa] & @LF)
                        
                        GUICtrlSetData($group_i[$bb], 'CTRL+' & $i_key_b[$aa] - 30)
                        GUICtrlSetData($Label_i[$bb], $read_labels[$aa])
                        GUICtrlSetData($Input_i_2[$bb], $read_input[$aa])
                        
                        
                    EndIf
                Next
            ElseIf $i_key_a[$aa] = 12 Then
                
                
                For $bb = 1 To $group_i[0]
                    If $gh[$bb] = 0 And $found_it[$bb] = False And $found_it_aa[$aa] = False Then
                        $found_it[$bb] = True
                        $found_it_aa[$aa] = True
                        ConsoleWrite("setting box ALT to $bb" & $bb & "   $aa=" & $aa & "   keya[$aa]=" & $i_key_a[$aa] & "  keyb[$aa]=" & $i_key_b[$aa] & @LF)
                        
                        GUICtrlSetData($group_i[$bb], 'ALT+' & $i_key_b[$aa] - 30)
                        GUICtrlSetData($Label_i[$bb], $read_labels[$aa])
                        GUICtrlSetData($Input_i_2[$bb], $read_input[$aa])

                        
                    EndIf
                Next
            EndIf
        Next
        

        $Ypos = WinGetPos("Countdown")
        If $alt = $ctrl Then
            $height = ($alt * $num) + 100
        ElseIf $alt > $ctrl Then
            $height = ($alt * $num) + 100
        ElseIf $ctrl > $alt Then
            $height = ($ctrl * $num) + 100
        EndIf
        WinMove("Countdown", '', $Ypos[0], $Ypos[1], $Ypos[2], $height, 0)
    EndIf

EndFunc  ;==>remove

Func clear()
    $clear_fin = $group_i[0]
    For $clear = 1 To $clear_fin

        GUICtrlDelete($group_i[1])
        _ArrayDelete($group_i, 1)
        GUICtrlDelete($Label_i[1])
        _ArrayDelete($Label_i, 1)
        GUICtrlDelete($Input_i[1])
        _ArrayDelete($Input_i, 1)
        GUICtrlDelete($Input_i_2[1])
        _ArrayDelete($Input_i_2, 1)
        $group_i[0] -= 1
        $Label_i[0] -= 1
        $Input_i[0] -= 1
        $Input_i_2[0] -= 1
        _ArrayDelete($i_key_a, 1)
        _ArrayDelete($i_key_b, 1)
        _ArrayDelete($timer_init, 1)
        _ArrayDelete($t_start, 1)
        _ArrayDelete($init, 1)
        _ArrayDelete($macro, 1)
        $i_key_a[0] -= 1
        $i_key_b[0] -= 1
        $timer_init[0] -= 1
        $t_start[0] -= 1
        $init[0] -= 1
        $macro[0] -= 1
    Next
    $ctrl = 0
    $alt = 0
dim $b[1]

    If $ctrl = $alt Then
        $Ypos = WinGetPos("Countdown")
        $height = ($ctrl * $num) + 100
        WinMove("Countdown", '', $Ypos[0], $Ypos[1], $Ypos[2], $height, 0)
    EndIf
if $combo_sent=False Then
$save = True
            GUICtrlSetBkColor($settings,0xff0000)
            GUICtrlSetData($settings,"Save")
EndIf
EndFunc  ;==>clear

Func combo_change()
;$stress=True   
;$t_clock3=1    
    If GUICtrlRead($combo_group) <> "Set" Then
        
        If $save = True Then
            save()
            
        EndIf
        $combo_sent=True
        clear()
        $combo_sent=False
        
        $ini_read = IniRead($IniFile, GUICtrlRead($combo_group), "0", "0")
        If $ini_read <> '0' Then
            load_settings()
        EndIf
        $com_read = GUICtrlRead($combo_group)
    Else
        MsgBox(0, "", "Cannot Set 'set'!!!", 0)
    EndIf
EndFunc  ;==>combo_change

Func listen()
    Local $iD = @GUI_CtrlId
    
    GUICtrlSetState($iD, $GUI_CHECKED)
    Switch $iD
        Case $iD = 17
            $t_listen = 200
        Case $iD = 18
            $t_listen = 100
        Case $iD = 19
            $t_listen = 75
        Case $iD = 20
            $t_listen = 50
        Case $iD = 21
            $t_listen = 25
    EndSwitch
    For $i = 17 To 21
        If $i <> $iD Then
            GUICtrlSetState($i, $GUI_UNCHECKED)
        EndIf
    Next
    IniWrite($IniFile,"settings",1,$iD)
EndFunc  ;==>listen

Func bars()
    AdlibDisable()
local $iD = @GUI_CtrlId
    GUICtrlSetState($iD, $GUI_CHECKED)
    Switch $iD
        Case $iD = 22
            $t_clock = 1000
            $t_clock2 = $t_clock / 1000
        Case $iD = 23
            $t_clock = 500
            $t_clock2 = $t_clock / 1000
        Case $iD = 24
            $t_clock = 250
            $t_clock2 = $t_clock / 1000
    EndSwitch
    For $i = 22 To 24
        If $i <> $iD Then
            GUICtrlSetState($i, $GUI_UNCHECKED)
        EndIf
    Next
    AdlibEnable("time", $t_clock)

    IniWrite($IniFile,"settings",0,$iD)
EndFunc  ;==>bars

func but_save()
if $save=True Then
$com_read = GUICtrlRead($combo_group)
save()
EndIf
EndFunc

func reset()
for $d=1 to $group_i[0]
    _SoundPlay(@WindowsDir & "\media\Windows XP Battery Low.wav", 0)
                $t_start[$d] = False
                $timer_init[$d] = $init[$d]
                GUICtrlSetData($Input_i_2[$d], $timer_init[$d])
                GUICtrlSetColor($Input_i[$d], 0x00FF00)
                GUICtrlSetBkColor($Input_i[$d], 0x00ff00)
                GUICtrlSetState($settings, $GUI_ENABLE)
                Next
EndFunc
Edited by Aceguy
Link to comment
Share on other sites

it will detect ffxi macro activation and give you a countdown to let you know when you can use the spell/ability again.

it also wirtes the command line to the game....? (if you have played FFXI youll know what i mean...

if you just wanna test it have notepad open and acrivated.

will post code later, off to work.

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