mircea
Active Members-
Posts
146 -
Joined
-
Last visited
About mircea
- Birthday 10/02/1990
Profile Information
-
Location
Romania - Oradea
mircea's Achievements
Adventurer (3/7)
0
Reputation
-
Thank you !!!
-
Hello guys, i want to enchance my aplications that i made for my self and make them easier to find some errors were i work so it would be more easier for me. My problem is, that i don't know how to make the program exit from the function. I tried with the exit loop but no succes. So what im trying to make is that to put the script on pause (so it dosen't use resource's with no reason) and i want that when the error appears on screen the aplication will do specific thing for specific errors. On the aplication that i maded all the errors are in one -> until error1 or error2 or error3 (ex 2). And i want him to make when he finds error 2 for example to do a specific work or a specific mesage. I hope you can guide me. Thank you AutoItSetOption("WinTitleMatchMode", 4) Do sleep(200) until functie() msgbox(0,"asd","iuhuuuu") func functie() Select case WinGetHandle("classname=Notepad", "this one") msgbox(0,"e ok merge","merge cu this one") case WinGetHandle("classname=Notepad", "ceau") msgbox(0,"asd","merge cu ceau") case WinGetHandle("classname=Notepad", "a") msgbox(0,"asd","merge cu a") EndSelect EndFunc Ex 2 autoItSetOption("WinTitleMatchMode", 4) while 1 Do sleep(500) until WinGetHandle("classname=WindowsForms10.Window.8.app.0.378734a","FlowCheckTests_xFT:ASSEMBLY_FLOW_CHECK") OR WinGetHandle("classname=WindowsForms10.Window.8.app.0.378734a","FlowCheck_xFT:ConvertRetey") or WinGetHandle("classname=WindowsForms10.Window.8.app.0.378734a","FlowCheckTests_xFT:INTERACTIVE_FLOW_CHECK") ShellExecute("C:\rim\products\geminicft\scripts\RIM_GUI_StartScript.vbs") msgbox(0,"Interactive or Assambley Flow Check","DORIM PREVENIREA ERORILOR DE GEN ->> INTERACTIVE FLOWCHECK sau ASSAMBLEY FLOW CHECK<<--, DE ACEEA PROGRAMUL VA REPORNI, TE ROG CHEAMA UN TEHNICIAN DE TEST") WEnd
-
Hmmm, yes this is absolutley genius, damn and when i think was using fileread or _filelisttoarray to find the information. Thank you very much for the help this gave me some ideas on my future projects.
-
Yes, but i want to learn something from this. I can use stringreplace to find a specific text from anywere i search (i mean a text file)? And then at what is good Stringtrimright or left ? Cause once i used to another aplication that to find a specific word in a text file and it work. And why it dosen't work in this way(i tried but it give's me the full txt file) $example = Stringreplace($sText, "CFTPASS","") ? And thank you so much for the help
-
Yes that was my propuse to count, recheck the code, count it again, recheck the code (if i didn't change the code) and so on. I was thinking in the first place it was an algorithm mistake .But how do i make the Stringreplace insert into guictrlsetdata? Thank you for your help
-
I can't user the stringsplit cause the text i want to search for it's different and i want just a specific one for example this-ispass-a, this-ispass-b, this-ispass-c, thats why i used stringtrimleft and stringtrimright cause when i want to search the programm to find out the specific one i searched. Hmmm i don't know how to convert the webpage into array, cause the _iexplore commands are a bit confusing for me cause i must find some element's and i don't know how. The reason why i used guictrlsetdata cause i only want to update once the data and do not show over and over again . ex: Pass:1 pass:2 pass:3 i only want him to show me once that thing. pass:3 My issue is i don't know how to make it in such a way that after he finish counting how many times has bin count it to go over again to controlenable controlgettext and so on Edit: you have 7777 post ) that is cool
-
Any help please?
-
Hello guys, i maded a program which reads a number from an aplication and it uses those numbers to have a specific web adress were it reads how many pass or fails it has depends on the way i setted. But i have one problem i don't know how to make him repeat himself I added 3 loops so that in the first loop cleans the temp txt file were it stores the data from the web and after that it gets the number; The second thing i did i addes a if condition if it reads or not that number, if not it goes to sleep (pause) and waits to get the number ( i added the msgbox to see if it works hehe). At the second loop i added the webadress from where to get the data specific to that number and stores it in a temp file.txt it open it. The third loop is for guictrlsetdata so it can show me how many times has bin pass or failed (depending on how do i set it) And the fourth loop is for counting how many times has bin pass or failes the same... depening on how do i set it. My problem is i don;t know how to make it in such a way that after it finds out how many times is passed or failes to exit that loop and wait again to show him a number from that aplication or the same number. Can you guys give me some clue's ? I was thinking to add exitloop after Guictrlsetdata but that only shows me that the code has bin scanned once cause it repeats it self and it reads only once. #include <IE.au3> #include<file.au3> #include <array.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 275, 237, 451, 210) $Edit1 = GUICtrlCreateEdit("", 0, 0, 273, 233, BitOR($ES_CENTER,$ES_WANTRETURN)) ;GUICtrlSetData(-1, "edit1") GUISetState(@SW_SHOW) while 1 ; first loop FileDelete("TEMP.TXT") msgbox(0,"First loop","1") ControlEnable("GUI v2.7.0.0","","WindowsForms10.BUTTON.app.0.378734a1") $b = ControlGetText("GUI v2.7.0.0","","WindowsForms10.BUTTON.app.0.378734a1") $test = StringTrimLeft($b,13) $test2 = StringTrimRight($test,1) msgbox(0,"asd",$test2) if $test2 = 0 Then ; cu asta cica ar trebui sa fi rezovlat problema la infint loop pentru a cauta codul msgbox(0,"error","nu am gasit codul bsn") sleep(500) Else msgbox(0,"asd","am gasit codul bsn") $oIE = _IECreate("http://intranetadress.ro/checkid="&$test2,0,0) $sText = _IEBodyReadText ($oIE) filewrite("Temp.txt",$stext) $file = FileOpen("temp.txt", 0) msgbox(0,"asd","am deschis fisierul temp") while 1 while 1 ;msgbox(0,"asd","al 4 loop") dim $a $line = FileReadLine($file) If @error = -1 Then ExitLoop ;$stanga = StringTrimLeft($line,40) $dreapta = StringTrimRight($line,105) ;msgbox(0,"asd",$dreapta) if $dreapta = "PASS" then $a += 1 exitloop EndIf WEnd sleep(200) Guictrlsetdata($Edit1,"I seens this thing for this many times:"&$a) wend endif WEnd
-
Yes i fix that error, but now it gives me a critical error when i try to make a new account. It give's me the mysql error that it say it's primary and you can't have 2 usernames the same, i click ok and the aplication give's me a critical error and exit Edit: I found out the cause of the problem: the problem was because of the command exitloop (to be onest i don't know why it give's the error but now it's working. Now case $createnewuser if ControlGetText("","",$newuserinput) = "" or ControlGetText("","",$newpassinput) = "" then msgbox(0,"Error", "Username/Password can't be blank") Else _MySQL_InitLibrary() If @error Then Exit MsgBox(0, 'Error', "Lipsa fisier libmysql.dll") $MysqlConn = _MySQL_Init() $connected = _MySQL_Real_Connect($MysqlConn,$mysqladress,$mysqlusername,$mysqlpassword,$mysqldatabase) If $connected = 0 Then $errno = _MySQL_errno($MysqlConn) MsgBox(0,"Error:",$errno & @LF & _MySQL_error($MysqlConn)) If $errno = $CR_UNKNOWN_HOST Then MsgBox(0,"Error:","$CR_UNKNOWN_HOST" & @LF & $CR_UNKNOWN_HOST) Endif $query2 = "INSERT INTO Accounts (nume_user,Parola,Creat_de,data,ora) values ('"& Guictrlread($newuserinput) &"','"& _StringEncrypt(1,Guictrlread($newpassinput),$criptarekey,$passlevel)&"','"&guictrlread($Loginput)&"','"& @MDAY & "-"& @MON &"-"& @YEAR &"','"& @hour&":"& @MIN & ":" & @SEC&"')" $mysql_bool = _MySQL_Real_Query($MysqlConn, $query2) If $mysql_bool = $MYSQL_SUCCESS Then MsgBox(0,"Succes", "Username succesffuly created",2) Exitloop Else msgbox(0,"Error","Error: That username allready exists",2) EndIf _MySQL_Free_Result($mysql_bool) _MySQL_Close($MysqlConn) _MySQL_EndLibrary() Endif before case $createnewuser if ControlGetText("","",$newuserinput) = "" or ControlGetText("","",$newpassinput) = "" then msgbox(0,"Error", "Username/Password can't be blank") Else _MySQL_InitLibrary() If @error Then Exit MsgBox(0, 'Error', "Lipsa fisier libmysql.dll") $MysqlConn = _MySQL_Init() $connected = _MySQL_Real_Connect($MysqlConn,$mysqladress,$mysqlusername,$mysqlpassword,$mysqldatabase) If $connected = 0 Then $errno = _MySQL_errno($MysqlConn) MsgBox(0,"Error:",$errno & @LF & _MySQL_error($MysqlConn)) If $errno = $CR_UNKNOWN_HOST Then MsgBox(0,"Error:","$CR_UNKNOWN_HOST" & @LF & $CR_UNKNOWN_HOST) Endif $query2 = "INSERT INTO Accounts (nume_user,Parola,Creat_de,data,ora) values ('"& Guictrlread($newuserinput) &"','"& _StringEncrypt(1,Guictrlread($newpassinput),$criptarekey,$passlevel)&"','"&guictrlread($Loginput)&"','"& @MDAY & "-"& @MON &"-"& @YEAR &"','"& @hour&":"& @MIN & ":" & @SEC&"')" $mysql_bool = _MySQL_Real_Query($MysqlConn, $query2) If $mysql_bool = $MYSQL_SUCCESS Then MsgBox(0,"Succes", "Username succesffuly created",3) Else msgbox(0,"Error","Error: That username allready exists") EndIf _MySQL_Free_Result($mysql_bool) _MySQL_Close($MysqlConn) _MySQL_EndLibrary() Exitloop Endif
-
Can someone help me with the critical error message and why the aplication exit?
-
Ok i fix that with a condition If $row = 0 then the username is wrong and if else the username can log in. But what about the critical error ? and the aplication exists?
-
Yes, cause it can't find that username so it gives null or zero
-
Bump? And i have one more problem when im trying to make a new username, it shows me that it cannot have a duplicate but after that the scripts give's a error and exit
-
I have fixed the problem i used arrays and the example from @ProgAndy but i have a problem, if i enter blank in the guictrlinput and the mysql query dosen't find any username it give's me a array error. I tried to put the @error in the front so if it see a error to give a mesage but no succes. Array variable subscript badly formatted.: Dim $array[$rows][$fields] Dim $array[^ ERROR >Exit code: 1 Time: 3.038 _MySQL_InitLibrary() If @error Then Exit MsgBox(0, 'Eroare', "Eroare lipsa fisiere .dll") $MysqlConn = _MySQL_Init() $connected = _MySQL_Real_Connect($MysqlConn,"localhost","root","","emulatoare") If $connected = 0 Then $errno = _MySQL_errno($MysqlConn) MsgBox(0,"Error:",$errno & @LF & _MySQL_error($MysqlConn)) If $errno = $CR_UNKNOWN_HOST Then MsgBox(0,"Error:","$CR_UNKNOWN_HOST" & @LF & $CR_UNKNOWN_HOST) Endif $query = "SELECT * FROM accounts where Nume_user='"& Guictrlread($Loginput)&"'" _MySQL_Real_Query($MysqlConn, $query) $res = _MySQL_Store_Result($MysqlConn) $fields = _MySQL_Num_Fields($res) $rows = _MySQL_Num_Rows($res) Dim $array[$rows][$fields] For $k = 1 To $rows $mysqlrow = _MySQL_Fetch_Row($res,$fields) $lenthsStruct = _MySQL_Fetch_Lengths($res) For $i = 1 To $fields $length = DllStructGetData($lenthsStruct, 1, $i) $fieldPtr = DllStructGetData($mysqlrow, 1, $i) $data = DllStructGetData(DllStructCreate("char[" & $length & "]", $fieldPtr), 1) $array[$k - 1][$i - 1] = $data Next Next ;msgbox(0,"asd",$array[0][0]) If $array[0][0] = Guictrlread($Loginput) Then if $array[0][1] = _StringEncrypt(1,guictrlread($Loginpass),$criptarekey,$passlevel) Then Msgbox(0,"Succes","Succes you have succesfully log in") else msgbox(0,"error","Sorry wrong username/password") endif Else msgbox(0,"error","Sorry wrong username/password") endif _MySQL_Free_Result($res) _MySQL_Close($MysqlConn) _MySQL_EndLibrary()
-
@ProgAndy i tried what did you say but no luck. I tried many ways but no succes in what im trying to make. First way. - If i make the program to check for errors the $mysql bool where checks if it can querry the afirmation, If the information is Valid it tell me that is valid and if it's not valid isn't tell me anything i tryied to change from the MYSQL_Succes to MYSQL_OK but still no succes, after that i was thinking maybe the problem is that the program it's running the querry but isn't store the information in the mysql_store_results but no succes with that too. What im trying to make it's a login username, and im trying to make the program to search the field for the username and if he find out the username after that to compare if the password it's corectly with the user input. What i done so far it's to make him search for the password if it's find it i display the table if isn't find it isn't display anything. (on the first one ) First way #include <array.au3> #include "mysql.au3" ; MYSQL starten, DLL im PATH (enthält auch @ScriptDir), sont Pfad zur DLL angeben. DLL muss libmysql.dll heißen. _MySQL_InitLibrary() If @error Then Exit MsgBox(0, '', "") MsgBox(0, "DLL Version:",_MySQL_Get_Client_Version()&@CRLF& _MySQL_Get_Client_Info()) $MysqlConn = _MySQL_Init() MsgBox(0,"Fehler-Demo","Fehler-Demo") $connected = _MySQL_Real_Connect($MysqlConn,"localhost","root","","emulatoare") If $connected = 0 Then $errno = _MySQL_errno($MysqlConn) MsgBox(0,"Error:",$errno & @LF & _MySQL_error($MysqlConn)) If $errno = $CR_UNKNOWN_HOST Then MsgBox(0,"Error:","$CR_UNKNOWN_HOST" & @LF & $CR_UNKNOWN_HOST) Endif $query = "SELECT * FROM accounts where Parola='9c40'" $mysql_bool = _MySQL_Real_Query($MysqlConn, $query) If $mysql_bool = $MYSQL_SUCCESS Then $res = _MySQL_Store_Result($MysqlConn) ;MsgBox(0, '', "Zugriff Methode 2 - Reihe für Reihe") _MySQL_Data_Seek($res, 0) ; nur zum zum Zurücksetzen an den Anfang der Abfrage Do $row1 = _MySQL_Fetch_Row_StringArray($res) If @error Then ExitLoop _ArrayDisplay($row1) Until @error ;MsgBox(0, '', "Query OK") ElseIf MSgbox(0,"error", "Wrong username/passsword") Else $errno = _MySQL_errno($MysqlConn) MsgBox(0,"Error:",$errno & @LF & _MySQL_error($MysqlConn)) ;ConsoleWrite($errno & @LF & _MySQL_error($MysqlConn)) EndIf The second thing i tried is this, and this one it's working untill i want to make him check the second field. The first field (nume_user) find's it and searches to see if it's there but when im trying to make him search for the password (the second field, Parola) it dosen't search for it. $query = "SELECT * FROM accounts where Nume_user='Mircea'" _MySQL_Real_Query($MysqlConn, $query) $res = _MySQL_Store_Result($MysqlConn) $fields = _MySQL_Num_Fields($res) $rows = _MySQL_Num_Rows($res) MsgBox(0, "", $rows & "-" & $fields) ; Zugriff 1 MsgBox(0, '', "Zugriff Methode 1- Handarbeit") Dim $array[$rows][$fields+1] For $k = 1 To $rows $mysqlrow = _MySQL_Fetch_Row($res,$fields) $lenthsStruct = _MySQL_Fetch_Lengths($res) For $i = 1 To $fields $length = DllStructGetData($lenthsStruct, 1, $i) $fieldPtr = DllStructGetData($mysqlrow, 1, $i) $data = DllStructGetData(DllStructCreate("char[" & $length & "]", $fieldPtr), 1) $array[$k - 1][$i - 1] = $data Next Next _Arrayfindall($array,"Mircea") If @error Then msgbox(0,"error","Wrong username") Else msgbox(0,"am gasit","amgasit ") endif I hope you guys can help me. Thanks in advance