Jump to content
Son zamanlarda artan kullanıcı hesap hırsızlıkları sebebiyle tüm kullanıcılara şifre sıfırlama maili gönderilmiştir. Lütfen güveli şifreler seçiniz. Mevcut e-mail adresinize erişemiyorsanız, en aşağıdaki destek linkinden bize ulaşınız. ×

Checkbox Ve Imputbox Ile Ilgili Bir Kaç Sorun


dequeen
 Share

Recommended Posts

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 by dequeen
Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Administrator

[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]

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Administrator

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]

Link to comment
Share on other sites

#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
WEnd

benim şu basit kodları öğrenebileceğim bi kaynak mevcutmudur? acaba

benim şu basit kodları öğrenebileceğim bi kaynak mevcutmudur? acaba

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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ı

Link to comment
Share on other sites

@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 by blue_life
Link to comment
Share on other sites

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

Link to comment
Share on other sites

[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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...