-3

I don't know why I get this error, any tip?

I have already checked spaces/tabs:

if windll.user32.GetKeyState(Keybind_Use_Key_Code) >= 0:
        break
    DebugPrint("Sending Turbo Use Action")
    keyboard.press(Ingame_Keybind_Use)
    Sleep(0.020)
    keyboard.release(Ingame_Keybind_Use)
    sleep(Delay_Turbo_Use)

What do you think?

Evandro Coan
  • 8,560
  • 11
  • 83
  • 144
PanosMrk
  • 9
  • 2
  • 1
    You really checked? Why does there exist three levels of indents? -- btw, use the `{}` button to format code block. – Til Jan 12 '19 at 15:00
  • yeah I checked, I am not professional programmer I do this as hobby. Can you help to fix this .. – PanosMrk Jan 12 '19 at 15:05
  • The lines starting from `DebugPrint` should be at the same level of `if`. Read some more articles about indents in python please. – Til Jan 12 '19 at 15:08
  • So, I must move DebugPrint at the same level of if and ? It's the first time that I meet this error.. – PanosMrk Jan 12 '19 at 15:11

1 Answers1

1

So the right indent should be like this:

if windll.user32.GetKeyState(Keybind_Use_Key_Code) >= 0:
    break
DebugPrint("Sending Turbo Use Action")
keyboard.press(Ingame_Keybind_Use)
Sleep(0.020)
keyboard.release(Ingame_Keybind_Use)
sleep(Delay_Turbo_Use)

Try this, see if it throws that error again.

Til
  • 5,150
  • 13
  • 26
  • 34