Sign in to follow this  
Followers 0
NL4

Help

8 posts in this topic

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <NomadMemory.au3>
#include <WinAPI.au3>
#include <Memory.au3>
#RequireAdmin

Func _ReadMine($pid)
    Global $MineOffset[4]
    $MineOffset[0] = 0
    $MineOffset[1] = Dec("000C")
    $MineOffset[2] = Dec("0024")
    $MineOffset[3] = Dec("0004")
    $StaticOffset = Dec("000868B4")
    $openmem = _MemoryOpen($pid)
    $baseADDR = _MemoryGetBaseAddress($openmem, 1)
    $finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
    $MemPointer = _MemoryPointerRead($finalADDR, $openmem, $MineOffset)
    _MemoryClose($openmem)
    $Fiori = GUICtrlSetData($Fiori,$MemPointer[1])
    Sleep(1000)
EndFunc

Func _ReadTime($pid)
    Global $TimeOffset[4]
    $TimeOffset[0] = 0
    $TimeOffset[1] = Dec("000C")
    $TimeOffset[2] = Dec("0024")
    $TimeOffset[3] = Dec("001C")
    $StaticOffset = Dec("000868B4")
    $openmem = _MemoryOpen($pid)
    $baseADDR = _MemoryGetBaseAddress($openmem, 1)
    $finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
    $MemPointer = _MemoryPointerRead($finalADDR, $openmem, $TimeOffset,'float')
    _MemoryClose($openmem)
    $Tempo = GUICtrlSetData($Tempo,$MemPointer[1])
    Sleep(1000)
EndFunc

Func _ReadMouse($pid)
    Global $MouseOffset[2]
    $MouseOffset[0] = 0
    $MouseOffset[1] = Dec("0094")
    $StaticOffset = Dec("00087454")
    $openmem = _MemoryOpen($pid)
    $baseADDR = _MemoryGetBaseAddress($openmem, 1)
    $finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
    $MemPointer = _MemoryPointerRead($finalADDR, $openmem, $MouseOffset)
    _MemoryClose($openmem)
    $Mouse = GUICtrlSetData($Mouse,$MemPointer[1])
    Sleep(1000)
EndFunc

$list = ProcessList("MineSweeper.exe")
If $list[0][0] = 0 Then
    MsgBox(16,"Errore", "Programma non trovato")
Else
    $PRID = $list[1][1]
    $PRName = $list[1][0]
#Region ### START Koda GUI section ### Form=C:\Users\Nicola\Documents\prato fiorito.kxf
$Form1 = GUICreate("Prato Fiorito Hack by NL4", 673, 52, 244, 458)
$Mouse = GUICtrlCreateInput("", 112, 16, 49, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY))
$Label1 = GUICtrlCreateLabel("Posizione Mouse:", 16, 16, 87, 17, $SS_RIGHT)
$Label2 = GUICtrlCreateLabel("Fiori:", 192, 16, 26, 17, $SS_RIGHT)
$Fiori = GUICtrlCreateInput("", 224, 16, 49, 21)
$Bloc1 = GUICtrlCreateCheckbox("Blocca", 281, 8, 55, 33)
$Label3 = GUICtrlCreateLabel("Tempo:", 368, 16, 40, 17)
$Tempo = GUICtrlCreateInput("", 408, 16, 49, 21)
$Bloc2 = GUICtrlCreateCheckbox("Blocca", 464, 8, 57, 33)
$Label4 = GUICtrlCreateLabel("Process ID:", 544, 16, 59, 17)
$PID = GUICtrlCreateInput("", 608, 16, 49, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    $PID = GUICtrlSetData($PID,$PRID)
    _ReadMine($PRID)
    _ReadTime($PRID)
    _ReadMouse($PRID)
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
            Exit
                EndSwitch
WEnd
EndIf

This script updates the data but after the first update the GUI hangs and does not update anything help

prova processi.au3

Share this post


Link to post
Share on other sites



dont bump topic if 24h period isnt over

Change topic title to discribe part of your problem

Make small script to replicate problem (we dont need whall script) and someone will probably come along and help you if he finde your topic title interesting

Your script shud look like

;#include <xxx.au3>
GUICreate("xxx")
GUISetState(@SW_SHOW)
;If $something Then myfunc()
While 1
    Sleep(10)
    ;If $something Then myfunc()
WEnd

Func myfunc()
    ;Do something
EndFunc

Youl notice that Func is created after main loop and not on top of the script like in your case, and it can b called infront or in the main loop, pls reedit your main post and try to add changes for Func and then try one more time to explaind what do you think its not working and how the script shud work.


TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

@bogQ

Maybe I misunderstood you, but putting Function defs before main program code is absolutely legal in AutoIt ...

Share this post


Link to post
Share on other sites

I can not change the initial post, however the problem also by moving the "func" does not change

Once executed the first loop does not update the data

And I can not put a restricted version because the problem does not reoccur

Share this post


Link to post
Share on other sites

I can not change the initial post, however the problem also by moving the "func" does not change

Once executed the first loop does not update the data

And I can not put a restricted version because the problem does not reoccur

Try be a bit more elaborate about the issue you have as this script is not one that just can be ran by anybody.

Did you do any debugging to find out where your script is hanging?

ps: next time use a more descriptive Subject/title... normally helps to get better responses.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

@bogQ

Maybe I misunderstood you, but putting Function defs before main program code is absolutely legal in AutoIt ...

You probably did becose english isnt my main language :D , not ilegal, from other side everyone shud know at first look where is body of the script and not to search it down scrolling the mouse to realize that its on the end of the script

On almost all (probably on all) scripts in the help file you start funcs after this last line it main lop isnt in func

;;;; Body of program would go here ;;;;

While 1

Sleep(100)

WEnd

;;;;;;;;

So after the body you put funcs, ofc you can put them on top infront include infront main loop and after main loop, the only question is will you have the nervs to read and search the script so that you can finde where in he** do it starts :huggles: Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

Posted Image

From this screenshot you can see where the problem is that the loop does not update the program

I inserted the tag debugging but no conclusion

loop continues

but NomadMemory.au3 does not include the new values.

prova processi.au3

Share this post


Link to post
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
Sign in to follow this  
Followers 0