Поиск по пикселю

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Поиск по пикселю

Re: Поиск по пикселю

Post by gatsuga » 11 Oct 2018, 16:43

Неужели никто не сможет помочь?

Поиск по пикселю

Post by gatsuga » 10 Oct 2018, 09:50

Есть код, простой аимлок. Однако как его дополнить так, чтобы при движении мыши она не лочилась на пиксель, а допустим лочилась со смещением на x - 5, z + 10 от пикселя и т.п?

Code: Select all

;/ ----------------------------------------------------------------------------
; Script Version Version: 1.0
; Author: 4573216
; Script Function: QuakeLive Aim Automatronamaton
;/ ----------------------------------------------------------------------------
#Persistent
#KeyHistory, 0
#NoEnv
#HotKeyInterval 1
#MaxHotkeysPerInterval 127
#InstallKeybdHook
#UseHook
#SingleInstance, Force
SetKeyDelay,-1, 8
SetControlDelay, -1
SetMouseDelay, -1
SetWinDelay,-1
SendMode, InputThenPlay
SetBatchLines,-1
ListLines, Off
CoordMode, Pixel, Screen, RGB
CoordMode, Mouse, Screen
PID := DllCall("GetCurrentProcessId")
Process, Priority, %PID%, Normal
 
EMCol := 0x00FF00
ColVn := 96
ZeroX := 840
ZeroY := 525
CFovX := 128
CFovY := 128
ScanL := ZeroX - CFovX
ScanR := ZeroX + CFovX
ScanT := ZeroY - CFovY
ScanB := ZeroY + CFovY
 
Loop, {
GetKeyState, Mouse2, RButton, P
PixelSearch, AimPixelX, AimPixelY, ScanL, ScanT, ScanR, ScanB, EMCol, ColVn, Fast RGB
GoSub GetAimOffset
GoSub GetAimMoves
GoSub MouseMoves
;GoSub DebugTool
GoSub SleepF
}
 
GetAimOffset:
 AimX := AimPixelX - ZeroX
 AimY := AimPixelY - ZeroY
  If ( AimX > 0 ) {
   DirX := 1
  }
  If ( AimX < 0 ) {
   DirX := -1
  }
  If ( AimY > 0 ) {
   DirY := 1
  }
  If ( AimY < 0 ) {
   DirY := -1
  }
 AimOffsetX := AimX * DirX
 AimOffsetY := AimY * DirY
Return
 
GetAimMoves:
 RootX := Ceil(( AimOffsetX ** ( 1 / 2 )))
 RootY := Ceil(( AimOffsetY ** ( 1 / 2 )))
 MoveX := RootX * DirX
 MoveY := RootY * DirY
Return
 
MouseMoves:
If ( Mouse2 == "D" ) {
 DllCall("mouse_event", uint, 1, int, MoveX, int, MoveY, uint, 0, int, 0)
 }
Return
 
SleepF:
SleepDuration = 6
TimePeriod = 1
DllCall("Winmm\timeBeginPeriod", uint, TimePeriod)
Iterations = 4
StartTime := A_TickCount
Loop, %Iterations% {
    DllCall("Sleep", UInt, TimePeriod)
}
DllCall("Winmm\timeEndPeriod", UInt, TimePeriod)
Return
 
DebugTool:
;MouseGetPos, MX, MY
;ToolTip, %AimOffsetX% | %AimOffsetY%
;ToolTip, %AimX% | %AimY%
;ToolTip, %IntAimX% | %IntAimY%
;ToolTip, %RootX% | %RootY%
;ToolTip, %MoveX% | %MoveY% || %MX% %MY%
Return
 
!x::
Reload
Return

Top