Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

GuiCtrlSetData inside Loop won't refresh data


  • Please log in to reply
28 replies to this topic

#21 xanathos

xanathos

    Seeker

  • Active Members
  • 49 posts

Posted 30 May 2012 - 12:20 AM

You're only reading the location of the mouse once before it goes into the For loop, is that what you're intending?

Also, the controls you're reading from, are they in an AutoIt GUI or an external program?


Yes, that is why I have put everything in the loop, I have to do the check every mouseclick for 9 times, it's more convenient with a loop

i'm reading from an external program and store them in those GUICTRL







#22 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 10,448 posts

Posted 30 May 2012 - 12:28 AM

You're checking the same mouse click location 9 times? For what? Does it change in between those clicks?

You're going to have to post a lot more code than just this function, because I have no idea what it is you're trying to do, your explanation is really vague as to what you're trying to do. Also, you can't use GUICtrlRead on an external (non-AutoIt) program, you'd need to use something else to read from an external control.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to an XP machine, and I'm not going to.

 

Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude

 

How to ask questions the smart way!

 

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.
Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.
_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips. Latin Square password generator

 

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.


#23 xanathos

xanathos

    Seeker

  • Active Members
  • 49 posts

Posted 30 May 2012 - 12:31 AM

You're checking the same mouse click location 9 times? For what? Does it change in between those clicks?

You're going to have to post a lot more code than just this function, because I have no idea what it is you're trying to do, your explanation is really vague as to what you're trying to do. Also, you can't use GUICtrlRead on an external (non-AutoIt) program, you'd need to use something else to read from an external control.

It doesn't check the same location, it checks every 18 pixels from the current Y axis
I'm reading the memory to get those values from the external program, it returns a correct value in my autoit script, I have tried already, here is the function that reads depending on the mouse coordinates

func GetOrderId() OpenMemory() $StaticOffset = dec("C50494") Global $pid = ProcessExists("iexplore.exe") Global $CUROffset[1] $CUROffset[0] = 0 $baseADDR = _MemoryModuleGetBaseAddress($pid, "mlang.dll") $finalADDR = $baseADDR + $StaticOffset $MemTest = _MEMORYREAD($finalADDR, $openmem) Return $MemTest EndFunc   ;==>GetOrderId



AutoIt         
Func LoadPrice() $OrderID = GetOrderId() Local $file = @ScriptDir &amp; "Orders" &amp; $OrderID &amp; ".txt" Local $fileopen = FileOpen(@ScriptDir &amp; "Orders" &amp; $OrderID &amp; ".txt") Local $filereadline = FileReadLine(@ScriptDir &amp; "Orders" &amp; $OrderID &amp; ".txt") Local $line = StringSplit(FileRead(@ScriptDir &amp; "Orders" &amp; $OrderID &amp; ".txt"), @CR) $size_bytes = FileGetSize(@ScriptDir &amp; "Orders" &amp; $OrderID &amp; ".txt") if $OrderID = 0 Then   $OrderID2 = $OrderID   Return EndIf if $OrderID = $OrderID2 Then   Return EndIf $OrderID2 = $OrderID $webpage = InetRead("<a href='http://127.0.0.1/Order.aspx?id=' class='bbc_url' title='External link' rel='nofollow external'>http://127.0.0.1/Order.aspx?id="</a> &amp; $OrderID) ;~ $webpage = 0 $webstring = BinaryToString($webpage) if FileExists($file) Then   $webstring = FileRead($fileopen)   $newOrdervalue = $filereadline Else   $webstring = BinaryToString($webpage)   $pos = StringInStr($webstring, "Price")   $postocut = $pos + 28   $trimmedleft = StringTrimLeft($webstring, $postocut)   $pos2 = StringInStr($trimmedleft, " ")   $newOrdervalue = StringMid($webstring, $postocut, $pos2) Endif $length = StringLen($newOrdervalue) ;~   $length = StringLen($newOrdervalue) If $length &gt; 3 then   $tausender = StringTrimRight($newOrdervalue, 3)   $htausender = StringTrimLeft($newOrdervalue, $length - 3)   $newOrdervalue2 = $tausender &amp; "" &amp; $htausender   GUICtrlSetData( Int($CTRL_OrderSell), Int($newOrdervalue2))   $oldOrdervalue2 = $newOrdervalue Else   Number(GUICtrlSetData($CTRL_OrderSell, $newOrdervalue)) EndIf ;~   if FileExists($file) Then ;~    $webstring = FileRead($fileopen) ;~      $newOrdername = $filereadline ;~   Else $pos3 = StringInStr($webstring, "Order-name") $pos3tocut = $pos3 + 11 $trimmedleft2 = StringTrimLeft($webstring, $pos3tocut) $pos4 = StringInStr($trimmedleft2, "") $newOrdername = StringMid($webstring, $pos3tocut, $pos4) GUICtrlSetData($CTRL_Nom, $newOrdername) $oldOrdername = $newOrdername ;~   EndIf if FileExists($file) Then   FileClose($file) Else   FileWriteLine($file, $newOrdervalue)   FileWriteLine($file, $newOrdername)   FileClose($file) EndIf EndFunc   ;==&gt;loadOrderprice

