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. ×

Timer Tipi Program


 Share

Recommended Posts

Benim istediğim şey bir alarm gibi ama değil. 20 dakikada bir kez beni uyaracak bir program istiyorum. Her 20 dakika senkronize şekilde uyarmalı. Böyle bir program varsa söyleyebilir misiniz? Yoksa yapılabilir mi? Kendim yapmak istesem hangi programlama dillerini ihtiyacım olur?

Link to comment
Share on other sites

_Sayac(0,10)

Func _Sayac($CountDown = 0,$Sayi = 15)
	Local $Son = $Sayi, $Yon = "Yönü Değiştir: Yukarı", $Varsayilan = $Sayi
	if not $CountDown Then $Yon = "Yönü Değiştir: Aşağı"
	if not $CountDown Then $Son = 0
	Local $TIMER_1[6] = [TimerInit(), 0, 0, $Son,True,$Varsayilan]

	Local $Form1 = GUICreate("Sayaç Örneği by BlueLife", 300, 170, -1, -1, 0x00080000)
	Local $ChangeCounter = GUICtrlCreateButton($Yon,5,20,200,25,0x0001)
	Local $Input = GUICtrlCreateInput("",215,18,60,Default,0x2000)
	GUICtrlSetLimit(-1,2)
	Local $Button1 = GUICtrlCreateButton($TIMER_1[3] & " Saniye", 5, 110, 285, 25, 0x0001)

	GUISetState(@SW_SHOW,$Form1)
	While 1
		$nMsg = GUIGetMsg() ;Guiden gelen mesajları algılamak için gerekli komut
		Switch $nMsg
			Case -3
				ExitLoop ;Döngüden çıkma komutu
			Case $Button1
				if $TIMER_1[4] Then
					$TIMER_1[4] = False
					GUICtrlSetData($Button1,"Durduruldu - ["&$TIMER_1[3]&"]")
				Else
					$TIMER_1[4] = True
				EndIf
			Case $ChangeCounter
				if $Yon = "Yönü Değiştir: Yukarı" Then
					$Yon = "Yönü Değiştir: Aşağı"
					$CountDown = 0
					if Number(GUICtrlRead($Input)) > 0 Then
						$Sayi = Number(GUICtrlRead($Input))
					Else
						$Sayi = $TIMER_1[5]
					EndIf
				Else
					$Yon = "Yönü Değiştir: Yukarı"
					$CountDown = 1
					$Sayi = 0
				EndIf
				GUICtrlSetData($ChangeCounter,$Yon)
		EndSwitch
		if $TIMER_1[4] Then
			If $CountDown And $TIMER_1[3] <= 0 Then ExitLoop ;Süre bitmişse döngüden çıkış yapıyoruz
			if not $CountDown And $TIMER_1[3] >= $Sayi Then ExitLoop
			$TIMER_1[1] = Round(TimerDiff($TIMER_1[0]) / 1000)
			If $TIMER_1[1] <> $TIMER_1[2] Then
				$TIMER_1[2] = $TIMER_1[1]
				if $CountDown Then $TIMER_1[3] -= 1;Bir azaltıyoruz
				if not $CountDown Then $TIMER_1[3] += 1;Bir azaltıyoruz
				GUICtrlSetData($Button1, $TIMER_1[3] & " Saniye") ;Bu komut ile butondaki yazıyı değiştiriyoruz
			EndIf
		EndIf
	WEnd
	GUIDelete($Form1)
EndFunc

Yıllar önce AutoIT'te yazdığım bir sayaç kodu basit bir değişiklikle istediğini yapabilirsin.

 

_Sayac(0,10) => Buradan süreyi belirleyebilirsin _Sayac(0,60*20) dersen mesela 20 dakika olur.

Bu satırın hemen altına da  Beep(500, 1000) gibi bir kod eklerseniz ses elde edersiniz.

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...