Jump to content

TheGeneral

Active Members
  • Posts

    32
  • Joined

  • Last visited

Everything posted by TheGeneral

  1. Your code is fine. The problem is if you use Function2 after Function1 call: error. Try that: Local $array[3] = ['a', 'b', 'c'] Function1($array) Function2($array) Func Function1(Const ByRef $parameter) Function2($parameter) EndFunc Func Function2(Const ByRef $parameter) ConsoleWrite($parameter[0] & @CRLF) ConsoleWrite($parameter[1] & @CRLF) ConsoleWrite($parameter[2] & @CRLF) EndFunc
  2. The error message is this one: C:UsersThe_GeneralDocumentsTIM.au3(304,72) : ERROR: _Array2D_BinarySearch() previously called with expression on Const ByRef param(s). Func _Array2D_BinarySearch(Const ByRef $avArray, $vValue, $iColumn = 0) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:UsersThe_GeneralDocumentsTIM.au3(68,61) : REF: first call to _Array2D_BinarySearch(). $index = _Array2D_BinarySearch($numerosArray, $str_numero) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:UsersThe_GeneralDocumentsTIM.au3 - 1 error(s), 0 warning(s) The fact Au3Check points to the first occurrence is a bug related here: Function1 is called by main function, with $array as first parameter. Function2 is Array2DBinarySearch. Function1 just gets the index returned by BinarySearch and uses the value changing the subindex: $Array[$index][1]
  3. Try that: main() Func main() Local $array1[3], $array2[3] Function1($array1) Function2($array2) EndFunc Func Function1(Const ByRef $parameter) Function2($parameter) EndFunc Func Function2(Const ByRef $parameter) ConsoleWrite($parameter[0] & @CRLF) ConsoleWrite($parameter[1] & @CRLF) ConsoleWrite($parameter[2] & @CRLF) EndFunc
  4. Hi, I have the following problem: Func Function1(Const ByRef $parameter) Function2($parameter) EndFunc Func Function2(Const ByRef $parameter) ... EndFunc Au3Check returns error Func Function1(ByRef $parameter) Function2($parameter) EndFunc Func Function2(Const ByRef $parameter) ... EndFunc Doesn't work properly. My question is: the $parameter is a large array. I cannot pass it ByValue. What's the alternative?
  5. You should create an Array and put the filename if it satisfies your condition (contains "Something")
  6. You can schedule the execution of your app with Task Scheduler. If that's not enough you can get the hour with Date functions and keep checking until a function has to be run. About autostarting your PC, you should look at the motherboard BIOS and its manual.
  7. You should use $sHandle = FileFindFirstFile($path & "*.txt") Do $filename = FileFindNextFile($sHandle) Until @error
  8. main() Func main() Local $functioname = "test" Call($functioname) If @error Then MsgBox(0,"Reply", "It doesn't work") EndFunc Func test() MsgBox(0, "Reply", "It Works") EndFunc Couldn't you have done it? Just remember to check if there's an error, your string (received) may be corrupted or invalid.
  9. Googling "TCP port ping" I got that: http://code.google.com/p/paping/ I analyzed the TCP packets sent and they are SYN Flags. I don't know how to send this flags with TCPSend. So, you have two options: use this program or finding a way to simulate its behavior with AutoIt. I compared with TCPConnect and the behavior is the same. Check that: Paping: 1 0.000000 192.168.1.33 200.147.67.142 TCP 66 58007 > http [SYN] Seq=0 Win=8192 Len=0 MSS=1460 WS=4 SACK_PERM=1 2 0.038109 200.147.67.142 192.168.1.33 TCP 66 http > 58007 [SYN, ACK] Seq=0 Ack=1 Win=5840 Len=0 MSS=1452 SACK_PERM=1 WS=128 3 0.038182 192.168.1.33 200.147.67.142 TCP 54 58007 > http [ACK] Seq=1 Ack=1 Win=66792 Len=0 4 0.038322 192.168.1.33 200.147.67.142 TCP 54 58007 > http [FIN, ACK] Seq=1 Ack=1 Win=66792 Len=0 5 0.076151 200.147.67.142 192.168.1.33 TCP 60 http > 58007 [FIN, ACK] Seq=1 Ack=2 Win=5888 Len=0 6 0.076207 192.168.1.33 200.147.67.142 TCP 54 58007 > http [ACK] Seq=2 Ack=2 Win=66792 Len=0 TCPConnect: 1 0.000000 192.168.1.33 209.85.229.104 TCP 66 58018 > http [SYN] Seq=0 Win=8192 Len=0 MSS=1460 WS=4 SACK_PERM=1 2 0.275632 209.85.229.104 192.168.1.33 TCP 66 http > 58018 [SYN, ACK] Seq=0 Ack=1 Win=14300 Len=0 MSS=1430 SACK_PERM=1 WS=64 3 0.275702 192.168.1.33 209.85.229.104 TCP 54 58018 > http [ACK] Seq=1 Ack=1 Win=65780 Len=0 TCPCloseSocket: 1 0.719827 192.168.1.33 209.85.229.104 TCP 54 58021 > http [FIN, ACK] Seq=1 Ack=1 Win=65780 Len=0 2 0.986404 209.85.229.104 192.168.1.33 TCP 60 http > 58021 [FIN, ACK] Seq=1 Ack=2 Win=14336 Len=0 3 0.986451 192.168.1.33 209.85.229.104 TCP 54 58021 > http [ACK] Seq=2 Ack=2 Win=65780 Len=0 What Paping does is the same you do. I just have a question, does Paping work with a transparent proxy?
  10. From Prompt: From your program: It seems pretty reliable for me.
  11. From the help file you could get that: Note that your code will be very disorganized with global variables. Try sending them as parameters (Const or ByRef) and returning the result/results.
  12. With a packet sniffer I could check the HTTP communication when you download the file. First, you send a GET request: GET /files/trx-update2/xbot.dll HTTP/1.1 Host: nfk.pro2d.ru User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip, deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Connection: keep-alive The response is like that: HTTP/1.1 200 OK Date: Sun, 08 Jan 2012 08:59:26 GMT Server: Apache/2.2.19 (Unix) mod_fastcgi/mod_fastcgi-SNAP-0910052141 Last-Modified: Thu, 05 Jan 2012 17:28:44 GMT ETag: "2002197-97200-4b5cb439a0b00" Accept-Ranges: bytes Content-Length: 619008 Connection: close Content-Type: application/x-msdownload [.dll DATA HERE] At least the last modification date is there.
  13. The problem was the code itself. I think I convinced myself it worked in sciTE all the time. After adding the telnet logout, it does not fail.
  14. AutoIT Version: 3.3.8.0 OS: Windows 7 x64 I've written the following script: main() Func main() Local $IPAddress = "192.168.1.1" Local $recv = "" ;~ Inicialização TCPStartup() $Socket = TCPConnect($IPAddress, 23) ;~ Usuário AguardaString($Socket, "username:") EnviaComando($Socket, "user") ;~ Senha AguardaString($Socket, "password:") EnviaComando($Socket, "password") ;~ Comando de reinicialização AguardaString($Socket, "TBS>>") EnviaComando($Socket, "reboot") ;~ Finalização TCPCloseSocket($Socket) TCPShutdown() EndFunc ;==>main Func AguardaString(Const $Socket, Const $string) Do $recv = TCPRecv($Socket, 500) Until StringInStr($recv, $string) EndFunc ;==>AguardaString Func EnviaComando(Const $Socket, Const $comando) TCPSend($Socket, $comando & @CR) EndFunc ;==>EnviaComando When I hit F5 in SciTE the program works properly. I tried to compile it to both x86 and x64 version, they do not work. Sometimes the autoit icon appears, but the result does not happen. When I put a MsgBox function right after the reboot command, the .exe works. What's happening?
  15. I was looking the UDF Screen Resolution Change source, and in MSDN documentation there is this option: CDS_SET_PRIMARY This device will become the primary device. http://msdn.microsoft.com/en-us/library/dd183413%28VS.85%29.aspx I have no experience calling a dll, how can i change the primary monitor? Do I have to enumerate displays first?
  16. This is not a general support forum!
  17. How can i change a monitor to primary, through dll call? There's any possibility to change the default sound output through the same method?
  18. The emoticon is cute, I didn't know it was a lol
  19. Thank you very much, it worked perfectly >_<
  20. Hi trancexx, I'm trying to use winHttp for imdb login. But, once it uses SSL conection, I can't see the packages which my browser sends to iMDB server. Here's the website: https://secure.imdb.com/register-imdb/login I tried to write a script which would be capable to login (but it's not working): #include "WinHTTP.au3" $hw_open = _WinHttpOpen("Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)") $hw_connect = _WinHttpConnect($hw_open, "secure.imdb.com") $h_openRequest = _WinHttpOpenRequest($hw_connect, "POST", "register-imdb/login","HTTP/1.1","<a href='[url="https://secure.imdb.com/register-imdb/login"]https://secure.imdb.com/register-imdb/login[/url]' class='bbc_url' title='External link' rel='external'>[url="https://secure.imdb.com/register-imdb/login"]https://secure.imdb.com/register-imdb/login[/url]</a>","text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") _WinHttpAddRequestHeaders($h_openRequest,"Accept-Language: en-us,en;q=0.5") _WinHttpAddRequestHeaders($h_openRequest,"Accept-Encoding: gzip,deflate") _WinHttpAddRequestHeaders($h_openRequest,"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7") _WinHttpAddRequestHeaders($h_openRequest,"Keep-Alive: 300") _WinHttpAddRequestHeaders($h_openRequest,"Connection: keep-alive") $post = "login=myemail&password=mypass" _WinHttpSendRequest($h_openRequest,"Content-Type: application/x-www-form-urlencoded" & @CRLF,$post) _WinHttpReceiveResponse($h_openRequest) If _WinHttpQueryDataAvailable($h_openRequest) Then $header = _WinHttpQueryHeaders($h_openRequest) ClipPut($header) EndIf _WinHttpCloseHandle($h_openRequest) _WinHttpCloseHandle($hw_connect) _WinHttpCloseHandle($hw_open) Here's the post tamperdata: Expected response (Cookies altered for obvious reasons): Status=Found - 302 Date=Tue, 11 Aug 2009 22:42:16 GMT Server=Server Cache-Control=private Expires=Thu, 01 Jan 1970 22:00:00 GMT Location=<a href='[url="https://secure.imdb.com/cookie?c=sid:9f12ec3a,id:7aafb2f6&u=https%3A%2F%2Fp.rizon.top%3A443%2Fhttps%2Fsecure.imdb.com%2Fregister-imdb%2Flogin%3F"]https://secure.imdb.com/cookie?c=sid:9f12ec3a,id:7aafb2f6&u=https%3A%2F%2Fp.rizon.top%3A443%2Fhttps%2Fsecure.imdb.com%2Fregister-imdb%2Flogin%3F[/url]' class='bbc_url' title='External link' rel='external'>[url="https://secure.imdb.com/cookie?c=sid:9f1...cure.imdb.com%2Fregister-imdb%2Flogin%3F"]https://secure.imdb.com/cookie?c=sid:9f1...cure.imdb.com%2Fregister-imdb%2Flogin%3F[/url]</a> Cneonction=close Content-Type=text/plain Set-Cookie=cs=Me2Gn1pCQurLiaaaaaaaaaaaSQbWOzqgkW26lIYZaaaaaaaaaaaaaaaaaaaaayfpnwkW2KB9EtmqCRWyxAaaaaaaaaaaRbbqgsW2aaaaaaaaHYqg==;expires=Wed, 12 Aug 2009 07:00:00 GMT;path=/;domain=.imdb.com sid=muJVtMM9+MxRTDEWwxRIHgBpfK8z6mo5c+rZSuDJ2Rp2fgaaaaaaaaaaaaaaaaaagaVoZ0DkqCX;expires=Thu, 30 Dec 2037 00:00:00 GMT;path=/;secure=true;domain=.imdb.com id=NgcDMDIEGWaaaaaaaaO0ZsBwPyPUXgsT6yoHEtaaaaaaaaaaaaaaaaaaaaaaaaaap2Ro/I5lES07rKmxVhaaaaaawBS4SQ/IesoUSvqSz8h6URbRJkqUHKbQzUorlw/I9RHaaaaaaaaaaa1BM6ypWTcVJf0aGS1ZFjlhaaaaaaaaaaaaaaaaaiboKg==;expires=Thu, 30 Dec 2037 00:00:00 GMT;path=/;domain=.imdb.com Vary=Accept-Encoding,User-Agent Content-Encoding=gzip P3P=policyref="<a href='[url="http://i.imdb.com/images/p3p.xml"]http://i.imdb.com/images/p3p.xml[/url]' class='bbc_url' title='External link' rel='external'>[url="http://i.imdb.com/images/p3p.xml"]http://i.imdb.com/images/p3p.xml[/url]</a>",CP="IMDB " Content-Length=3184 nnCoection=close
  21. I tried something new, but it still doesn't work #include "WinHTTP.au3" $hw_open = _WinHttpOpen("Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)") $hw_connect = _WinHttpConnect($hw_open, "secure.imdb.com") $h_openRequest = _WinHttpOpenRequest($hw_connect, "POST", "register-imdb/login","HTTP/1.1","https://secure.imdb.com/register-imdb/login","text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") _WinHttpAddRequestHeaders($h_openRequest,"Accept-Language: en-us,en;q=0.5") _WinHttpAddRequestHeaders($h_openRequest,"Accept-Encoding: gzip,deflate") _WinHttpAddRequestHeaders($h_openRequest,"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7") _WinHttpAddRequestHeaders($h_openRequest,"Keep-Alive: 300") _WinHttpAddRequestHeaders($h_openRequest,"Connection: keep-alive") $post = "login=myusername&password=mypassword" _WinHttpSendRequest($h_openRequest,$WINHTTP_NO_ADDITIONAL_HEADERS,$post) _WinHttpReceiveResponse($h_openRequest) If _WinHttpQueryDataAvailable($h_openRequest) Then $header = _WinHttpQueryHeaders($h_openRequest) ClipPut($header) EndIf _WinHttpCloseHandle($h_openRequest) _WinHttpCloseHandle($hw_connect) _WinHttpCloseHandle($hw_open)
  22. #include "WinHTTP.au3" $headers = "User-Agent:Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)" & @CRLF & "Accept-Language:en-us,en;q=0.5" & @CRLF & "Accept-Encoding:gzip,deflate" & @CRLF & "Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.7" & @CRLF & "Keep-Alive:300" & @CRLF & "Connection:keep-alive" & @CRLF & "POSTDATA:login=myemail&password=mypass" $hw_open = _WinHttpOpen() $hw_connect = _WinHttpConnect($hw_open, "secure.imdb.com") $h_openRequest = _WinHttpOpenRequest($hw_connect, "POST", "register-imdb/login","HTTP/1.1","https://secure.imdb.com/register-imdb/login","text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") _WinHttpSendRequest($h_openRequest,$headers) _WinHttpReceiveResponse($h_openRequest) If _WinHttpQueryDataAvailable($h_openRequest) Then $header = _WinHttpQueryHeaders($h_openRequest) MsgBox(0, "Header", $header) EndIf _WinHttpCloseHandle($h_openRequest) _WinHttpCloseHandle($hw_connect) _WinHttpCloseHandle($hw_open) I tried that, but it seems that server doesn't allow this type of communication. Could anyone help me?
  23. I solved that: Func TopicoNicks($var2) Global $avNick[16] $source = _INetGetSource($var2) $nicks = _StringBetween($source, "></a><b>", '</b></span><span class="postdetails">') $nicks = _ArrayUnique($nicks) $number = UBound($nicks) If $number > 2 Then For $n = 2 To 16 If $number >= $n Then GuiListAdd($nicks[$n - 1]) Next EndIf EndFunc ;==>TopicoNicks
  24. No, Adlib calls a function every 50ms, that have the option: Case $GUI_EVENT_CLOSE Exit Btw, i solved the problem, just declared $time and $diff = "" before the end of the function
  25. Did you see theIf $username == 0 Then Call ("Check") EndIf ?
×
×
  • Create New...