dequeen Posted April 6, 2011 Share Posted April 6, 2011 (edited) [codebox]Global $ekrem = False Global $zaman1, $zaman_1 Global $zaman2, $zaman_2 Global $zaman3, $zaman_3 Global $zaman4, $zaman_4 Global $zaman5, $zaman_5 Global $zaman6, $zaman_6 Global $zaman7, $zaman_7 Global $zaman8, $zaman_8 Global $zaman9, $zaman_9 Opt("GUIOnEventMode", 1) $Form1_1 = GUICreate("deneme1", 211, 256, -1, -1) GUISetOnEvent(-3,"_kapat") $Checkbox1 = GUICtrlCreateCheckbox("", 10, 26, 15, 21) GUICtrlSetState(-1, 0) $Checkbox2 = GUICtrlCreateCheckbox("", 10, 51, 15, 21) GUICtrlSetState(-1, 0) $Checkbox3 = GUICtrlCreateCheckbox("", 10, 76, 15, 21) GUICtrlSetState(-1, 0) $Checkbox4 = GUICtrlCreateCheckbox("", 10, 101, 15, 21) GUICtrlSetState(-1, 0) $Checkbox5 = GUICtrlCreateCheckbox("", 10, 126, 15, 21) GUICtrlSetState(-1, 0) $Checkbox6 = GUICtrlCreateCheckbox("", 10, 151, 15, 21) GUICtrlSetState(-1, 0) $Checkbox7 = GUICtrlCreateCheckbox("", 10, 176, 15, 21) GUICtrlSetState(-1, 0) $Checkbox8 = GUICtrlCreateCheckbox("", 10, 201, 15, 21) GUICtrlSetState(-1, 0) $Checkbox9 = GUICtrlCreateCheckbox("", 10, 226, 15, 21) GUICtrlSetState(-1, 0) $Input1 = GUICtrlCreateInput("", 38, 26, 33, 21) $Input2 = GUICtrlCreateInput("", 78, 26, 33, 21) $Input3 = GUICtrlCreateInput("", 38, 51, 33, 21) $Input4 = GUICtrlCreateInput("", 78, 51, 33, 21) $Input5 = GUICtrlCreateInput("", 38, 76, 33, 21) $Input6 = GUICtrlCreateInput("", 78, 76, 33, 21) $Input7 = GUICtrlCreateInput("", 38, 101, 33, 21) $Input8 = GUICtrlCreateInput("", 78, 101, 33, 21) $Input9 = GUICtrlCreateInput("", 38, 126, 33, 21) $Input10 = GUICtrlCreateInput("", 78, 126, 33, 21) $Input11 = GUICtrlCreateInput("", 38, 151, 33, 21) $Input12 = GUICtrlCreateInput("", 78, 151, 33, 21) $Input13 = GUICtrlCreateInput("", 38, 176, 33, 21) $Input14 = GUICtrlCreateInput("", 78, 176, 33, 21) $Input15 = GUICtrlCreateInput("", 38, 201, 33, 21) $Input16 = GUICtrlCreateInput("", 78, 201, 33, 21) $Input17 = GUICtrlCreateInput("", 38, 226, 33, 21) $Label1 = GUICtrlCreateLabel("tab tuşu", 78, 231, 51, 17) GUICtrlSetFont(-1, 8, 400, 0) $Label2 = GUICtrlCreateLabel("süre", 38, 15, 28, 10) GUICtrlSetFont(-1, 8, 400, 0) $Label3 = GUICtrlCreateLabel("tus", 78, 15, 21, 10) GUICtrlSetFont(-1, 8, 400, 0) $Label4 = GUICtrlCreateLabel("",120,88,70,17) GUICtrlSetFont(-1, 8, 400, 0) $Button1 = GUICtrlCreateButton("start", 120, 24, 75, 25) GUICtrlSetOnEvent($Button1,"_start_stop") $Button2 = GUICtrlCreateButton("test", 120, 56, 75, 25) GUISetState(@SW_SHOW) Func _kapat() Exit EndFunc Func _start_stop() $ekrem = Not $ekrem If $ekrem = True Then GUICtrlSetData($Button1,"stop") GUICtrlSetData($Label4,"AÇIK") If GUICtrlRead($Checkbox1) = 1 Then $zaman_1 = GUICtrlRead($Input1) Else $zaman_1 = 0 EndIf If GUICtrlRead($Checkbox2) = 1 Then $zaman_2 = GUICtrlRead($Input3) Else $zaman_2 = 0 EndIf If GUICtrlRead($Checkbox3) = 1 Then $zaman_3 = GUICtrlRead($Input5) Else $zaman_3 = 0 EndIf If GUICtrlRead($Checkbox4) = 1 Then $zaman_4 = GUICtrlRead($Input7) Else $zaman_4 = 0 EndIf If GUICtrlRead($Checkbox5) = 1 Then $zaman_5 = GUICtrlRead($Input9) Else $zaman_5 = 0 EndIf If GUICtrlRead($Checkbox6) = 1 Then $zaman_6 = GUICtrlRead($Input11) Else $zaman_6 = 0 EndIf If GUICtrlRead($Checkbox7) = 1 Then $zaman_7 = GUICtrlRead($Input13) Else $zaman_7 = 0 EndIf If GUICtrlRead($Checkbox8) = 1 Then $zaman_8 = GUICtrlRead($Input15) Else $zaman_8 = 0 EndIf If GUICtrlRead($Checkbox9) = 1 Then $zaman_9 = GUICtrlRead($Input17) Else $zaman_9 = 0 EndIf Else GUICtrlSetData($Button1,"start") GUICtrlSetData($Label4,"KAPALI") EndIf EndFunc While 1 If GUICtrlRead($Checkbox1) = 1 Then GUICtrlSetState($Input1,64) GUICtrlSetState($Input2,64) Else GUICtrlSetState($Input1,128) GUICtrlSetState($Input2,128) EndIf If GUICtrlRead($Checkbox2) = 1 Then GUICtrlSetState($Input3,64) GUICtrlSetState($Input4,64) Else GUICtrlSetState($Input3,128) GUICtrlSetState($Input4,128) EndIf If GUICtrlRead($Checkbox3) = 1 Then GUICtrlSetState($Input5,64) GUICtrlSetState($Input6,64) Else GUICtrlSetState($Input5,128) GUICtrlSetState($Input6,128) EndIf If GUICtrlRead($Checkbox4) = 1 Then GUICtrlSetState($Input7,64) GUICtrlSetState($Input8,64) Else GUICtrlSetState($Input7,128) GUICtrlSetState($Input8,128) EndIf If GUICtrlRead($Checkbox5) = 1 Then GUICtrlSetState($Input9,64) GUICtrlSetState($Input10,64) Else GUICtrlSetState($Input9,128) GUICtrlSetState($Input10,128) EndIf If GUICtrlRead($Checkbox6) = 1 Then GUICtrlSetState($Input11,64) GUICtrlSetState($Input12,64) Else GUICtrlSetState($Input11,128) GUICtrlSetState($Input12,128) EndIf If GUICtrlRead($Checkbox7) = 1 Then GUICtrlSetState($Input13,64) GUICtrlSetState($Input14,64) Else GUICtrlSetState($Input13,128) GUICtrlSetState($Input14,128) EndIf If GUICtrlRead($Checkbox8) = 1 Then GUICtrlSetState($Input15,64) GUICtrlSetState($Input16,64) Else GUICtrlSetState($Input15,128) GUICtrlSetState($Input16,128) EndIf If GUICtrlRead($Checkbox9) = 1 Then GUICtrlSetState($Input17,64) Else GUICtrlSetState($Input17,128) EndIf If $ekrem = True Then If $zaman_1 > 0 Then $zaman1 += 100 If $zaman1 >= ($zaman_1 * 1000) Then Send(GUICtrlRead($Input2)) $zaman1 = 0 EndIf EndIf If $zaman_2 > 0 Then $zaman2 += 100 If $zaman2 >= ($zaman_2 * 1000) Then Send(GUICtrlRead($Input4)) $zaman2 = 0 EndIf EndIf If $zaman_3 > 0 Then $zaman3 += 100 If $zaman3 >= ($zaman_3 * 1000) Then Send(GUICtrlRead($Input6)) $zaman3 = 0 EndIf EndIf If $zaman_4 > 0 Then $zaman4 += 100 If $zaman4 >= ($zaman_4 * 1000) Then Send(GUICtrlRead($Input8)) $zaman4 = 0 EndIf EndIf If $zaman_5 > 0 Then $zaman5 += 100 If $zaman5 >= ($zaman_5 * 1000) Then Send(GUICtrlRead($Input10)) $zaman5 = 0 EndIf EndIf If $zaman_6 > 0 Then $zaman6 += 100 If $zaman6 >= ($zaman_6 * 1000) Then Send(GUICtrlRead($Input12)) $zaman6 = 0 EndIf EndIf If $zaman_7 > 0 Then $zaman7 += 100 If $zaman7 >= ($zaman_7 * 1000) Then Send(GUICtrlRead($Input14)) $zaman7 = 0 EndIf EndIf If $zaman_8 > 0 Then $zaman8 += 100 If $zaman8 >= ($zaman_8 * 1000) Then Send(GUICtrlRead($Input16)) $zaman8 = 0 EndIf EndIf If $zaman_9 > 0 Then $zaman9 += 100 If $zaman9 >= ($zaman_9 * 1000) Then Send("{tab}") $zaman9 = 0 EndIf EndIf EndIf Sleep(100) WEnd[/codebox] lütfen yanlış yaptığım yerleri söyleyiniz 2 günlük autoit kullanıcısıyım yorumlarınızı bekliyorum Edited April 6, 2011 by dequeen Quote Link to comment Share on other sites More sharing options...
SimpsoN_Bart Posted April 6, 2011 Share Posted April 6, 2011 (edited) Örneğin hiç bir seçim yapılmadan test tuşuna basılırsa hata mesajı verebilirsin.Birde kodlar biraz uzun geldi bana if else yi fazla kullanmışsın dizi olarak kullansan kodlar daha kısa olur.GUICtrlRead ı kullanırken tek tek if ile değilde for döngüsyle kontrollerini döngüye sokarsan da kodların daha kısalmıs olur benden bu kadar uzman arkdaslar yardımıcı olur sana. Edited April 6, 2011 by SimpsoN_Bart Quote Link to comment Share on other sites More sharing options...
dequeen Posted April 6, 2011 Author Share Posted April 6, 2011 (edited) test tuşu zaten aktif değil şuan program esc ile kapanıyor onu önlemek için test tuşunu exit yaptım basıldığında prog kapanacak evet kodlar uzun ama anlaşılır acemiyim daha teşekkür ederim yorumların için kodlar uzun olsa bi sıkıtn olmaz yani uzun olsun temiz olsun for döngüsünü araştırıyorum şuan eğer becerebileceğim bişeyse deneyecem Edited April 6, 2011 by dequeen Quote Link to comment Share on other sites More sharing options...
SimpsoN_Bart Posted April 6, 2011 Share Posted April 6, 2011 (edited) Kodların uzun olması zamanını harcar ondan demiştim ben.Böyle ufak program için uzun geldi bana o kadar Ama emek vermişsin saygı duymak gerekir. Sana tavsiyem kullancağın programlar yaz yani bilgisayarda yararlı olabilecek konularda geliştir kendini böylece hem kendini geliştirmiş olursun hemde kendine ve foruma bi katkın olmuş olur Misal kayıt girdileriyle ilgili bilgisayar sorunlarını çözme ile ilgili bilgisayar hakkında bilgi veren programlar yazabilirsin biraz hayalgücü biraz azim seni zirveye taşır yeter ki uğraş. mesale ben gecen konu actım geçen resim düzenlemeyle ilgili blackman12 dostumuz saolunsun yardımcı oldu şimdi onu geliştiriyorum ama şunu söyliyim senın kodların kadar uzamadı help dosyasında çok güzel örnekler var oraya bak derim ufak şeylerle çok güzel programlar yazıabilir bence neyse kolay gelsin..Başarılar dilerim Edited April 6, 2011 by SimpsoN_Bart Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.