dequeen Posted April 3, 2011 Share Posted April 3, 2011 (edited) merhaba öncelikle autoit e yeni başladım şimdi sizden istediğim şudur aşağıda vermiş olduğum koddaki #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 625, 133, 192, 124) $Input1 = GUICtrlCreateInput("Input1", 72, 0, 49, 21) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 0, 0, 73, 25) $Input2 = GUICtrlCreateInput("Input2", 128, 0, 41, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd yani bu koddaki checkbox1 e tıklandığı zaman imput1 de yazılı olan tuş a imput2 deki saniye arayla bassın yada şöyle diyelim checkbox a bir tuş atıyalım imput1 ede o tuşa kaç sn yada milisaniye arayla basmak istediğimi gireyim bu visual basicde mümkündü onda timer falan vardı yapıyodum ama autoitde çok yeniyim hiç bişey bilmiyorum Edited April 3, 2011 by dequeen Quote Link to comment Share on other sites More sharing options...
dequeen Posted April 3, 2011 Author Share Posted April 3, 2011 yada şöyle yapabiliriz bir tane checkbox a istediğimiz bir tuşu atadık sonra yanına checkbox lardan 1dk 2dk 10sn 5sn gibi seçenekler koyabiliriz azcık anlayabilsem neler var aklımdada yapamıyorum bi yol gösterin teşekkür ederim herkeze Quote Link to comment Share on other sites More sharing options...
Administrator sk8er_boi Posted April 3, 2011 Administrator Share Posted April 3, 2011 [warning][color=#FF0000][b]DİKKAT: Konu Başlığını forum Kurallarına gore yeniden düzenleyiniz. Aksi halde cope tasınacaktır. [topic=872]Forum Kuralları[/topic] - [ Madde 10-16 ]Konu düzenlenene kadar yazılan tüm iletiler silinecektir.[/b][/color][/warning] Quote Link to comment Share on other sites More sharing options...
dequeen Posted April 3, 2011 Author Share Posted April 3, 2011 ne yapsam olmadı mesela şu nerde yanlışım if $checkbox1(true) sleep(1000) send("1") endif yani şunu demek istiyorum checkbox1 işaratlendiğinde 1sn arayla 1 tuşuna bassın If $Checkbox1 = True MsgBox(0,"deneme","deneme") EndIf nerde hata yapıyor olabilirim anlayamadım daha Quote Link to comment Share on other sites More sharing options...
Administrator sk8er_boi Posted April 3, 2011 Administrator Share Posted April 3, 2011 GUICtrlCreateCheckbox, oluşturduğu kontrolün id'sini gönderir. Kontrolün değerini GUICtrlRead ile okumalısın. [code] #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 625, 133, 192, 124) $Input1 = GUICtrlCreateInput("Input1", 72, 0, 49, 21) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 0, 0, 73, 25) $Input2 = GUICtrlCreateInput("Input2", 128, 0, 41, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1=1 $vStatus = GUICtrlRead( $Checkbox1) If $vStatus = 1 Then Send("1") Sleep(1000) EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd [/code] Quote Link to comment Share on other sites More sharing options...
dequeen Posted April 3, 2011 Author Share Posted April 3, 2011 tamam olmuş eline sağlık peki ben send("1") yazan kısıma send($imput1) yazdığımda programı açtıkdan sonra imput kısmına yazdığım şeyleri yazması gerekmezmi? Quote Link to comment Share on other sites More sharing options...
Administrator sk8er_boi Posted April 3, 2011 Administrator Share Posted April 3, 2011 İlk satırda yazdığımı oku. Send(GuiCtrlRead($input1)) yazmalısın. Quote Link to comment Share on other sites More sharing options...
dequeen Posted April 3, 2011 Author Share Posted April 3, 2011 dediğini yazdığımda checkbox a tıklandığında program kapanıyor neyse artık visual basic de deniycem yada adam gibi öğrenmem laızm şu işi Quote Link to comment Share on other sites More sharing options...
Administrator sk8er_boi Posted April 3, 2011 Administrator Share Posted April 3, 2011 Ne yazdığını görelim. Quote Link to comment Share on other sites More sharing options...
dequeen Posted April 3, 2011 Author Share Posted April 3, 2011 #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 625, 133, 192, 124) $Input1 = GUICtrlCreateInput("Input1", 72, 0, 49, 21) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 0, 0, 73, 25) $Input2 = GUICtrlCreateInput("Input2", 128, 0, 41, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1=1 $vStatus = GUICtrlRead( $Checkbox1) If $vStatus = 1 Then Send(GUICtrlRead($Imput1)) Sleep(1000) EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEndbenim şu basit kodları öğrenebileceğim bi kaynak mevcutmudur? acababenim şu basit kodları öğrenebileceğim bi kaynak mevcutmudur? acaba Quote Link to comment Share on other sites More sharing options...
Administrator sk8er_boi Posted April 3, 2011 Administrator Share Posted April 3, 2011 Ehhh... Imput1 yazmışsın. Checkbox'a tıklayınca imput1 diye bir değişken olmadığını söyleyip hata veriyor. Quote Link to comment Share on other sites More sharing options...
dequeen Posted April 3, 2011 Author Share Posted April 3, 2011 bak şimdi bişey yazdım bundan çok eminim #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 625, 443, 192, 124) $Label1 = GUICtrlCreateLabel("", 0, 0, 620, 60) $Button1 = GUICtrlCreateButton("Button1", 0, 64, 75, 25, $WS_GROUP) GUICtrlSetOnEvent($Button1, "butonabas1") $Button2 = GUICtrlCreateButton("Button2", 72, 64, 75, 25, $WS_GROUP) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Dim $mesaj = "deneme" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func butonabas1() GUICtrlSetData($Label1,$mesaj) EndFunc bu kodda buton1 e basdığımda label1 e deneme yazması gerekmiyormu? yavaş yavaş ilerlemeye çalışıyorum Quote Link to comment Share on other sites More sharing options...
Administrator sk8er_boi Posted April 3, 2011 Administrator Share Posted April 3, 2011 Kodun başına [code]Opt("GUIOnEventMode", 1) [/code] ekle. Yardım dökümanı çok faydalı bir kaynak. Quote Link to comment Share on other sites More sharing options...
dequeen Posted April 4, 2011 Author Share Posted April 4, 2011 yardımlarıniçin çok teşekkür ederim mantığı çözdüm şimdi sorun biraz daha karışık $tus1 = GUICtrlRead($Checkbox1) If $tus1 = 1 Then Send("1") Sleep(GUICtrlRead($Input1)) EndIf bu kod ile checkbox1 e tıklandığında imput1 e girilmiş olan değeri sleep e aktarıp o aralıklarla tuşa basıyor sorunda burda başlıyor imput1 e 1000 yazınca 1sn 2000 2sn oluyoda bense şöyle düşündüm kullanıcı imput1 e 1 yazdığında 1 olan değerin sonuna ya 3 tane 000 eklesin 1000 olsun yada +999 ekleyip 1000 olsun her türlü 1000 olsun ama kullanıcı 50sn istediğinde 14950 yazması zor olurda 3 tane 000 eklemek daha kolay gibi geldi bana imput1 e ne yazılırsa yazılsın sonuna 000 eklemek istiyorum While 1 = 1 $tus1 = GUICtrlRead($Checkbox1) If $tus1 = 1 Then Send("1") Sleep(GUICtrlRead($Input1)) EndIf $tus2 = GUICtrlRead($Checkbox2) If $tus2 = 1 Then Send("e") Sleep(GUICtrlRead($Input2)) EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd birde bud kodda 2 tuşunda ayrı değeri olmuyor mesela 1 tanesini örüyor 1sn de bir 2 tuşada basıyor halbuki 1 tuşuna 1sn aralıkla e tuşuna 10 sn aralığında basmak istiyorum nasıl ayırabilirim ben bu tuşları Quote Link to comment Share on other sites More sharing options...
blue_life Posted April 4, 2011 Share Posted April 4, 2011 (edited) @dequeen Biraz kurcala... [codebox]Global $Start = False Global $TIME1, $TIME1_R Global $TIME2, $TIME2_R Opt("GUIOnEventMode", 1) Global $Form1 = GUICreate("Form1", 461, 270) GUISetOnEvent(-3, "_EXIT") Global $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 8, 10, 105, 25) GUICtrlSetState($Checkbox1, 1) Global $Input1 = GUICtrlCreateInput("1", 128, 10, 121, 21, 0x2000) GUICtrlCreateUpdown($Input1) Global $Input2 = GUICtrlCreateInput("a", 280, 10, 121, 21) Global $Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 8, 30, 105, 25) GUICtrlSetState($Checkbox2, 1) Global $Input3 = GUICtrlCreateInput("2", 128, 30, 121, 21, 0x2000) GUICtrlCreateUpdown($Input3) Global $Input4 = GUICtrlCreateInput("e", 280, 30, 121, 21) Global $Button1 = GUICtrlCreateButton("Başlat", 16, 160, 225, 41) GUICtrlSetOnEvent(-1, "_Start_Stop") Global $Test = GUICtrlCreateInput("", 10, 220, 300, 25) GUISetState(@SW_SHOW) While 1 If $Start = True Then If $TIME1_R > 0 Then $TIME1 += 100 If $TIME1 >= ($TIME1_R * 1000) Then Send(GUICtrlRead($Input2)) $TIME1 = 0 EndIf EndIf If $TIME2_R > 0 Then $TIME2 += 100 If $TIME2 >= ($TIME2_R * 1000) Then Send(GUICtrlRead($Input4)) $TIME2 = 0 EndIf EndIf EndIf Sleep(100) ;Cpu save WEnd Func _Start_Stop() $Start = Not $Start If $Start = True Then GUICtrlSetData($Button1, "Durdur") If GUICtrlRead($Checkbox1) = 1 Then $TIME1_R = GUICtrlRead($Input1) Else $TIME1_R = 0 EndIf If GUICtrlRead($Checkbox2) = 1 Then $TIME2_R = GUICtrlRead($Input3) Else $TIME2_R = 0 EndIf ; Test-------- GUICtrlSetData($Test, "") GUICtrlSetState($Test, 256) ;--------------- Else GUICtrlSetData($Button1, "Başlat") EndIf EndFunc ;==>_Start_Stop Func _EXIT() Exit EndFunc ;==>_EXIT[/codebox] Edited April 4, 2011 by blue_life Quote Link to comment Share on other sites More sharing options...
blackman12 Posted April 4, 2011 Share Posted April 4, 2011 O zaman [code]$tus1 = GUICtrlRead($Checkbox1) If $tus1 = 1 Then Send("1") Sleep(1000*Number(GUICtrlRead($Input1))) EndIf[/code] yaparsın olur biter. Eğer iki tuşu birden yapıcaksan timerdiff ile yapman gerek. Şu anda yanımda autoit yok tam kod veremiyorum maalesef. Yardım dosyasında timerdiff ile ilgili örneğe bak Quote Link to comment Share on other sites More sharing options...
dequeen Posted April 4, 2011 Author Share Posted April 4, 2011 [quote name='blackman12' date='04 April 2011 - 08:03 ' timestamp='1301904234' post='987360'] O zaman [code]$tus1 = GUICtrlRead($Checkbox1) If $tus1 = 1 Then Send("1") Sleep(1000*Number(GUICtrlRead($Input1))) EndIf[/code] yaparsın olur biter. Eğer iki tuşu birden yapıcaksan timerdiff ile yapman gerek. Şu anda yanımda autoit yok tam kod veremiyorum maalesef. Yardım dosyasında timerdiff ile ilgili örneğe bak [/quote] teşekkür ederim anladığım yazılan değeri 1000 ile çarpıyo hiç böyle düşünmemiştim gece 3 te saol şimdi geriye timerdiff dediğin şeyi becerebilmek gerekiyor Quote Link to comment Share on other sites More sharing options...
dequeen Posted April 4, 2011 Author Share Posted April 4, 2011 blue_life ellerine sağlık tamda istediğim şey gibi görünüyor yaptığın şey kurcalamam laızm o kodları aradığım herşey senin yazdıklarında büyük ihtimal Quote Link to comment Share on other sites More sharing options...
dequeen Posted April 4, 2011 Author Share Posted April 4, 2011 While 1 $tus1 = GUICtrlRead($Checkbox1) If $tus1 = 1 Then Send("1") $once1 = TimerInit() Sleep(1000*Number(GUICtrlRead($Input1))) $sonra1 = TimerDiff($once1) EndIf $tus2 = GUICtrlRead($Checkbox2) If $tus2 = 1 Then Send("2") $once2 = TimerInit() Sleep(1000*Number(GUICtrlRead($Input2))) $sonra2 = TimerDiff($once2) EndIf şu kod ile while 1 = 1 e gerek kalmadan checkbox işaretlendiğinde basmalarını sayladım ama yine 2 sinide bağımsız yapamadım devam ediyorum fikirlerinizi bekliyorum 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.