Edited by xanathos, 30 May 2012 - 12:37 AM.


#24 xanathos

xanathos

    Seeker

  • Active Members
  • 49 posts

Posted 31 May 2012 - 03:01 AM

bump for help

#25 xanathos

xanathos

    Seeker

  • Active Members
  • 49 posts

Posted 01 June 2012 - 05:54 PM

bump

#26 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 10,448 posts

Posted 01 June 2012 - 06:11 PM

You are making no sense with your explanations and short code pieces, either post the whole script or stop bumping the thread, because I'm sure no one can figure out what you need, or what you're doing.

Post the script, the whole script and not just pieces of it. Tell us what program you're trying to get information from also, because you said it was an external program we need to know this.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to an XP machine, and I'm not going to.

 

Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude

 

How to ask questions the smart way!

 

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.
Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.
_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips. Latin Square password generator

 

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.


#27 xanathos

xanathos

    Seeker

  • Active Members
  • 49 posts

Posted 01 June 2012 - 06:50 PM

You are making no sense with your explanations and short code pieces, either post the whole script or stop bumping the thread, because I'm sure no one can figure out what you need, or what you're doing.

Post the script, the whole script and not just pieces of it. Tell us what program you're trying to get information from also, because you said it was an external program we need to know this.

No offence, but if you looked a little bit at my script, all your questions have been answered, like what I'm trying to do or what is the external program...Just a hint:
Global $pid = ProcessExists("iexplore.exe")

Edited by xanathos, 01 June 2012 - 06:50 PM.


#28 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 10,448 posts

Posted 01 June 2012 - 07:05 PM

Ok so you're trying to get something out of IE, you can't use GUICtrlRead to get it from IE. What memory locations are you trying to read from that contains the information you need that clicking the web page is going to help you get, that's the part that makes no sense. You click somewhere on the page, you then read something from memory based upon clicking with the mouse? Have you looked at the IE UDF? Because that will probably work a lot better than scanning the memory for something.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to an XP machine, and I'm not going to.

 

Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude

 

How to ask questions the smart way!

 

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.
Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.
_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips. Latin Square password generator

 

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.


#29 xanathos

xanathos

    Seeker

  • Active Members
  • 49 posts

Posted 01 June 2012 - 07:16 PM

Ok so you're trying to get something out of IE, you can't use GUICtrlRead to get it from IE. What memory locations are you trying to read from that contains the information you need that clicking the web page is going to help you get, that's the part that makes no sense. You click somewhere on the page, you then read something from memory based upon clicking with the mouse? Have you looked at the IE UDF? Because that will probably work a lot better than scanning the memory for something.


Actually that's a school project that has some requirements, and one of them is to use memory reading on a web browser




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users