Jump to content

if-while problem controls


Recommended Posts

hello, they are new... I have a problem with this script... as I make to integrate the while with the if? that is to make so that the demand for the password nn comes demanded in infinite but the continuous winclose... excused for my English use babelfish they are Italian

#include <GUIConstants.au3>
 #NoTrayIcon
 #Region ### START Koda GUI section ### Form=
 $Form1 = GUICreate("Tech-Filter       v 0.2", 253, 131, 278, 571)
 GUISetIcon("favicon.ico")
 $Button1 = GUICtrlCreateButton("Avvia", 8, 16, 105, 41, 0)
 $Button2 = GUICtrlCreateButton("Exit", 13, 69, 97, 41, 0)
 $Label1 = GUICtrlCreateLabel("www.newstech.org", 120, 16, 129, 20)
 GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
 $Label2 = GUICtrlCreateLabel("Code By Wh1t3", 136, 40, 92, 17)
 GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
 GUISetState(@SW_SHOW)
 #EndRegion ### END Koda GUI section ###
 Global $Filter[2] = ["porno", "sexy"]
 If ProcessExists("TaskMgr.exe") Then ProcessClose("TaskMgr.exe")
 Opt("WinTitleMatchMode", 2) 
 Global $Log = @WindowsDir & "\Log.txt"
 While 1
 $nMsg = GUIGetMsg()
 Switch $nMsg
 Case $GUI_EVENT_CLOSE
 Exit
 Case $Button1
 MsgBox(0,"", "Filtro Attivato")
 $Password = InputBox("Tech-Filter", "Digitare password:", "", "*M")
 If @error Then Exit
 _FileWriteLog($Log, "Password " & $Password)
 if while 1 WinClose($Filter, "") Wend then 
  $AskForPassword = InputBox("EhEh...", "EHEH... Non è cosi semplice...password please:", "", "*M")
             If $AskForPassword = $Password Then
                 $PID = ProcessExists("filtro.exe") 
 If $PID Then ProcessClose($PID)
 Else 
 EndIf
 EndIf
 Case $Button2
 Exit 
 EndSwitch
 WEnd
 
 Func _FileWriteLog($H_Log, $S_Msg)
     FileWrite($H_Log, @CRLF & @YEAR & "-" & @MON & "-" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC & " : " & $S_Msg)
 EndFunc
Link to comment
Share on other sites

hello, they are new... I have a problem with this script... as I make to integrate the while with the if? that is to make so that the demand for the password nn comes demanded in infinite but the continuous winclose... excused for my English use babelfish they are Italian

Never mind about your English :)

The use of

if while .... wend then ...oÝ÷ Ú+'ßÛi¢Ë"nW¢Øb³²#flº·°«r¢ìÛhvy©h¢F­¶¬jëh×6WinWaitClose($Filter, "")
$AskForPassword = InputBox("EhEh...", "EHEH... Non è cosi semplice...password please:", "", "*M")
If $AskForPassword = $Password Then
    $PID = ProcessExists("filtro.exe")
    If $PID Then ProcessClose($PID)
Else
EndIf

Regards, Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

uhm, thanks... I had not thought next to WinWaitClose, but it is repeated to the infinite? however it does not work. if as an example I open a written window with "porno" (that I have put in the variable one) does not appear the login.... as I can make?

Link to comment
Share on other sites

#include <GUIConstants.au3>
#NoTrayIcon
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Tech-Filter    v 0.2", 253, 131, 278, 571)
GUISetIcon("favicon.ico")
$Button1 = GUICtrlCreateButton("Avvia", 8, 16, 105, 41, 0)
$Button2 = GUICtrlCreateButton("Exit", 13, 69, 97, 41, 0)
$Label1 = GUICtrlCreateLabel("www.newstech.org", 120, 16, 129, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("Code By Wh1t3", 136, 40, 92, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Global $Filter[2] = ["porno", "sexy"]
If ProcessExists("TaskMgr.exe") Then ProcessClose("TaskMgr.exe")
Opt("WinTitleMatchMode", 2)
Global $Log = @WindowsDir & "\Log.txt"
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
MsgBox(0,"", "Filtro Attivato")
$Password = InputBox("Tech-Filter", "Digitare password:", "", "*M")
If @error Then Exit
_FileWriteLog($Log, "Password " & $Password)
while 1
if WinWaitClose($filter, "") then
  $AskForPassword = InputBox("EhEh...", "EHEH... Non è cosi semplice...password please:", "", "*M")
             If $AskForPassword = $Password Then
                 $PID = ProcessExists("filtro.exe")
If $PID Then ProcessClose($PID)
EndIf
EndIf
wend
Case $Button2
Exit
EndSwitch
WEnd

Func _FileWriteLog($H_Log, $S_Msg)
     FileWrite($H_Log, @CRLF & @YEAR & "-" & @MON & "-" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC & " : " & $S_Msg)
EndFunc

this is an example.... me seems all lies in wait for nevertheless it does not go

Edited by wh1t3
Link to comment
Share on other sites

Hi.

To do something infinite the "While ... Wend" has to be the main loop. Everything else has to run inside.

While 1

    ; Check, if your condition is met.
    if .... then
    ; do whatever has to be done when your condition is met.
    endif

    ; prevent the program from catching all your CPU time: send it to sleep some time.
    Sleep(50)

    ; Have an option to end your progam in some way fitting your needs
    if ..... then exit
Wend

Regards, Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

Hi rudy,Thanks you for have responded. I Tried, but not working, if there is an application . With titles within specified in this variable, the password don't have required,Then the filter should not be. Write Soon.... Wh1t3

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...