I have tryed every thing for some reason it won't read from ini ,and i want it to show what was last saved when gui laods
#include <GUIConstants.au3>
Opt("GUIOnEventMode", 1)
Global $Paused
HotKeySet("{PAUSE}", "Pause")
Dim $Skill_Slot1,$Skill_Slot2,$Skill_Slot3,$Skill_Delay1,$Skill_Delay2,$Skill_Delay3,$Buff_Delay1,$Buff_Delay2,$Buff_Delay3,$Buff_Slot1,$Buff_Slot2,$Buff_Slot3
Global $Main_Gui = GUICreate("Auto Sro", 218, 304, 193, 125)
WinSetOnTop($Main_Gui,"",1)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1Maximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore")
Global $Group1 = GUICtrlCreateGroup("Attack skills", 8, 8, 97, 145)
Global $Label1 = GUICtrlCreateLabel("Skill to use first", 16, 24, 74, 17)
Global $Combo1 = GUICtrlCreateCombo($Skill_Slot1, 24, 40, 57, 25)
GUICtrlSetData($Combo1, "1|2|3|4|5|6|7|8|9|0")
GUICtrlSetOnEvent($Combo1, "Combo1Change")
Global $Input1 = GUICtrlCreateInput($Skill_Delay1, 120, 40, 65, 21)
Global $Label2 = GUICtrlCreateLabel("Imbune", 32, 64, 39, 17)
Global $Combo2 = GUICtrlCreateCombo($Skill_Slot2, 24, 80, 57, 25)
GUICtrlSetData($Combo2, "1|2|3|4|5|6|7|8|9|0")
GUICtrlSetOnEvent($Combo2, "Combo2Change")
Global $Input2 = GUICtrlCreateInput($Skill_Delay2, 120, 80, 65, 21)
Global $Label3 = GUICtrlCreateLabel("Finish skill", 24, 104, 51, 17)
Global $Combo3 = GUICtrlCreateCombo($Skill_Slot3, 24, 120, 57, 25)
GUICtrlSetData($Combo3, "1|2|3|4|5|6|7|8|9|0")
GUICtrlSetOnEvent($Combo3, "Combo3Change")
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $Group2 = GUICtrlCreateGroup("Delay", 112, 8, 97, 145)
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $Input3 = GUICtrlCreateInput($Skill_Delay3, 120, 120, 65, 21)
GUICtrlSetOnEvent($Input3, "Input3Change")
Global $Group3 = GUICtrlCreateGroup("Buffs", 8, 160, 201, 89)
Global $Combo4 = GUICtrlCreateCombo($Buff_Slot1, 48, 176, 73, 25)
GUICtrlSetData($Buff, "1|2|3|4|5|6|7|8|9|0")
GUICtrlSetOnEvent($Buff, "Combo4Change")
Global $Input4 = GUICtrlCreateInput($Buff_Delay1, 128, 200, 65, 21)
GUICtrlSetOnEvent($Input4, "Input4Change")
Global $Combo5 = GUICtrlCreateCombo($Buff_Slot2, 48, 200, 73, 25)
GUICtrlSetData($Combo5, "1|2|3|4|5|6|7|8|9|0")
GUICtrlSetOnEvent($Combo5, "Combo5Change")
Global $Input5 = GUICtrlCreateInput($Buff_Delay2, 128, 176, 65, 21)
GUICtrlSetOnEvent($Input5, "Input5Change")
Global $Combo6 = GUICtrlCreateCombo($Buff_Slot3, 48, 224, 73, 25)
GUICtrlSetData($Combo6, "1|2|3|4|5|6|7|8|9|0")
GUICtrlSetOnEvent($Combo6, "Combo6Change")
Global $Input6 = GUICtrlCreateInput($Buff_Delay3, 128, 224, 65, 21)
GUICtrlSetOnEvent($Input6, "Input6Change")
Global $Combo7 = GUICtrlCreateCombo($FBar, 8, 192, 33, 17)
GUICtrlSetData($Combo5, "F2|F3|F4")
GUICtrlSetOnEvent($Combo6, "Combo7Change")
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $Button1 = GUICtrlCreateButton("Start", 120, 264, 75, 25, 0)
GUICtrlSetOnEvent($Button1, "Button1Click")
Global $Button2 = GUICtrlCreateButton("Save", 16, 264, 75, 25, 0)
GUISetState(@SW_SHOW)
While 1; main body of program, loop till condition met
Buff ()
Attk ()
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE; when the top right cancel button is pressed
Exit
Case $msg = $Button2Click; pressing the Save button
;Save combo's
$Skill_Slot1 = GUICtrlRead($Combo1)
$Skill_Slot2 = GUICtrlRead($Combo2)
$Skill_Slot3 = GUICtrlRead($Combo3)
$Buff_Slot4 = GUICtrlRead($Combo4)
$Buff_Slot5 = GUICtrlRead($Combo5)
$Buff_Slot6 = GUICtrlRead($Combo6)
;Save
$Skill_Delay1 = GUICtrlRead($Input1)
$Skill_Delay2 = GUICtrlRead($Input2)
$Skill_Delay3 = GUICtrlRead($Input3)
$Skill_Delay1 = GUICtrlRead($Input4)
$Skill_Delay2 = GUICtrlRead($Input5)
$Skill_Delay3 = GUICtrlRead($Input6)
Write()
ExitLoop
Exit
EndSelect
WEnd
;attack creature if selected,use skills selected if monster selcted
Func Attk ()
While 1
If PixelGetColor(712, 45)= 0xFFC6C6 Then
Sleep(100)
Send ($Skill_Slot1)
Sleep($Skill_Delay1 *1000)
EndIf
If PixelGetColor(675,45) = 0xFFC6C6 Then
Sleep(100)
Send ($Skill_Slot2)
Sleep($Skill_Delay2 *1000)
EndIf
If PixelGetColor(611, 45) = 0xFF7B7B Then
Sleep(100)
Send ($Skill_Slot2)
Sleep($Skill_Delay2 *1000)
EndIf
If PixelGetColor(566,45) = 0xFFC6C6 Then
Sleep(100)
Send ($Skill_Slot3)
Sleep($Skill_Delay3 *1000)
Endif
If pixelGetColor (557, 45) = 0x212321 Then
Sleep(100)
Send("g")
Sleep(500)
Send("g")
EndIf
WEnd
EndFunc
Func Button1Click()
GUISetState(@SW_Hide)
WinActivate("SRO_Client")
WinWaitActive("SRO_Client")
EndFunc
Func Write();save to file
;combo's
IniWrite("config.ini", "Skill Slots","Slot1",$Combo1)
IniWrite("config.ini", "Skill Slots","Slot2",$Combo2)
IniWrite("config.ini", "Skill Slots","Slot3",$Combo3)
IniWrite("config.ini", "Buff Slots","Slot4",$Combo4)
IniWrite("config.ini", "Buff Slots","Slot5",$Combo5)
IniWrite("config.ini", "Buff Slots","Slot6",$Combo6)
;Inputs
IniWrite("config.ini", "Skill Delay","Delay1",$Input1)
IniWrite("config.ini", "Skill Delay","Delay2",$Input2)
IniWrite("config.ini", "Skill Delay","Delay3",$Input3)
IniWrite("config.ini", "Buff Delay","Delay4",$Input4)
IniWrite("config.ini", "Buff Delay","Delay5",$Input5)
IniWrite("config.ini", "Buff Delay","Delay6",$Input6)
EndFunc
Func ReadIni();read from file
;Skills
$Skill_Slot1 = IniRead("Config.ini","Skill Slots","Slot1","")
$Skill_Slot2 = IniRead("Config.ini","Skill Slots","Slot2","")
$Skill_Slot3 = IniRead("Config.ini","Skill Slots","Slot3","")
$Skill_Delay1 = IniRead("config.ini", "Skill Delay", "Delay1", "")
$Skill_Delay2 = IniRead("config.ini", "Skill Delay", "Delay2", "")
$Skill_Delay3 = IniRead("config.ini", "Skill Delay", "Delay3", "")
;Buffs
$Buff_Delay1 = IniRead("config.ini", "Buff Delay", "Delay4", "")
$Buff_Delay2 = IniRead("config.ini", "Buff Delay", "Delay5", "")
$Buff_Delay3 = IniRead("config.ini", "Buff Delay", "Delay6", "")
$Buff_Slot1 = IniRead("Config.ini","Buff Slots","Slot1","")
$Buff_Slot2 = IniRead("Config.ini","Buff Slots","Slot2","")
$Buff_Slot3 = IniRead("Config.ini","Buff Slots","Slot3","")
EndFunc
;not shure how to subtract vars.......
Func Buff ()
$Buff1 = $Buff_Delay1
$Buff2 = $Buff_Delay2 - $Buff_Delay1
$Buff3 = $Buff_Delay3 - $Buff_Delay2 - $Buff_Delay1
While 1
Sleep ($Buff1*1000)
Send($Buff_Slot1)
Sleep ($Buff2*1000)
Send($Buff_Slot2)
Sleep ($Buff3*1000)
Send($Buff_Slot3)
WEnd
EndFunc
Func Pause();well duh pause script
$Paused = Not $Paused
While $Paused
Sleep(100)
WEnd
EndFunc