在VB(神模式)中不断更新值

时间:2016-10-21 20:42:04

标签: vb.net

我是Visual Studio的新手(ish),想知道如何在VB中不断刷新值...

我目前正在为游戏“耻辱”制作黑客(游戏训练师),我已经发布了v1.0但它所做的只是(https://i.stack.imgur.com/jaMEw.png)......真的很简单。我已经在原版上工作并创建了这个(https://i.stack.imgur.com/rLpAP.png) - 但是我不能让神模式工作:/这是我的代码:

    Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
    If CheckBox1.CheckState = 1 Then
        WriteDMAInteger("Dishonored", GetModuleHandle("Dishonored", "Dishonored.exe") + &H100C810, {&H344}, 70, 1, 4)
    Else
        End
    End If
End Sub

但我不确定如何循环此值正在更新... 按钮和其他一切工作正常...我只是无法得到切换工作:( 请帮忙 提前谢谢,BLITZ

1 个答案:

答案 0 :(得分:0)

您可以使用Timer并以毫秒为单位设置间隔。

Dim Timer1 As New Timer
Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
    If CheckBox1.CheckState = 1 Then
        AddHandler Timer1.Tick, AddressOf Timer1_Tick
        Timer1.Interval = 500
        Timer1.Start()

    Else
        RemoveHandler Timer1.Tick, AddressOf Timer1_Tick
        Timer1.Stop()
    End If
End Sub

Private Sub Timer1_Tick(sender As Object, e As EventArgs)
    WriteDMAInteger("Dishonored", GetModuleHandle("Dishonored", "Dishonored.exe") + &H100C810, {&H344}, 70, 1, 4)
End Sub