I am trying to call and use a function from another file (script .ahk). It seems to be calling and working BUT everything in the IF, it does not work. What's wrong with my code ?
File "main" :
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
;SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#include %A_ScriptDir%/L2P/L2P_clean.ahk
Loop = "1"
while (Loop = "1")
{
q::
ToRight(Mid,moka,x,a,e)
return
d::
ToLeft(Mid,moka,x,a,e)
return
}
return
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
;SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; To the right
ToRight(currentPosture,opName,KeyBlock,KeyLLeft,KeyLRight)
{
if (%currentPosture% != "Droi" ) && (%opName% != "kimo") && (%opName% != "kraga")
{
GetKeyState, stateKeyBlock, %KeyBlock%
if (stateKeyBlock = "U")
{
send, {%KeyLLeft% up}
send, {%KeyLRight% down}
currentPosture := "Droi"
}
return
}
sleep, 10
return
}
; to the left
ToLeft(currentPosture,opName,KeyBlock,KeyLLeft,KeyLRight)
{
if (currentPosture != "Gau" ) && (opName != "kimo") && (opName != "kraga")
{
GetKeyState, stateKeyBlock, %KeyBlock%
if (stateKeyBlock = "U")
{
send, {%KeyLRight% up}
send, {%KeyLLeft% down}
currentPosture := "Gau"
}
return
}
sleep, 10
return
}
Thank you for your help.