Jump to content

commenti

Active Members
  • Posts

    52
  • Joined

  • Last visited

Profile Information

  • Location
    Troisdorf, germany

commenti's Achievements

Wayfarer

Wayfarer (2/7)

0

Reputation

  1. Hello, thank you all for this usefull responses. I´ll try everything suggested out and let you know if I have made something out off this. This could take a little time because I have not much time for coding. Thank you all again commenti
  2. Hello, it has been a while since I last wrote something in here. Normaly I use autoit to write loginscripts etc. Now I would like to try to do something different with it, not work related. So I have a question is it possible to use a Picture as gui, even is has transparent parts? Basicly what I would like to have is a picture with transparent parts shown with autoit and add a right click menue. Is this possible? I searched the forum for "tranparent gui", "transparent picuture" but did not find the right thing. If this is somehow possible or has been discussed before a hint where I can find related informations would be great. Thank you... commenti
  3. Hello AutoITPimp, I´am not sure if this helps in your situation but I wrote once a script to retreive my current public IP by logging into my router via telnet. I was able to send something to the command prompt but not getting text from it, so I redirected the output to a file and parsed that. Here is what I wrote (quite old, one of my first autoIt scripts). AutoItSetOption("WinDetectHiddenText", 1) ; ---------------------------------------------------------------------------- ; Script Start ; ---------------------------------------------------------------------------- Run ( "telnet 192.168.0.1 -f " &@TempDir & "\routerip.log" , "e:", @SW_HIDE ) WinWait("Telnet 192.168.0.1") ControlSend ( "Telnet 192.168.0.1", "", "", "password") ControlSend ( "Telnet 192.168.0.1", "", "", "show ip{ENTER}") $var = ControlGetText("Telnet 192.168.0.1", "", "ConsoleWindowClass") ControlSend ( "Telnet 192.168.0.1", "", "", "log{ENTER}{ENTER}") $file = FileOpen(@TempDir & "\routerip.log", 0) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop IF (StringInStr ( $line, "ewanisp")) Then $line = StringMid ( $line, 33, 15 ) MsgBox(0, "Aktuelle IP", $line) EndIf Wend FileClose($file) FileDelete (@TempDir & "\routerip.log") Don´t know if this is of any use. commenti
  4. Hi Hans! I saw you made a nicer querytool than my simple one. Good work. I won´t work more on mine. Anyway I think I´ll may make a little query tool for Scite as I mentioned above. I think it is possible to receive the schema so you don´t need to make buttons for different databases. (I won´t do this in my tool, too). Perhaps DBSCHEMA_CATALOGS/CATALOGS Rowset and as you mentioned OpenSchema may be what we need for this. commenti
  5. Hello, A simple query to get everything in a table called mytabel would be: select * from mytable But u need to know which table to query to do this. If you would like to lern more about SQL to do querys you could start here: http://www.w3schools.com/sql/default.asp Hm, this would be possible but the code was intended to be just a simple query tool, not a fully fledged one. This is why I called it simple query ;-) I don´t think I´ll get the time to do what u requests. Anyway if I get the time perhaps I´ll try to make a query tool that u can use together with the SCITE Editor. Scite has syntax highlighting for SQL so I allways wondered why I could not find a query tool for Scite. No problem, as I said I did only the gui stuff plus minor changes / additions to the original example code. (getting number of files via files.count property for example). So thanx have to go to everyone whose codeparts are in this thingy! commenti
  6. Hello! Yes indeed this was really usefull. Really the best example about AutoIt with ODBC Datasources I could find in the forum. That is what I´ve done now, I tied this to a simply gui. It works the following way: First select your ODBC Datasource Second enter your SQL Query Third: See the results. Perhaps this is helpfull for someone who want´s to know if scirptkiddy´s great examplescript works with his ODBC Database without having to to edit the code. Warning: It does not have error handling for the SQL Query. So if you enter a incorrect query it will just close. Here is the code ; SimpleQuery ; Author: AutoIt forum users and commenti (Maic Striepe) ; most of this stuff is from various author of the AutoIT forum. ; based mostly of this post: http://www.autoitscript.com/forum/index.php?showtopic=11147&st=0&p=77572?entry77572 ; Thanx to DaleHohm for pointing me in the right direction where to find more about the adodb object. ; Only available in the beta version of autoit at the present time #include <GUIConstants.au3> opt("TrayIconDebug", 1) ;0=no info, 1=debug line info opt("ExpandEnvStrings", 1) ;0=don't expand, 1=do expand opt("ExpandVarStrings", 1) ;0=don't expand, 1=do expand Dim $ueberschriften = "" Dim $anzahl = 0 Dim $dsncount = 1 Dim $DSN = "" Dim $button3 GUICreate("Choose DSN", 420, 250) $listview = GUICtrlCreateListView("DSN|Type|Description", 10, 10, 400, 200) $button = GUICtrlCreateButton("OK", 180, 220, 70, 20) $var = RegEnumVal("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC Data Sources", $dsncount) $wert = RegRead("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC Data Sources", $var) While $var <> "" $var = RegEnumVal("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC Data Sources", $dsncount) $wert = RegRead("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC Data Sources", $var) If $var <> "" Then GUICtrlCreateListViewItem($var & "|" & "USER" & "|" & $wert, $listview) EndIf $dsncount = $dsncount + 1 WEnd $dsncount = 1 $var = RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources", $dsncount) $wert = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\\ODBC Data Sources", $var) While $var <> "" $var = RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources", $dsncount) $wert = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources", $var) If $var <> "" Then GUICtrlCreateListViewItem($var & "|" & "SYSTEM" & "|" & $wert, $listview) EndIf $dsncount = $dsncount + 1 WEnd GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $button $dsnarray = StringSplit((GUICtrlRead(GUICtrlRead($listview), 2)), "|") $dsn = "DSN=" & $dsnarray [1] ExitLoop EndSelect WEnd GUIDelete(); GUICreate("Enter your sql-query", 420, 250) $edit1 = GUICtrlCreateEdit("", 10, 10, 400, 200) $button2 = GUICtrlCreateButton("OK", 180, 220, 70, 20) $query = GUICtrlRead($edit1) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $button2 $query = GUICtrlRead($edit1) ExitLoop EndSelect WEnd $out = getData($DSN) ToolTip("") MsgBox(0, "Rows fetched", $out) While 1 $msg = GUIGetMsg() Select Case $msg = $button3 ExitLoop EndSelect WEnd Func getData($DSN) ; some things are a bit harder to understand in this part ; .Fields("address").Value is the Value of the Field named "address" ; access database would be the same, but you should call out the full table as well ; like .Fields("Tablename.Fieldname").Value ; and EOF is universal for End Of File $cmboVal = "" $adoCon = ObjCreate ("ADODB.Connection") $adoCon.Open ($DSN) $adoRs = ObjCreate ("ADODB.Recordset") $adoSQL = $query $adoRs.CursorType = 2 $adoRs.LockType = 3 $adoRs.Open ($adoSql, $adoCon) GUICreate("Results", 420, 250) $button3 = GUICtrlCreateButton("OK", 180, 220, 70, 20) With $adoRs ; Get information about Fields collection For $n = 0 To .Fields.Count - 1 $ueberschriften = $ueberschriften & .Fields ($n).Name & "|" Next $liste = GUICtrlCreateListView(StringTrimRight($ueberschriften, 1), 10, 10, 400, 200, $LVS_REPORT, $LVS_EX_GRIDLINES) If .RecordCount Then $count = 0 While Not .EOF $count = $count + 1 ToolTip("record search #" & $count, 0, 0) For $colum = 0 To .Fields.Count - 1 $cmboVal = $cmboVal & "" & .Fields ($colum).Value & "|" Next $cmboVal = StringTrimRight($cmboVal, 1) & @CR GUICtrlCreateListViewItem($cmboVal, $liste) $cmboVal = "" .MoveNext WEnd GUISetState() EndIf EndWith $adoCon.Close Return $count EndFunc ;==>getData I know, this can be made better. Code could use some cleanup. Anyway it works, at least on my comp. commenti
  7. Hi, I don´t know if anyone is using my functions for loginscripts with autoit. However I added another function to determine to which group the pc belongs. Func PCInGroup($PCGROUP) $groupnamelength = stringlen ($pcgroup) if $groupnamelength > 21 then $groupnamelength = 21 EndIf $groupnamearray = StringSplit ($PCGROUP,"") $pcgroup = "" for $groupcharactercount = 1 to $groupnamelength $pcgroup=$pcgroup & $groupnamearray[$groupcharactercount] Next ;Get the computer details and pipe to a text file $tempfile = tempfile() RunWait(@ComSpec & " /c net group /Domain" & " " & $PCGROUP & " >" & $tempfile, "", @SW_HIDE) ; Open textfile output from cmd net user $FILE = FileOpen($tempfile, 0) ; Check if file opened for reading OK If $FILE = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in file until the EOF is reached, if user is in group return 1 (true) or else 0 (false) While 1 $LINE = FileReadLine($FILE) & " " If @error = -1 Then FileClose($FILE) FileDelete($tempfile) ExitLoop EndIf If StringInStr($LINE, @ComputerName & "$") Then FileClose($FILE) FileDelete($tempfile) Return 1 EndIf Wend Return 0 EndFunc ;==>PCInGroup Needs my tempfile function also included in the loginscript-functions.au3 collection. Get the loginscript-functions collection here: http://www.autoitscript.com/fileman/index.php?act=list&op=get&target=commenti%2Floginscript-functions.au3 commenti
  8. Hi desertcolt, What about using the normal "RUN" with the @SW_HIDE flag? Example: Run("notepad.exe", "", @SW_HIDE) The above will run notepad in a hidden window. You could then use ControlSend () to do the automation stuff for the hidden window. Finaly you could use WinSetState () to bring up the movie /result window you mentioned. I hope this helps commenti Edit: Changed suggested ControlShow () to WinSetState. cause this seems after rereading the first post this seemed a better solution to your demands.
  9. Hi, Is there something like a InetGetFileDate function? I was just wondering if something like this allready exist. I have a programm that has an update function. If you click on update it looks on my webpage with InetGetSize() if the file up there has a diffrent size than the the running programm itself. If yes it downloads the other version and replaces itsself after closing. I would prefer to check the filedate of the file on the webpage instead of checking the size. I searched the forum but could not find something like this, does this allready exist or has noone made something like this till now? commenti
  10. Hi Dale, Thank you, this was really helpfull seems you pushed me in the right direction. The link on MSDN for "Recordset Object" is really helpfull. Seems the Fields Collection properties are just what I need. I think I can figure out how to get this working now. Greetings commenti
  11. Hello, I played around with code scriptkitty posted at this topic: http://www.autoitscript.com/forum/index.ph...572entry77572 I could get successfull connections to different ODBC sources with this (for example MySQL). The script is nearly exactly what I need so I tried to modify it to fit my needs. Normaly I don´t use the beta so I am not used to the new COM Extensions. I have problems to understand this part: If .RecordCount Then $count=0 While Not .EOF $count=$count+1 tooltip("record search #" & $count & @crlf & $cmboVal,0,0) $cmboVal = $cmboVal & "" & .Fields("name").Value & "|" & .Fields("phone").Value & "|" & .Fields("address").Value & @cr .MoveNext WEnd I need it to just "dump" all fields in the table of a database separated bei "|". How can I do it, if I don´t want to change everytime the .Fields("something") thing? Is there a way to find out how many .Fields exist and what there names are? Perhaps someone can push me in the right direction? I did not find something usefull about this "adodb" object. commenti
  12. Hello, I was just wondering if anyone ever get this to work: AutoIt and Firebird_embedded (not Firefox!!!) . I don´t know how to beginn with that. The only possible solution seems dllcall but how I don´t know. Anyone else tried this out before? Edit1: Hm, meanwhile I found this programm dependencywalker with this its at least possible to see which functions are in the .dll but still no clue how to use them. Greetings... commenti
  13. You are right, I did not declare a path. The @scriptDir was missing because I thought it was obsolte. Thats is because only the filerequester value was not saved but all other values were saved without using @scriptDir. This is what I don´t know why it is like that. However, with prefixing @scriptDir everything works fine. Thanx again, grettings... commenti.
  14. Hello Hardcopy, thank you for the tip. It worked. I still don´t know why it has to be like that but, it works. What I wanted was that one: IniWrite(@ScriptDir & "\test.ini", "common", "testpath", $datei) ------------- I´ll now prefix all my ini writes with that. Thanx again. Greetings Rockford
  15. Hello! I have a problem with my Gui which uses a filerequester. If I try to save the value I get from the filerequester in an .ini File it won´t save. To test my problem you need a file called test.ini in the diretory which conains the script. test.ini comes first: [common] testpath=c:\test.txt and here is the AutoIt code. #include <GUIConstants.au3> $daten = IniRead("test.ini", "common", "testpath", "") GUICreate("My GUI Test-Tab") ; will create a dialog box that when displayed is centered GUISetBkColor(0x00E0FFFF) GUISetFont(9, 300) $tab = GUICtrlCreateTab(10, 10, 380, 200) $tab0 = GUICtrlCreateTabItem("tab0") GUICtrlSetState(-1, $GUI_SHOW) GUICtrlCreateLabel( "Test", 10, 32, 380, 200, 0x1000) GUICtrlSetBkColor(-1, 0xffffff) $tab1 = GUICtrlCreateTabItem("tab1") GUICtrlCreateLabel("Data", 20, 150, 40, 20) $datapath = GUICtrlCreateInput($daten, 80, 150, 180, 20) $datapathbutton = GUICtrlCreateButton("a", 60, 150, 20, 20) GUICtrlCreateTabItem(""); end tabitem definition GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $datapathbutton Then $datei = FileOpenDialog("Please choose a file.", "", "(*.*)") GUICtrlSetData($datapath, $datei) EndIf If $msg = $GUI_EVENT_CLOSE Then $datei = GUICtrlRead($datapath) MsgBox(0, "This should be written:", $datei) IniWrite("test.ini", "common", "testpath", $datei) ExitLoop EndIf WEnd If you run this script the following happens: In tab1 you have an inputbox, if you write some text there and then close the gui the text is written to the .ini file. If you use the button in the left side, you get a filerequester where you can choose any file. If you chose a file now, the inputbox will be updatet with the path of the file you have chosen. If you now close the gui this path will not be written to .ini file. The message box before the writing of the INI shows the correct value that I wan´t to write to the .ini file. Thats not working and I don´t know why. I really can´t find the bug. Any help anybody? Greetings... commenti.
×
×
  • Create New...