jj2147 Posted January 30, 2012 Posted January 30, 2012 Ok, I am having issues with reading a address and the value is text but the format doe not like autoIT or I missing something very simple!! $timer_mem_read = _MemoryRead(0x020c6600, $handle, 'char[16]') ; I have no issues with reading this value. The value it produces is formatted like 3m 50s and I've never had to deal with a value like this with a space. ;I've Tried these formats to get it to work and it does not. Ive read the Help files and I cannot find a good example of this. $Mem_Time = 3m 50s $Mem_Time = '3m 50s' SMem_Time = "3m 50s" ; Ultimately I want to do this. $timer_mem_read = _MemoryRead(0x020c6600, $handle, 'char[16]') If $timer_mem_read = 3m 50s Then Also one last question. If im monitoring a time counter and I'm waiting for the value to become a certain time am I using this _MemoryRead correctly or should I be doing something differently?
jWalker Posted January 30, 2012 Posted January 30, 2012 (edited) If $timer_mem_read = "3m 50s" ThenTry it like this, because it might be an string If you just want to use a timer then you shoulduse sth like this:$myTimer = TimerInit() ;-Your code...... $difference = TimerDiff($myTimer) Edited January 30, 2012 by jWalker
jj2147 Posted January 30, 2012 Author Posted January 30, 2012 Wow that was fast but still with that value its giving me an error. When I put the value I'm monitoing in thats the big promblem I'm having. It looks like this.If $timer_mem_read = 3m 50s ThenThe numbers are blue and giving me an error. I'm not sure what I'm doing wrong. How do I define this value as a Text string?
jj2147 Posted January 30, 2012 Author Posted January 30, 2012 (edited) Ok I did theIf $timer_mem_read = "3m 50s" Thenbut when the timer reaches "3m 50s" it doesnt execute my next line of code. Anyone know if I read _MemoryRead(0x020c6600, $handle, 'char[16]') the 'char[16]' it stands for 15 character string. Now does that mean if I read 15 characters string then I have to monitor the whole 15 Characters? Like this...$timer_mem_read = _MemoryRead(0x020c6600, $handle, 'char[16]')If $timer_mem_read = "3m 50s_________" Then _ is blank space Edited January 30, 2012 by jj2147
jWalker Posted January 30, 2012 Posted January 30, 2012 For me it is hard to understand what you want to to. The Memory which you want to read comes from another program?
jj2147 Posted January 30, 2012 Author Posted January 30, 2012 (edited) Yes and I get the value of the address that I want. I'm trying to monitor it as it ticks down. Say the timer starts at 4m 20s and ticks down. If trying to monitor this value for when it hits 3m 50s and then excute the rest of my program. Edited January 30, 2012 by jj2147
jWalker Posted January 30, 2012 Posted January 30, 2012 (edited) Maybe it hits 3m 51 secs Then your program gets this string Then its 3m 49s and it passes. You could use the Stringsplit Function. Or Better. Use this after you checked the value ToolTip( $timer_mem_read ) And then you will see IF it is a string and IF it is 15 chars long... If it looks like this (3m 50s) or this (3m 50s____________ ) Edited January 30, 2012 by jWalker
oMBRa Posted January 30, 2012 Posted January 30, 2012 (edited) Try something like this: $sTime = _MemoryRead(0x020c6600, $handle, 'char[16]') ; this will strip any non digit,(e.g "3m 50s" ---> 350) ; making simpler the comparison $iTime = StringRegExpReplace($sTime, "[^0-9]", "") If $iTime <= 350 Then _Myfunc() Edited January 30, 2012 by oMBRa
jj2147 Posted January 31, 2012 Author Posted January 31, 2012 Thank you all. I figured it out and like I stated in first post that it was prolly something stupid. Here is how I fixed it. Global $timer_mem_read = _MemoryRead(0x020c6600, $handle, 'char[16]') Global $mem_start_time = "3m 50s" ; <----- Had it right all along I had the rest messed up. Do Timer_Read() Until $timer_mem_read = $mem_start_time msgbox(0,"Timer Started!", $timer_mem_read) Func Timer_Read() $timer_mem_read = _MemoryRead(0x020c6600, $handle, 'char[16]') EndFunc
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now