ykd96 Posted July 5, 2012 Share Posted July 5, 2012 Merhaba hocalarım ben if döngüsündeyken butonların işlemesini istiyorum ama malesef yapamıyorum. dahada açayım konuyu. $sart = 0 iken start butonuna tıklayınca $sart = 1 oluyor ve if döngüsü $sart = 1 olduğu için başlıyor. ben stop butonuna basınca $sart = 0 olmuyor ve çarpıya felan tıkladığımda bottan çıkamıyorum. bu sorunu nasıl giderebilirim? Quote Link to comment Share on other sites More sharing options...
blackman12 Posted July 5, 2012 Share Posted July 5, 2012 [code]Global $sart, $mesaj, $emesaj $form = GUICreate("pencere",300,200) $button1 = GUICtrlCreateButton("sartı sıfırla",10,10) $button2 = GUICtrlCreateButton("sartı aç",10,50) GUISetState() while 1 $msg = GUIGetMsg() Switch $msg Case -3 Exit Case $button1 $sart = 0 Case $button2 $sart = 1 EndSwitch if $sart Then $mesaj = "sart tamam" Else $mesaj = "sart sağlanamadı" EndIf if $emesaj <> $mesaj Then ToolTip($mesaj) $emesaj = $mesaj WEnd[/code] Quote Link to comment Share on other sites More sharing options...
ykd96 Posted July 5, 2012 Author Share Posted July 5, 2012 [quote name='blackman12' date='05 July 2012 - 17:56 ' timestamp='1341510962' post='1218990'] [code]Global $sart, $mesaj, $emesaj $form = GUICreate("pencere",300,200) $button1 = GUICtrlCreateButton("sartı sıfırla",10,10) $button2 = GUICtrlCreateButton("sartı aç",10,50) GUISetState() while 1 $msg = GUIGetMsg() Switch $msg Case -3 Exit Case $button1 $sart = 0 Case $button2 $sart = 1 EndSwitch if $sart Then $mesaj = "sart tamam" Else $mesaj = "sart sağlanamadı" EndIf if $emesaj <> $mesaj Then ToolTip($mesaj) $emesaj = $mesaj WEnd[/code] [/quote] pardon hocam tekrar bi sorum olucak. belirli bi komutu belirli zaman aralığında tekrarlatmak için ne kullanmam lazım örneğin $yonlen = _IENavigate($oIE,"www.google.com") 3 saniyede bir tekrarlanacak :/ kusra bakmayın meşgul ediyorum hocam senide Quote Link to comment Share on other sites More sharing options...
asmazh Posted July 6, 2012 Share Posted July 6, 2012 (edited) @ykd96 Sleep(3000) _IENavigate($oIE,"www.google.com") Fakat bu yöntem uyku sırasında programı işlevsiz bırakır. "TimerDiff", "TimerInit" komutlarını kullanabilirsin. Bunları öğrenmenin en güzel yolu: Autoit'in yardım klasörü. Blackman12'nin verdiği örneğin üzerine yapmak istediğin işlemin basit bir şeklini senin için hazırladım. [code] Global $sart, $mesaj, $emesaj $form = GUICreate("pencere",300,200) $button1 = GUICtrlCreateButton("sartı sıfırla",10,10) $button2 = GUICtrlCreateButton("sartı aç",10,50) GUISetState() $StartTime = 0 while 1 Local $diff = Int(TimerDiff($StartTime)) > 3000 If $diff = True Then ConsoleWrite("3 saniyede bir yapılmasını istediğin işlemi buraya gir." & @CRLF) $StartTime = TimerInit() EndIf $msg = GUIGetMsg() Switch $msg Case -3 Exit Case $button1 $sart = 0 Case $button2 $sart = 1 EndSwitch if $sart Then $mesaj = "sart tamam" Else $mesaj = "sart sağlanamadı" EndIf if $emesaj <> $mesaj Then ToolTip($mesaj) $emesaj = $mesaj WEnd[/code] Edited July 6, 2012 by asmazh Quote Link to comment Share on other sites More sharing options...
ykd96 Posted July 6, 2012 Author Share Posted July 6, 2012 teşekkürler verdiğin kodlar için. sleepteki işlevsizlikti sorunum ve timer diffi ve initi nasıl kullanacağımı bilmiyodum. verdiğiniz kodları inceliyeceğim teşekkürler 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.