格式错误" Func"声明

时间:2016-03-30 10:36:57

标签: autoit

Func aimbot_memory_read_()
    $OriginX = _MemoryRead($m_dwLocalPlayer + $m_vecOrigin, $PROCESS, "float")
    $OriginY = _MemoryRead($m_dwLocalPlayer + $m_vecOrigin + 4, $PROCESS, "float")
    $OriginZ = (_MemoryRead($m_dwLocalPlayer + $m_vecOrigin + 8, $PROCESS, "float") + 61)
    $ply_angleX = _MemoryRead($aClientState + $m_dwViewAngle, $PROCESS, "float")
    $ply_angleY = _MemoryRead($aClientState + $m_dwViewAngle + 4, $PROCESS, "float")
    $aPunchX = _MemoryRead($m_dwLocalPlayer + $m_vecPunch, $PROCESS, "float")
    $aPunchY = _MemoryRead($m_dwLocalPlayer + $m_vecPunch + 4, $PROCESS, "float")
    Global $aimbot_memory_read = [$OriginX, $OriginY, $ply_angleX, $ply_angleY, $OriginZ, $aPunchX, $aPunchY]
    Return $aimbot_memory_read
EndFunc

$aimbot_memory_read[7] = aimbot_memory_read_()

Func DistanceBetween($aimbot_memory_read[0], $aimbot_memory_read[1], $aimbot_memory_read[4], $bone[0], $bone[1], $bone[2])
    Return Sqrt(($aimbot_memory_read[0] - $bone[2]) ^ 2 + ($aimbot_memory_read[1] - $bone[1]) ^ 2 + ($aimbot_memory_read[4] - $bone[0]) ^ 2) 
EndFunc

AutoIt Error

第15行(文件" C:\ Users \ Crypt3x \ Desktop \ crypt3x cheat \ classes \ bot.au3"):

Func DistanceBetween($aimbot_memory_read[0], $aimbot_memory_read[1], $aimbot_memory_read[4], $bone[0], $bone[1], $bone[2])
Func DistanceBetween($aimbot_memory_read^ ERROR

错误:格式错误" Func"言。

确定

任何想法?

1 个答案:

答案 0 :(得分:1)

您不能在变量名称中使用[]

删除它们,您的代码应该有效:

Func DistanceBetween($aimbot_memory_read0, $aimbot_memory_read1, $aimbot_memory_read4, $bone0, $bone1, $bone2)
    Return Sqrt(($aimbot_memory_read0 - $bone2) ^ 2 + ($aimbot_memory_read1 - $bone1) ^ 2 + ($aimbot_memory_read4 - $bone0) ^ 2) 
EndFunc