Jump to content
Sign in to follow this  
Aceguy

Hav'in Troubles with my script.

Recommended Posts

Aceguy

ok, Everything has been working fine with using my new macro editor.

see script please, i want to make a string out of the input boxes......

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

Opt("GUIOnEventMode", 1)


global $height

$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, "add_row")
GUICtrlSetResizing(-1, $GUI_DOCKALL)
$remove = GUICtrlCreateButton("Remove", 64, 8, 49, 25, 0)
GUICtrlSetResizing(-1, $GUI_DOCKALL)
$save = GUICtrlCreateButton("Save List", 120, 8, 57, 25, 0)
GUICtrlSetResizing(-1, $GUI_DOCKALL)
GUICtrlSetOnEvent(-1,"save")
$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|10 Secs|15 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, 105, 25)
GUICtrlSetResizing(-1, $GUI_DOCKALL)
$Label_target = GUICtrlCreateLabel("", 264, 40, 120, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetResizing(-1, $GUI_DOCKALL)

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]
$line=0
$b2y=0
$num=50
$bY = 0
$bx = 0
$alt=0
$ctrl=0
$box=0
$done=0
Dim $IniFile = @MyDocumentsDir & "\coutdown.ini"
$op = FileOpen($IniFile, 0)
If $op = -1 Then
    IniWrite($IniFile, "section", "0", "0")
Else
$iniread=IniRead($IniFile,"section",0,'')
if not $iniread= 0 Then
load_settings()
EndIf
EndIf
AdlibEnable("time",500)

GUISetState(@SW_SHOW)

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   
            
        
      EndIf
    Next
   if _IsPressed("09") then GUICtrlSetData($Label_target,"Target")
if _IsPressed("70") then GUICtrlSetData($Label_target,"ME")
if _IsPressed("71") then GUICtrlSetData($Label_target,"F2")
if _IsPressed("72") then GUICtrlSetData($Label_target,"F3")
if _IsPressed("73") then GUICtrlSetData($Label_target,"F4")
if _IsPressed("74") then GUICtrlSetData($Label_target,"F5")
if _IsPressed("75") then GUICtrlSetData($Label_target,"F6")
if _IsPressed("77") then GUICtrlSetData($Label_target,"Battle Target")
Sleep(500)

WEnd





Func add_row()
;*********************** 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
        
        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]

$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), 8+$bx, 22 + $box, 215, 49)
        GUICtrlSetResizing(-1, $GUI_DOCKALL)
        $Label_i[$Label_i[0]] = GUICtrlCreateLabel(GUICtrlRead($name), 80+$bx, 38 +$box, 120, 24)
        GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
        GUICtrlSetResizing(-1, $GUI_DOCKALL)     
        $Input_i[$Input_i[0]] = GUICtrlCreateProgress( 16+$bx, 38 + $box, 60, 21)
        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]] = GUICtrlCreateInput("", 175+$bx, 38 + $box, 40, 21, BitOR($ES_AUTOHSCROLL, $ES_READONLY))
        GUICtrlSetCursor(-1, 7)
        GUICtrlSetResizing(-1, $GUI_DOCKALL)
      GUICtrlSetBkColor(-1,0xFFFFFF) 
       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) = '10 Secs' then $timer_init[$timer_init[0]] = 10000
        if guictrlread($Combo3) = '15 Secs' then $timer_init[$timer_init[0]] = 15000
        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]] = 120*60000
        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  
$Forma2 = GUICreate("Command Edit", 417, 42, 498, 358, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
$Buttona1 = GUICtrlCreateButton("New Line", 280, 8, 57, 17, 0)
GUIctrlSetOnEvent(-1,"add_command")
GUICtrlSetResizing(-1, $GUI_DOCKALL)
$Buttona2 = GUICtrlCreateButton("Accept", 344, 8, 65, 17, 0)
GUICtrlSetResizing(-1, $GUI_DOCKALL)
GUICtrlSetOnEvent(-1,"Macro_accept")
GUISetState(@SW_SHOW)
EndIf

add_command()



Else
        MsgBox(0, "", "Boxes not set", 0)
    EndIf
Else
    MsgBox(0,"","Key Combination Found",0)
    EndIf
EndFunc  ;==>add_row

Func add_command()
$Ypos2 = WinGetPos("Command Edit")      
    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)

WinMove("Command Edit", '', $Ypos2[0], $Ypos2[1], $Ypos2[2], $Ypos2[3]+25,0)    

$b2y+=25

EndFunc



