(08-21-2011, 03:51)TheCodKingz10 Wrote: ok i FINALLY figured out how to freeze my value but NOW im having a worse problem when i click he check-box on my program to freeze it, the entire trainer itself stops responding. the ammo on the game is frozen like i want it to be!, but the trainer stop responding....-_- any help is greatly appreciated heres the code im using
Private Sub CheckBox1_CheckedChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBoxHealth.CheckedChanged
If CheckBoxHealth.Checked = True Then
For i = 1 To 9999 Step 0
memoryh4x(&H176C8B8, 9999, 4)
Next
Else
memoryh4x(&H176C8B8, 1, 4)
End If
LoL you created another thread but ok, your trainer is probably not responding because of the fact the loop you are making has no wait time.
Code:
For i = 1 To 9999 Step 0
memoryh4x(&H176C8B8, 9999, 4)
[color=#FF0000]Sleep(1000) // this is in miliseconds.[/color]
Next
Else
memoryh4x(&H176C8B8, 1, 4)
End If
But then you have to declare this in your form:
Code:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
So the "Sleep" command will be available.
I dont know if this works but if i helped you Press the Thanks Button xD
PS: Sleep wont work for what you want because it suspends all activity from program.
Instead of Sleep try this:
First Of All Create a Module(if you dont have one already) and declare this:
Code:
Public Declare Function GetTickCount Lib "kernel32" () As Long
Code:
Public Sub wait(ByVal dblMilliseconds As Double)
Dim dblStart As Double
Dim dblEnd As Double
Dim dblTickCount As Double
dblTickCount = GetTickCount()
dblStart = GetTickCount()
dblEnd = GetTickCount + dblMilliseconds
Do
DoEvents
dblTickCount = GetTickCount()
Loop Until dblTickCount > dblEnd Or dblTickCount < dblStart
End Sub
Then just use "Wait" like "Sleep":
Code:
For i = 1 To 9999 Step 0
memoryh4x(&H176C8B8, 9999, 4
wait(1000) // this is in miliseconds.
Next
Else
memoryh4x(&H176C8B8, 1, 4)
End If
Suggestion: Instead Of "For" use "While"
Code:
While 1
memoryh4x(&H176C8B8, 9999, 4
[color=#FF0000]wait(1000) // this is in miliseconds.[/color]
While End
Else
memoryh4x(&H176C8B8, 1, 4)
End If
Thanks Barata...