Jump to content

If Döngüsünde Komut


ykd96
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

[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

Link to comment
Share on other sites

@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 by asmazh
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...