func time() 
For $d = 1 To $group_i[0]
if $t_start[$d]= true and $timer_init[$d] >=0 Then  
    if $timer_init[$d]>=500 Then
        $timer_init[$d] -=500
    
    GUICtrlSetData($Input_i[$d],100-($timer_init[$d]/$init[$d])*100)
    
    $time=$timer_init[$d]/1000
     $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],$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)
EndIf
EndIf   
    Next
EndFunc


func save()
for $a =1 to $group_i[0]
    IniWrite($IniFile,"section",$a-1,guictrlread($Label_i[$a])&"|"&$i_key_a[$a]&"|"&$i_key_b[$a]&"|"&$timer_init[$a])
Next
EndFunc

func load_settings()
$var_open = IniReadSection($IniFile, "section")
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
         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]
        
        

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, 8+$bx, 22 + $box, 215, 49)
        GUICtrlSetResizing(-1, $GUI_DOCKALL)
        $Label_i[$Label_i[0]] = GUICtrlCreateLabel($s_s[1], 80+$bx, 38 +$box, 120, 24)
        GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
        GUICtrlSetResizing(-1, $GUI_DOCKALL)     
        $Input_i[$Input_i[0]] = GUICtrlCreateProgress( 16+$bx, 38 + $box, 60, 21)
        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]] = GUICtrlCreateInput("", 175+$bx, 38 + $box, 40, 21, BitOR($ES_AUTOHSCROLL, $ES_READONLY))
        GUICtrlSetCursor(-1, 7)
        GUICtrlSetResizing(-1, $GUI_DOCKALL)
        GUICtrlSetBkColor(-1,0xFFFFFF) 
        
        $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
Next
    
    
EndFunc

func quit()
    save()
    Exit
    GUIDelete($Form1)
EndFunc

func Macro_accept()
EndFunc

Share this post


Link to post
Share on other sites
erezlevi

can you please explain where in the script is your problem ? it is too long try to make an example script of what isn't working for you.

Share this post


Link to post
Share on other sites
Aceguy

when i click my ADD button with the checkbox, (checked). it will bring up and editor for a macro, adding additional lines is ok, but i cant seems to work out how to capture what i have typed, and put it to an array when i click the ACCEPT button.?

hope this makes sense.

Edited by Aceguy

Share this post


Link to post
Share on other sites
Aceguy

refined it a bit, but still no joy, have marked the trouble area with

*******************

*******************

*******************

can get it to register the button click.

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

Opt("GUIOnEventMode", 1)


global $height

$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, "add_row")
GUICtrlSetResizing(-1, $GUI_DOCKALL)
$remove = GUICtrlCreateButton("Remove", 64, 8, 49, 25, 0)
GUICtrlSetResizing(-1, $GUI_DOCKALL)
$save = GUICtrlCreateButton("Save List", 120, 8, 57, 25, 0)
GUICtrlSetResizing(-1, $GUI_DOCKALL)
GUICtrlSetOnEvent(-1,"save")
$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|10 Secs|15 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, 105, 25)
GUICtrlSetResizing(-1, $GUI_DOCKALL)
$Label_target = GUICtrlCreateLabel("", 264, 40, 120, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetResizing(-1, $GUI_DOCKALL)

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]
$accept=0
$line=0
$b2y=0
$num=50
$bY = 0
$bx = 0
$alt=0
$ctrl=0
$box=0
$done=0
Dim $IniFile = @MyDocumentsDir & "\coutdown.ini"
$op = FileOpen($IniFile, 0)
If $op = -1 Then
    IniWrite($IniFile, "section", "0", "0")
Else
$iniread=IniRead($IniFile,"section",0,'')
if not $iniread= 0 Then
load_settings()
EndIf
EndIf
AdlibEnable("time",500)

GUISetState(@SW_SHOW)

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   
            
        
      EndIf
    Next
   if _IsPressed("09") then GUICtrlSetData($Label_target,"Target")
if _IsPressed("70") then GUICtrlSetData($Label_target,"ME")
if _IsPressed("71") then GUICtrlSetData($Label_target,"F2")
if _IsPressed("72") then GUICtrlSetData($Label_target,"F3")
if _IsPressed("73") then GUICtrlSetData($Label_target,"F4")
if _IsPressed("74") then GUICtrlSetData($Label_target,"F5")
if _IsPressed("75") then GUICtrlSetData($Label_target,"F6")
if _IsPressed("77") then GUICtrlSetData($Label_target,"Battle Target")
Sleep(500)

WEnd





Func add_row()
;*********************** 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
        
        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]

