
RazorTorque4X
Active Members-
Posts
23 -
Joined
-
Last visited
About RazorTorque4X
- Birthday 04/17/1990
Profile Information
-
Location
India
RazorTorque4X's Achievements

Seeker (1/7)
0
Reputation
-
So, I tried to find a way to find copy rate, that is how fast are files being copied when using FileCopy(), what I thought was that to start a TimerInit() before coping and then in a loop get the size of file in destination and by TimerDiff() find the difference and then divide the size by that difference to get the rate. But there were errors Here is the code what I tried #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> GUICreate("copier", 250, 250, Default, Default) $copy = GUICtrlCreateButton("copy", Default, Default, 80, 40) $label = GUICtrlCreateLabel("copy rate", 20, 50, 80, 20) Dim $time GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $copy $time = TimerInit() ;start the timer FileCopy("F:\Games\RESIDENT EVIL 5.zip", "C:\RE\", 9) ;start copying Do $size = FileGetSize("C:\RE\RESIDENT EVIL 5.zip") / (1024 * 1024) ;find the size of file at destination in Mb $TimeEnd = TimerDiff($time) ;stop the timer $rate = $size / ($TimeEnd / 1000) ;rate in Mb per sec GUICtrlSetData($label, $rate) ;update the label Until FileGetSize("C:\RE\RESIDENT EVIL 5.zip") / (1024 * 1024 * 1024) >= 4.2 ;until the whole game of 4.2Gb is copied Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd But I think the script doesn't returns from the FileCopy() until whole file is copied, so as to go in the Do loop and update the label. Also I stopped the execution after 10 sec to see the file in C:\RE and when I checked the properties it said "4.2 Gb" but it was not the full game, as when I tried to extract it all (winrar, 7zip, and windows default zip viewer) reported error that archieved in corrupted. Which means the files wasn't fully copied. So can any one point out what am I doing wrong in here?
-
C++ equivalent code fails ?
RazorTorque4X replied to RazorTorque4X's topic in AutoIt Technical Discussion
Yeah, I am sorry but I had this code in C++ too ! Though the link is that of VBScript, I didn't really noticed at first and remembered that as I had this code for C++ so must be the one in link... But I don't have that C++ code now....... -
C++ equivalent code fails ?
RazorTorque4X replied to RazorTorque4X's topic in AutoIt Technical Discussion
Hey, thanks for pointing out but there are still @errors. The main @error is _Evaluate called with wrong no. of arguments. But as far as I can see is that in the link too, first time there are no. args, but second time the function is called with RecursiveScore Argument. So, that' the main problematic issue ! Or am I completely off the track...? -
This is a simple tic tac toe game, though not simple to say, cause it presents an AI that computer will use while making its move, here is the link to C++ code Link I tried to make AutoIt equivalent code for this, but it fails just in the last function, where computer calculates its move using AI. Can any one tell me what is the error in that function. Here is what I have done. ( See the file ) The code might be a bit long but the the error is just in _Evaluate() function rest is the GUI and other function. Please can anyone help me point out the error. Any little (or big) help is appreciated . tic tac ai.au3
-
Sorry I was in hurry, I should have put this in GUI help and support forums. I am really sorry, but hey can't I move this there now? I don't see a button or something to move this to other forum, if anyone else can, then please do ( If that would be more suitable ).
-
I know there are many functions for ftp, so I thought it might be simple to make a ftp client to transfer files and stuff. But now I am very surprised to find how will I make the GUI where I will show the directories, not the remote but local also. Other GUI items are simple like making a button with caption "connect" that when clicked will connect according to given details. But what about the GUI to display a directory structure of the my PC (say folder E:\Games etc.) and how so for remote PC (the website)? Is there a way I can make that?
-
Sorry, I had to quit abruptly, there was a power cut... Anyways, I think this should work, if not, then cool we'll figure the error Dim $X = 0, $Y = 0, $count = 0, $res1 = True, $res2 = True ;declare vars Global $i = 1, $max = 1024 ;here too Global $Xi[$max], $Yi[$max] ;here also $coord = PixelSearch($X, $Y, 1280, 1024, 0xFF00FF, 50) ;search If Not @error Then MsgBox(0, "Results", "X = " & $coord[0] & " Y = " & $coord[1]) $X = $coord[0] ;set cords for partition $Y = $coord[1] ;second cord EndIf _recursrc($X, $Y) ;call recur func Func _recursrc(ByRef $X, ByRef $Y) ;def If $res1 Then ;true initially $coord = PixelSearch(0, 0, $X, $Y, 0xFF00FF, 50) ;serach in first part If Not @error Then MsgBox(0, "Results #1", "X = " & $coord[0] & " Y = " & $coord[1]) $X = $coord[0] ;update cord $Y = $coord[1] ;update cord MsgBox(Default, "updated", "after update coords are " & $X & ", " & $Y) $Xi[$i] = $X ;store those values in $Xi[1] $Yi[$i] = $Y ;store those values in $Yi[1] $count += 1 ;increase count $i += 1 ;increase $i _recursrc($X, $Y) ;call func again with new args Else $res1 = False ;if error toggle the flag so no more calls EndIf EndIf EndFunc ;==>_recursrc Func _recursrc2(ByRef $Xi, ByRef $Yi) ;func to check in last part If $res2 Then ;first true $coord = PixelSearch($Xi, $Yi, 1280, 1024, 0xFF00FF, 50) ;search in second part If Not @error Then MsgBox(0, "Results #2", "X = " & $coord[0] & " Y = " & $coord[1]) ;no need to update coords as we've stored them in the previous function in the array Else $res2 = False EndIf EndIf EndFunc ;==>_recursrc2 For $i = 1 To $count _recursrc2($Xi[$i], $Yi[$i]) ;call func for all args Next
-
Yeah, actually you are right I didn't thought about that, but its no big deal, we can create a new sub region by breaking the first one into two and so and then search in each one until there is @error as that would be when there is no more result. Just wait till I come up with that...
-
If I am not wrong then what I think it should do is that first it will perform a pixel search in the given area ( the full resolution ) and if it founds a result, displays it and as by default it check from left to right and top to bottom, the result would be the first instant of the search, so then we put those coordinates as new $X and $Y so as to check starting from them, and the same goes on until $X or $Y grows more then screen resolution and for a safer choice put this thing is last line. UNTIL $X >= 1280 OR $Y >= 1024 OR @error So this will quit when it stops finding any more result. And no, it will surely not check just diagonal ! Why you think so ? It checks from LTR and TTB so it will cover a whole new rectangle every time after a result if found.
-
Help Whit Loop (like a live program)
RazorTorque4X replied to Harmonful's topic in AutoIt General Help and Support
I don't even think it will work, I know may be I am wrong but let's have a look, You declared $PlayerHP = Read_WoW_Memory() Now to set this variable this function will be called and in this function are two while loop, first time first one is executed and then while still in first one the next one is executed, which is like While 1 $Value = _MemoryRead(0x00635F0C, $DllInformation) $Mana= _MemoryRead(0x00635EF0, $DllInformation) WEnd So while 1 is always true, and so the script won't get over it and will loop forever in this loop, correct me if I am wrong ? -
try this Dim $X = 0, $Y = 0 DO $coord = PixelSearch($X, $Y, 1280, 1024, 0xFF00FF, 50) If Not @error Then MsgBox(0, "Results", "X = " & $coord[0] & " Y = " & $coord[1]) $X = $coord[0] $Y = $coord[1] EndIf UNTIL $X >= 1280 OR $Y >= 1024 For further improvement, say you want all result altogether, you can easily store it in array.
-
I don't think its very subtle issue, but I think its rather odd to ask this, cause all of it is given in the help file, the syntax and all. Try reading that before posting your question(s)/suggestion(s) .
-
Try to check if there is error in connection, try putting this and you'll know if there is an error in connection. $Conn = _FTP_Connect($Open, $server, $username, $pass) If not @error then _FTP_FileGet($l_FTPSession, $s_RemoteFile, $s_LocalFile [, $fFailIfExists = False, [ $dwFlagsAndAttributes = 0 [, $l_Flags = 0 [, $l_Context = 0]]]]) else Msgbox(Default,"Error","Error occured " & @error) endif It will show you if there is an error in connection. For the second part of question, to see the progress, try using _FTP_ProgressDownload
-
Thanks for that, I'll try it and see if it gets me what I want ! But is there anything related to threading that is supported by autoit, because if it so I can start two threads one for main while loop and other to update the slider, and they can work consistently. Is there a way I can implement it?
-
Ok, so this is the thing first I declare a variable and set it to false $var = False then after some code I create a GUI and a button, on clicking which, the $var will toggle. $gui = GUICreate("whatever",coordinates go here) $button = GUICtrlCreateButton("Toggle",coordinates here) $slider = GUICtrlCreateSlider(whatever coordinates) GUICtrlSetLimit(-1,200,1) Now, I loop in a while loop to check if the button is clicked and depending on state of $var (which will be toggled by our button) it updates a slider. while 1 $nMsg = GUIgetmsg() If $nMsg = $button Then $var = NOT $var EndIf ;Now here I update a slider depending the status of $var If $var Then Dim $temp = 0 ;here the problematic issue starts while 1 $temp +=1 GUICtrlsetdata($slider, $temp) sleep(1000) Wend else GUICtrlsetdata($slider, 200) $temp = 200 while 1 $temp -=1 GUICtrlsetdata($slider, $temp) sleep(1000) Wend EndIf Wend So, this is the problem, when at first the $var is False the if condition will be executed and the slider will update every second, but even if I click on button the else condition won't execute, and the reason is quite logical that its polling through the loop that's why no other action is taken into account that is outside of loop. Atleast this is what I think! So, How should I look if button is clicked or not when I am polling in a loop?