Jump to content

Need Help with memory reading and the value is text!!!


jj2147
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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 Then

The 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?

Link to comment
Share on other sites

Ok I did the

If $timer_mem_read = "3m 50s" Then

but 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 by jj2147
Link to comment
Share on other sites

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 by jj2147
Link to comment
Share on other sites

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 by jWalker
Link to comment
Share on other sites

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 by oMBRa
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...