Sign in to follow this  
Followers 0
sebsabul

While...Wend

7 posts in this topic

#1 ·  Posted (edited)

Hey guys. I´ve got another problem. I need some help:

This is my source:

#include <GUIConstants.au3>

$InfoGui = GUICreate("Info", 900, 500)
$textlabel = GUICtrlCreateLabel ("", 5, 5, 895, 150)
$textlabel2 = GUICtrlCreateLabel ("", 5, 170, 895, 150)
$textlabel3 = GUICtrlCreateLabel ("", 5, 340, 895, 150)
GUISetState (@SW_SHOW) 

local $info = 0
local $wait = 1000
local $timer = 0

While 1
   $msg = GUIGetMsg()
   If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

While 1
   $timer = $timer + 1
   If $timer = 60 Then $info = 0
   If $timer = 60 then $timer = 0
   sleep($wait)
Wend


While 1
   WinWait("Nachrichtendienst", "")
   If WinWait("Nachrichtendienst", "") then
      $info = $info + 1
      $text = WinGetText("Nachrichtendienst")
      ControlSetText($InfoGui, "", $textlabel, $text)
      winclose("Nachrichtendienst")
   endif
   If $info = 10 then
      Run("net send 192.168.0.3 Der Nachrichtendienst wir auf Grund eines Angriffs beendet.")
      Run("net stop nachrichtendienst")
      $info = 0
   endif

   WinWait("Nachrichtendienst", "")
   If WinWait("Nachrichtendienst", "") then
      $info = $info + 1
      $text = WinGetText("Nachrichtendienst")
      ControlSetText($InfoGui, "", $textlabel2, $text)
      winclose("Nachrichtendienst")
   endif
   If $info = 10 then
      Run("net send 192.168.0.3 Der Nachrichtendienst wir auf Grund eines Angriffs beendet.")
      Run("net stop nachrichtendienst")
      $info = 0
   endif

   WinWait("Nachrichtendienst", "")
   If WinWait("Nachrichtendienst", "") then
      $info = $info + 1
      $text = WinGetText("Nachrichtendienst")
      ControlSetText($InfoGui, "", $textlabel3, $text)
      winclose("Nachrichtendienst")
   endif
   If $info = 10 then
      Run("net send 192.168.0.3 Der Nachrichtendienst wir auf Grund eines Angriffs beendet.")
      Run("net stop nachrichtendienst")
      $info = 0
   endif
Wend

-----------------------

In my source are 3 Loops (While.. Wend). How can these loops execute parallel?

Not in succession! Thank you for help.

Edited by Larry

Share this post


Link to post
Share on other sites



In my source are 3 Loops (While.. Wend). How can these loops execute parallel?

Not in succession! Thank you for help.

<{POST_SNAPBACK}>

This question doesn't make much sense to me..

Your last 2 loops have both statements that make the script wait like Sleep() and WinWait().....

You can have a Adlib function kicking in at a defined interval... maybe thats is what you are looking for.....


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Thanks, but I don´t understand the ADLIB Function.

My Problem is: (in my script): The 3. Loop(e.g with WinWait) should execute, while the 2. loop (the timer /60sec) executes. Viz the timer should run, while the other works. Did ypu understand me.

PLEASE HELP ME!!!

Share this post


Link to post
Share on other sites

please!!

Share this post


Link to post
Share on other sites

How, I don´t anderstand it in the help file: Please help! Thank you !

Share this post


Link to post
Share on other sites

I finished it alone! Thanks for your help!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0