Код:
Func Radar ()
$EntityBase = _memoryread($client_dll + $Entity, $process, "dword")
$LocalBase = _memoryread($client_dll + $Local, $process, "dword")
$MeFovx = _memoryread($engine_dll + $SetAng, $process, "float")
$MeFovy = _memoryread($engine_dll + $SetAng + 4, $process, "float")
$MyPOSX = _memoryread($engine_dll + $iPos, $process, "float")
$MyPOSY = _memoryread($engine_dll + $iPos+4, $process, "float")
$MyPOSZ = _memoryread($engine_dll + $iPos+8, $process, "float") - $pi
$MyTeam = _memoryread($LocalBase + $iTeam, $process, "dword")
Local $Angel1[65]
Local $Angel2[65]
Local $dis[65]
For $i = 0 to 64 step 1
$RadarBase = _memoryread($client_dll + $RadarBaseAD, $process, "dword")
$dw_BasePointer = _memoryread($client_dll + $Entity + (($i - 1) * 16), $process, "dword")
$HP = _memoryread($RadarBase + $RadarOffer-4 + (($i - 1) * 0x140), $process, "dword")
if $HP > 1 then
$TEAM = _memoryread($RadarBase + $RadarOffer-8 + (($i - 1) * 0x140), $process, "dword")
if $TEAM <> $MyTeam then
$PlayerPosXr = _memoryread($RadarBase + $RadarOffer + (($i - 1) * 0x140), $process, "float")
$PlayerPosYr = _memoryread($RadarBase + $RadarOffer+4 + (($i - 1) * 0x140), $process, "float")
if $PlayerPosYr <> 0 then
$delta0 = ($PlayerPosXr-$MyPOSX)/$maxdis
$delta1 = ($PlayerPosYr-$MyPOSY)/$maxdis
$ugol = $MeFovy+90
$x = $delta0
$y = $delta1
$posx = $x * Cos($ugol*$degToRad) + $y * Sin($ugol*$degToRad)
$posy = $y * Cos($ugol*$degToRad) - $x * Sin($ugol*$degToRad)
$posx = 93 - $posx
$posy = 90 + $posy
$posx += 6
$posy += 5
if $posx > 200 Then $posx = 195
if $posx < 1 then $posx = 1
if $posy > 200 then $posy = 195
if $posy < 0 then $posy = 0
GUICtrlSetPos($Dot[$i],$posx,$posy)
endif
Else
GUICtrlSetPos($Dot[$i],201,201)
Endif
Else
GUICtrlSetPos($Dot[$i],201,201)
EndIf
Next
EndFunc
AdlibRegister("Radar", 6)
While 1
Sleep(10000)
WEnd
Вот такой скрипт (вырезана часть кода), съедает по 40-50 ЦП, как можно этого избежать и при этом сохранить производительность? Так как работа идет через отрисовку гуи, то замедлять работу скрипта нежелательно, так как отображение будет лагающим... Может есть идеи у экспертов? :search:
p.s Еще вроде как ГУРУ аутоита переводят autoit в asm как-то и это вроде как очень сильно ускоряет скрипт и понижает нагрузку процесса, как это делается и так ли это?