CoordMode, Mouse, Screen
CoordMode, Pixel, Screen
CoordMode, ToolTip, Screen
ListLines Off
SendMode InputThenPlay
SetBatchLines -1
SetControlDelay, -1
SetKeyDelay, -1, 0
SetMouseDelay, -1
SetWinDelay, -1
PID := DllCall("GetCurrentProcessId")
Process, Priority, %PID%, Normal
global X1, Y1, X2, Y2, 돌격소총, 빨간색, 저격소총, 배경색, 전경색
global FPGCBufferDC = 0
global FPGCReady = 0
global FPGCWait = 1
Gui, Color, FFFFFF
Gui, Font,, 맑은 고딕
Gui, Add, Text,, 해상도
Gui, Add, DropDownList, AltSubmit g설정 v해상도 w200, 1024 × 768||1280 × 1024
Gui, Show,, Bomchattack
Gui, 2: +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, 2: Color, 000000
Gui, 2: Font, cffffff s12 bold, 굴림
Gui, 2: Margin, 0, 0
Gui, 2: Add, Text, v상태표시줄 w200
gosub, 설정열기
return
설정:
Gui, Submit, NoHide
if (해상도 = 1) {
X1 = 481
Y1 = 448
X2 = 513
Y2 = 385
상태표시줄Y := 768 - 66
Gui, 2: Show, x211 y%상태표시줄Y% NA, Secondary Bomchattack OSD
} else if (해상도 = 2) {
X1 = 609
Y1 = 596
X2 = 640
Y2 = 513
상태표시줄Y := 1024 - 66
Gui, 2: Show, x211 y%상태표시줄Y% NA, Secondary Bomchattack OSD
}
return
설정저장:
Gui, Submit, NoHide
IniWrite, %해상도%, bomchattack.ini, Bomchattack 설정, 해상도
return
설정열기:
if (FileExist("bomchattack.ini")) {
IniRead, 해상도, bomchattack.ini, Bomchattack 설정, 해상도, 1
GuiControl, Choose, 해상도, %해상도%
gosub, 설정
} else {
GuiControl, Choose, 해상도, 1
gosub, 설정
}
return
End::
Suspend, Off
Gosub, GuiClose
return
GuiClose:
gosub, 설정저장
ExitApp
return
돌격소총사격실행:
SetTimer, 돌격소총사격실행, Off
while (돌격소총 = 1) {
updateFPGC()
빨간색 := FPGC(X1, Y1)
if (빨간색 = 0x0000ff) {
DllCall("mouse_event", "UInt", 0x02)
DllCall("Sleep", UInt, 768)
DllCall("mouse_event", "UInt", 0x04)
DllCall("Sleep", UInt, 256)
}
}
while (돌격소총 = 0) {
updateFPGC()
빨간색 := FPGC(X1, Y1)
if (빨간색 = 0x0000FF) {
DllCall("mouse_event", "UInt", 0x02)
DllCall("Sleep", UInt, 16)
DllCall("mouse_event", "UInt", 0x04)
DllCall("Sleep", UInt, 16)
}
}
return
저격소총사격실행:
SetTimer, 저격소총사격실행, Off
updateFPGC()
전경색 := FPGC(X2, Y2)
while (저격소총 = 1) {
updateFPGC()
배경색 := FPGC(X2, Y2)
if (전경색 <> 배경색) {
저격소총 = 0
DllCall("mouse_event", "UInt", 0x02)
DllCall("Sleep", UInt, 16)
DllCall("mouse_event", "UInt", 0x04)
DllCall("Sleep", UInt, 1)
GuiControl, 2: , 상태표시줄, 저격소총 사격
break
}
}
return
FPGC(x, y) {
global FPGCBufferDC, FPGCReady, FPGCWait
global FPGCScreenLeft, FPGCScreenTop
; check if there is a valid data buffer
if (!FPGCReady) {
if (FPGCWait) {
Start := A_TickCount
While !FPGCReady {
Sleep, 10
if (A_TickCount - Start > 5000)
return -3 ; time out if data is not ready after 5 seconds
}
}
else
return -2 ; return an invalid color if waiting is disabled
}
return DllCall("GetPixel", "Uint", FPGCBufferDC, "int", x - FPGCScreenLeft, "int", y - FPGCScreenTop)
}
updateFPGC() {
global FPGCReady, FPGCBufferDC
static oldObject = 0, hBuffer = 0
static screenWOld = 0, screenHOld = 0
; get screen dimensions
global FPGCScreenLeft, FPGCScreenTop
SysGet, FPGCScreenLeft, 76
SysGet, FPGCScreenTop, 77
SysGet, screenW, 78
SysGet, screenH, 79
FPGCReady = 0
; determine whether the old buffer can be reused
bufferInvalid := screenW <> screenWOld OR screenH <> screenHOld OR FPGCBufferDC = 0 OR hBuffer = 0
screenWOld := screenW
screenHOld := screenH
if (bufferInvalid) {
; cleanly discard the old buffer
DllCall("SelectObject", "Uint", FPGCBufferDC, "Uint", oldObject)
DllCall("DeleteDC", "Uint", FPGCBufferDC)
DllCall("DeleteObject", "Uint", hBuffer)
; create a new empty buffer
FPGCBufferDC := DllCall("CreateCompatibleDC", "Uint", 0)
hBuffer := CreateDIBSection(FPGCBufferDC, screenW, screenH)
oldObject := DllCall("SelectObject", "Uint", FPGCBufferDC, "Uint", hBuffer)
}
screenDC := DllCall("GetDC", "Uint", 0)
; retrieve the whole screen into the newly created buffer
DllCall("BitBlt", "Uint", FPGCBufferDC, "int", 0, "int", 0, "int", screenW, "int", screenH, "Uint", screenDC, "int", FPGCScreenLeft, "int", FPGCScreenTop, "Uint", 0x40000000 | 0x00CC0020)
; important: release the DC of the screen
DllCall("ReleaseDC", "Uint", 0, "Uint", screenDC)
FPGCReady = 1
}
'게임 코드 자료실' 카테고리의 다른 글
[서든어택] 오토핫키 소스 (1) | 2020.04.11 |
---|---|
[오버워치] 매크로 소스 (2019Ver) (0) | 2020.04.11 |
[서든어택] 쉘값&H코드값 (자료코드) (2) | 2020.04.11 |
[서든어택] 월H 소스 (C++) (0) | 2020.04.10 |