Skip to content

Commit

Permalink
Make the control flow work as intended
Browse files Browse the repository at this point in the history
  • Loading branch information
barealek committed Oct 26, 2023
1 parent 0b429c2 commit d68641a
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions cs2hop/cmd/main.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package main

import (
"time"

cs2hop "github.com/barealek/cs2hop/internal"
"github.com/jamesmoriarty/gomem"
)

var (
offsets = cs2hop.Offsets{}
offsets = cs2hop.Offsets{}
VK_SPACE = 0x20
)

func main() {
Expand All @@ -20,13 +24,19 @@ func main() {
}

for {
flags, err := client.GetFlags()
if err != nil {
panic(err)
}
onGround := flags&(cs2hop.FL_ONGROUND) != 0
if onGround {
client.ForceJump()
if gomem.IsKeyDown(VK_SPACE) {
flags, err := client.GetFlags()
if err != nil {
panic(err)
}

onGround := flags&(cs2hop.FL_ONGROUND) != 0

if onGround {
client.ForceJump()
}

}
time.Sleep(1 * time.Millisecond)
}
}

0 comments on commit d68641a

Please sign in to comment.