
Das Ami
Active Members-
Posts
65 -
Joined
-
Last visited
About Das Ami
- Birthday 09/07/1988
Profile Information
-
Location
Switzerland
Das Ami's Achievements

Wayfarer (2/7)
0
Reputation
-
Hi Everyone I have a script to automate a plink login into an SSH server so that I can browse anonymously. Plink creates a local socket on the defined port where I can connect with my browser like so: [browser/Script] <---> [Local plink socket] <---> [Remote SSH Server] <---> [Websites requested by browser/script] Now; the problem is that there seems to be no way to test that local socket for internet connectivity within AutoIt. I thought about maybe sending a GET request to google.com and then evaluating the response. Any other ideas? Here's my script: If ProcessExists("plink.exe") Then ProcessClose("plink.exe") If Not FileExists(@ScriptDir&"\plink.exe") Then MsgBox(0, "", "Couldn't find plink.exe") Exit EndIf ShellExecute(@ScriptDir&"\plink.exe", "-ssh -2 -D 8686 -batch -pw PASSWORD USER@SERVER.net", "", "", @SW_HIDE) Sleep(10000) TCPStartup() $con=TCPConnect("127.0.0.1", 8686) If $con=0 or -1 Then MsgBox(0, "", "Couldn't connect to local socket.") ;~ Test for remote connectivity here. TCPCloseSocket($con) TCPShutdown()
-
[Solved] Condition never matches
Das Ami replied to Das Ami's topic in AutoIt General Help and Support
Nice! Thanks water. I'm sure I'll be able to get it automated again myself. -
How random does it need to be? You could record the mouse movements of the user, I guess that's the closest to true randomization there is. (this method is also used by Putty)
-
Hi AutoIT Community I'm trying to make a program that will behave similar like google's search suggestion: I load a text file containing words, enter the first letter of the word I am looking for into the Inputbox and it deletes all words that don't match from the array. My condition If Not StringLeft($arr[$x], StringLen($i))=$i Then never matches though. What am I doing wrong? #include <Array.au3> #include <File.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 356, 60, 192, 114) $Input1 = GUICtrlCreateInput("", 8, 8, 329, 21) $Label1 = GUICtrlCreateLabel("0", 8, 40, 36, 17) GUISetState(@SW_SHOW) HotKeySet("{PAUSE}", "debug") Dim $arr _FileReadToArray("e.txt", $arr) _ArrayDisplay($arr) Func debug() _ArrayDisplay($arr) EndFunc Func check($i) For $x = 1 to $arr[0] If Not StringLeft($arr[$x], StringLen($i))=$i Then _ArrayDelete($arr, $x-1) $arr[0]=UBound($arr) EndIf Next GUICtrlSetData($Label1, $arr[0]) EndFunc While 1 Sleep(10) If Not GUICtrlRead($Input1)="" Then check($i) EndIf WEnd
-
Noob Question re: Collection Elements
Das Ami replied to RoscoeT's topic in AutoIt General Help and Support
They are called attributes, hope this helps. -
That's probably because the line you read from the excel file doesn't contain numbers but most likely "useless" data (among them characters which produce the error). I am almost certain that excel saves it's data in some kind of XML format inside your xls file. This means that FileReadLine won't work. Take a look at the Excel functions in the helpfile, especially _ExcelReadCell().
-
Noob Question re: Collection Elements
Das Ami replied to RoscoeT's topic in AutoIt General Help and Support
I don't know if it helps but you could try something like this. $oLinks = _IELinkGetCollection ($oIE) $iNumLinks = @extended $linkEl="" $GetHandle = WinGetHandle("Windows Internet Explorer") WinSetState($GetHandle, "", @SW_MAXIMIZE) For $oLink In $oLinks If IsDeclared($oLink.href) Then $linkEl=$linkEl&"href: "&$oLink.href&@CRLF If IsDeclared($oLink.name) Then $linkEl=$linkEl&"name: "&$oLink.name&@CRLF ;...and so on Msgbox(0, "Elements of Link "&$oLink, $linkEl) Next -
Hello there, I suggest you take a look at loops and arrays. I didn't test this code but it should work. #Include <Array.au3> $file = FileOpen("1.xls", 0) $n=1 $total=0 Dim $val If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf Do _ArrayAdd($val,FileReadLine($file, $n)) $n+=1 Until @error= -1 For $x=0 to UBound($val)-1 $total+=$val[x] Next MsgBox(1, "Total Value", $total)
-
Thanks a lot monoceres, I think I understand most of the input structure now. I got another question though. StartLog should constantly send it's output to my function which it does not do yet. Something must be keeping the Dll from communicating with the logit function it seems. Any ideas? I attached my testing code with the Dll and the helpfile in case you have the time to take a quick look at it. dllcall.rar
-
I'm completely new to DLL calls and tried to mess around with the examples in the helpfile, to no avail. The DLL I want to use can be called with this VB code: Declare Function StartLog Lib "kbLog32" (ByVal hWnd As Long, ByVal lpFuncAddress As Long) As Long And the callback: Sub CallBack(ByVal msg As Long, ByVal wParam As Long, ByVal lParam As Long) Is it possible to convert this to AutoIT? Here's what I came up with. (it doesn't work) ; Create callback function $handle = DLLCallbackRegister ("_logit", "long", "hwnd;ptr") ; Call StartLog DllCall(@DesktopDir&"\kbLog32.dll", "long", "StartLog", 0, DllCallbackGetPtr ($handle)) ; Delete callback function DllCallbackFree($handle) ; Callback Procedure Func _logit($hWnd, $lParam) MsgBox(0, $hWnd, $lParam,) Exit EndFunc So the DllCall runs the dll, sends the results to DLLCallbackRegister which then sends it to my _logit Func?
-
Setting the value for input type="file"
Das Ami replied to Das Ami's topic in AutoIt General Help and Support
I can't read something that doesn't exist in my helpfile, guess it's outdated. Thanks for the workaround, much appreciated. -
Setting the value for input type="file"
Das Ami replied to Das Ami's topic in AutoIt General Help and Support
Yes, that's just the snippet in question. Not getting an error message. >Running:(3.2.0.1):C:\Programme\AutoIt3\autoit3.exe "C:\Dokumente und Einstellungen\Kevin\Desktop\Scripts\upload.au3" +>AutoIT3.exe ended.rc:0 >Exit code: 0 Time: 9.988 What do you mean? The helpfile says that the file attribute should work. -
I can't get it to write into the input field is there any way to do this? The html: <html> <body> <form action="upload_file.php" method="post" enctype="multipart/form-data" name="ding"> <input type="file" name="file" id="file" value=""/> <br /> <input type="submit" name="submit" value="Submit" /> </form> </body> </html> The autoit: $oIE=_IECreate("http://www.removed.com/g.html", 0, 1, 1) $oForm = _IEFormGetObjByName ($oIE, "ding") $file = _IEFormElementGetObjByName ($oForm, "file") $submit = _IEFormElementGetObjByName ($oForm, "submit") _IEFormElementSetValue($file, '"C:\log.txt"') ;code above doesn't set a value _IEAction($submit, "click")
-
Controlsend to multiple windows
Das Ami replied to Das Ami's topic in AutoIt General Help and Support
-
I'm not entirely sure about this because I don't know your program. However if you can import your files with parameters over the command line then it should be possible. Create a folder with your files, import those to filemaker and write the filenames into your ini file. The next time you start your program, you can read the files into an array. Now read the ini filenames into an array and delete all entries which already exist in your ini file, then import the files from the now filtered array and save the new filenames to your ini. This works if filemaker can indeed use parameters. An alternative to the ini part would be to just rename your files. (Like adding an x as the file extension.) This would be a lot easier.