$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), 8+$bx, 22 + $box, 215, 49)
        GUICtrlSetResizing(-1, $GUI_DOCKALL)
        $Label_i[$Label_i[0]] = GUICtrlCreateLabel(GUICtrlRead($name), 80+$bx, 38 +$box, 120, 24)
        GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
        GUICtrlSetResizing(-1, $GUI_DOCKALL)     
        $Input_i[$Input_i[0]] = GUICtrlCreateProgress( 16+$bx, 38 + $box, 60, 21)
        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]] = GUICtrlCreateInput("", 175+$bx, 38 + $box, 40, 21, BitOR($ES_AUTOHSCROLL, $ES_READONLY))
        GUICtrlSetCursor(-1, 7)
        GUICtrlSetResizing(-1, $GUI_DOCKALL)
      GUICtrlSetBkColor(-1,0xFFFFFF) 
       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) = '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]] = 120*60000
        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  

$Form1b = GUICreate("Form1", 280, 269, 544, 359, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
$Input1 = GUICtrlCreateInput("", 8, 8, 185, 21)
$Input2 = GUICtrlCreateInput("", 8, 40, 185, 21)
$Input3 = GUICtrlCreateInput("", 8, 72, 185, 21)
$Input4 = GUICtrlCreateInput("", 8, 104, 185, 21)
$Input5 = GUICtrlCreateInput("", 8, 136, 185, 21)
$Input6 = GUICtrlCreateInput("", 8, 168, 185, 21)
$Input7 = GUICtrlCreateInput("", 8, 200, 185, 21)
$Input8 = GUICtrlCreateInput("", 8, 232, 185, 21)
$Button1 = GUICtrlCreateButton("Accept", 200, 8, 73, 17, 0)

GUISwitch($Form1b)
GUISetState(@SW_SHOW)
GUIGetMsg()
do
    $msg=GUIGetMsg()
    Select
        case $msg = $Button1
            ConsoleWrite("Buton1 clicked")
        EndSelect
until $accept=1




$string=GUICtrlRead($Input1)&"|"&GUICtrlRead($Input2)&"|"&GUICtrlRead($Input3)&"|"&GUICtrlRead($Input4)&"|"&GUICtrlRead($Input5)&"|"&GUICtrlRead($Input6)&"|"&GUICtrlRead($Input7)&"|"&GUICtrlRead($Input8)
MsgBox(0,"",$string,0)
    


EndIf
;***************************************************************************************************

***************
;***************************************************************************************************

***************
;***************************************************************************************************

***************
Else
        MsgBox(0, "", "Boxes not set", 0)
    EndIf
Else
    MsgBox(0,"","Key Combination Found",0)
    EndIf
EndFunc  ;==>add_row


func time() 
For $d = 1 To $group_i[0]
if $t_start[$d]= true and $timer_init[$d] >=0 Then  
    if $timer_init[$d]>=500 Then
        $timer_init[$d] -=500
    
    GUICtrlSetData($Input_i[$d],100-($timer_init[$d]/$init[$d])*100)
    
    $time=$timer_init[$d]/1000
     $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],$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)
EndIf
EndIf   
    Next
EndFunc


func save()
for $a =1 to $group_i[0]
    IniWrite($IniFile,"section",$a-1,guictrlread($Label_i[$a])&"|"&$i_key_a[$a]&"|"&$i_key_b[$a]&"|"&$timer_init[$a])
Next
EndFunc

func load_settings()
$var_open = IniReadSection($IniFile, "section")
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
         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]
        
        

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, 8+$bx, 22 + $box, 215, 49)
        GUICtrlSetResizing(-1, $GUI_DOCKALL)
        $Label_i[$Label_i[0]] = GUICtrlCreateLabel($s_s[1], 80+$bx, 38 +$box, 120, 24)
        GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
        GUICtrlSetResizing(-1, $GUI_DOCKALL)     
        $Input_i[$Input_i[0]] = GUICtrlCreateProgress( 16+$bx, 38 + $box, 60, 21)
        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]] = GUICtrlCreateInput("", 175+$bx, 38 + $box, 40, 21, BitOR($ES_AUTOHSCROLL, $ES_READONLY))
        GUICtrlSetCursor(-1, 7)
        GUICtrlSetResizing(-1, $GUI_DOCKALL)
        GUICtrlSetBkColor(-1,0xFFFFFF) 
        
        $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
Next
    
    
EndFunc

func quit()
    save()
    Exit
    GUIDelete($Form1)
EndFunc

func Accept()
if $accept=0 then $accept=1
ConsoleWrite("Accept clicked")
EndFunc
Edited by Aceguy

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.