
Zaxon
Active Members-
Posts
134 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Zaxon's Achievements

Adventurer (3/7)
0
Reputation
-
StringRegExpReplace back references
Zaxon replied to Zaxon's topic in AutoIt General Help and Support
If you're refering to PCRE 7.4 as in http://freshmeat.net/projects/pcre/?branch...lease_id=262222 which is an external library, our problem isn't so much with the internal processing of the regex, but rather that AutoIt parses the statement and evaluates it before it can be plugged into the PCRE. And I've already given an example showing that it doesn't work as it is in AutoIt. Testing out an underlying library isn't go to solve the AutoIt side of things. -
StringRegExpReplace back references
Zaxon replied to Zaxon's topic in AutoIt General Help and Support
OK. The outcome of that thread seems to me to be: applying functions to back references totally fails. Use some other workaround instead, perhaps some combination of StringRegExp then manually replacing what you've found. So the upshot is that AutoIt's StringRegExpReplace is only usable for the simplest cases. Are there some plans to fix this to make it more usable? -
StringRegExpReplace backreferences don't seem to allow functions to be applied to them. Let's check if back references are working: $string="hello" $string=StringRegExpReplace($string,"(.)","=$1") msgbox(0,"",$string) ; produces: =h=e=l=l=o So, the asc function is being applied FIRST and acts on the literal string "$1" rather than the back reference which will be substituted into it. Is there a way to use functions on back references - like you can in most other languages? If not, then StringRegExpReplace becomes practically useless except for the classic delete pattern: stringRegExpReplace($string,"something here","")
-
Getting Connected IP and Port info
Zaxon replied to Zaxon's topic in AutoIt General Help and Support
Good guess - it worked! Now, do we know the dll calls to resolve the remote port number? -
Getting Connected IP and Port info
Zaxon replied to Zaxon's topic in AutoIt General Help and Support
External programs start a whole new process - an expensive operation in windows. Certainly in compiled or linked languages, you don't have this overhead with .dlls. I'm not sure how DllCall is treated in AutoIt, whether the autoit.exe program links to the dll directly from the process, or whether a new process entirely is launched. With the commands you've given, and thank you for what you've provided so far , netstat -a gives a list of every connection on your system. I could string parse that to find the details I need I presume, but that's a far cry from what I'm expecting to do. In PERL, I can interrogate the connection object of my current connection directly and it will happy tell me the IP and port of my current connection. No need for external commands or parsing down a couple of pages of netstat output to find the one thing I'm interested in. The SocketToIP($SHOCKET) used to work (I'm assuming). I've changed one of the types from int_ptr to int, as directed by the output I received, but I'm currently just get "0" return. Plus, a port was never returned, though I'm sure it's just another dll call away. -
Getting Connected IP and Port info
Zaxon replied to Zaxon's topic in AutoIt General Help and Support
They're external commands. Given that your AutoIt script has the TCP connection, you'd think you'd be able to interrogate that connection directly from within AutoIt or at the least via a DLL call. -
I'm trying to get the IP address, port #, and possibly even do a lookup to resolve the name of the remote peer that you're connected with via TCP/IP (using the inbuild AutoIt TCP connection commands). This needs to work on both the client and server sides. I can do this with PERL quite easily, but I'm trying do replicate that functionality with AutoIt. The SocketToIP() function given in the AutoIt help doesn't seem to work, even after I modify it because int_ptr is now a deprecated type. In addition, it never gave the port #. I've combed the forums for this info and read countless posts, but haven't seen mention of how to get this basic info about your connection.
-
Thanks. Works like a charm.
-
I've used code forever that changes the format of a date control, and although my script hasn't changed, a more recent version of AutoIt breaks the functionality. Currently using autoit-v3.2.9.11. I've written a test script by way of example: #include <GUIConstants.au3> GUICreate("") $date=GUICtrlCreateDate("",5,5,100,20,$dts_timeformat) $style = "hh:mm tt" ; or ;$style = "hh':'mm' 'tt" GuiCtrlSendMsg($date, $DTM_SETFORMAT, 0, $style) ; or ;GUICtrlSendMsg($date, 0x1005, 0, $style) GUISetState(@SW_SHOW) sleep(5000) This creates a time (date) control and attempts to change it's format to one which excludes the seconds. The two different format ($style = ) lines show testing attempts with the way it used to work in a previous version of AutoIt and the way given in examples in this forum. Same with the two SendMsg lines, one showing the way my script uses it, the other the way it's currently shown in forum examples. What I end up with is a date control showing a single number, eg: "5" for the actual time "5:24 PM", no minutes etc are shown. I've played around with the format of the $style string - pretty much everything I could think of - but I keep getting just a single digit shown instead of a properly formatted time. Now, I don't know what changed in AutoIt to break this functionality. How can I now correctly change the time format?
-
So as a group we can't figure out how to start VLC via ActiveX? If this is the case, then that's a pity, since we're about 90% of the way there already. I can already start it, but one of the types I'm passing to the call is incorrect.
-
It seems like we've taken a step backwards. VLC doesn't open at all with this code. addTarget is definately still listed as a valid method in all the reference material.
-
I've updated the VLC references in the previous post. If anyone can see, based on the information I've provided, how to correct the addTarget method call, that will solve our current step.
-
OK. This thread seems to have been taken off on a slight tangent. The purpose of this thread being how to programatically control VLC: pause, jump to location x, "what position am I currently playing in the file",unpause, stop etc. So I will bring it back to that. I've messaged the VLC support forums about this http://forum.videolan.org/viewtopic.php?p=106030#106030 and have been told that VLC can successfully be controlled via ActiveX without needing to use a web browser. I will add that virtually 100% of times VLC mentions ActiveX on their site it in the same sentence as web browser. Hence it wasn't my first avenue to try from a stand alone language. The support forum for ActiveX is even called "Web and scripting". But let's move on. ActiveX Taking the examples from the VLC website written in other languages, having read numerous posts on their support forum etc et al, I've written some code for starting VLC via ActiveX that almost works. #include <Constants.au3> $file="c:\temp\test.mpg" ; change this to a file that exists on your system $vlc=ObjCreate("VideoLAN.VLCPlugin.1") if @error then msgbox(0,"Error","Unable to create VLC object") exit endif ;msgbox(0,"",$vlc.versioninfo) ; uncomment this line if you'd like confirmation that we're successfully communicating with VLC dim $options[1] $options[0]=":vout-filter=deinterlace" enum $VLCPlayListInsert=00000001,$VLCPlayListReplace=00000002,$VLCPlayListAppend=00000004,$VLCPlayListGo=00000008,$VLCPlayListCheckInsert=00000010 $vlc.addTarget($file, $options,$VLCPlayListGo,0) What it does is: 1. Successfully create a VLC object 2. Successfully communicate with that object 3. Starts up VLC 4. But AutoIt errors out immediately after starting up VLC 5. VLC will successfully play the file until you close down the AutoIt error I believe that we're 90% of the way there; the objective being to start VLC via ActiveX with the view to allow full control over the VLC object. The error is caused by the $vlc.addTarget() line, so it's probably simply means we have the wrong variable type in the one of the fields. That's what we're here to figure out together. I have posted my code and asked for assistance in the VLC forum etc (see the above link) but I haven't received any reply. Hence, it's up to us AutoIt people to work out how to start up VLC via ActiveX on our own. Reference Material To figure out what might be wrong with the addTarget line, here are some VLC resources: http://wiki.videolan.org/ActiveX_Controls This page tells us the format for addTarger is: addTarget(uri as String, options, mode as VLCPlaylistMode, Position as Long) http://wiki.videolan.org/ActiveX/Delphi This gives us an example of using ActiveX via Delphi
-
This is spam right? VLC's website is videolan.org and has nothing to do with the website you posted.
-
I know. Solve this and we've created the 8th wonder of the world, right?