Как сделать в центре экрана прицел

Закрыть ... [X]

Notes

This library was tested ONLY with DirectX8 game Warcraft III
Overlayed elements also get ontop of the game's custom mouse cursor
Be aware that the hook method used by this library is highly detectable and may get your online game account banned!
Warcraft III tested on Garena will not get you banned
BattleField 2 may perform a MD5 check and detect the extra DLL file(s)
Punkbuster anti-cheat system may perform same/similar routine that won't let you use this library online
Functions

General Functions

GPF_Main( )

Toggle function (load/unload the library).

Return values: +1 , +2 , -1 , -2
A positive value indicates success. A negative value indicates failure.
+1 and -1 are related to loading the library. +2 and -2 are related to unloading it.
GPF_ShowFPS( bShowFPS )

bShowFPS is a boolean (0/1). Indicates display of FPS info.

It is always shown in the upper left screen corner and is not changeable in size or color.

Function returns ErrorLevel (0 if performed successfully).
GPF_GetScreenSize( SizeX , SizeY )

SizeX/Y are the ouput variables for current width and height (in pixels) of game screen. Both are set to 0 if screen size cannot be determined.

This function does not work when the game is minimized.

Function returns ErrorLevel (0 if performed successfully).
Text-related Functions

GPF_SetSingleLine( ObjNum , PosX , PosY , Text , ARGB , UseBlackBG , FontSize , UseBold , FontFamily )

ObjNum indicates the single-line text field (0-4) to be set.
PosX/Y indicate position (upper left corner of text field).
Text is a single-line text. Maximum length is 127 or 128, I'm not sure.
ARGB sets transparency (0-255) and color. Number format must be hexadecimal. Example: 0xFF000000 - black text, no transparency.
UseBlackBG is a boolean (0/1). Indicates usage of a black background for the text field.
FontSize is the size of the font in "logical device units" (I don't know what this means, so just pick a value and try it out).
UseBold is a boolean (0/1). Indicates usage of bold effect.
FontFamily is a boolean (0/1). 0 is SWISS type (proportional font like Arial), and 1 is MODERN type (monospace font like Courier New).

Function returns ErrorLevel (0 if performed successfully).
GPF_SetMultiLine( ObjNum , PosX , PosY , Text , ARGB , UseBlackBG , FontSize , UseBold , SizeX , SizeY , FontFamily )

ObjNum indicates the multi-line text field (0-4) to be set.
PosX/Y indicate position (upper left corner of text field).
Text is a multi-line text. Maximum length is 1023 or 1024, I'm not sure.
ARGB sets transparency (0-255) and color. Number format must be hexadecimal. Example: 0xFF000000 - black text, no transparency.
UseBlackBG is a boolean (0/1). Indicates usage of a black background for the text field.
FontSize is the size of the font in "logical device units" (I don't know what this means, so just pick a value and try it out).
UseBold is a boolean (0/1). Indicates usage of bold effect.
SizeX/Y set the boundaries of text field. Text will be shown only within this box. Values in pixels and based on current screen resolution.
FontFamily is a boolean (0/1). 0 is SWISS type (proportional font like Arial), and 1 is MODERN type (monospace font like Courier New).

Function returns ErrorLevel (0 if performed successfully).
GPF_ShowSingleLine( ObjNum , ShowText )

ObjNum indicates the single-line text field (0-4) to be displayed.
ShowText is a boolean (0/1). Indicates if text will be displayed or not.

Function returns ErrorLevel (0 if performed successfully).
GPF_ShowMultiLine( ObjNum , ShowText )

ObjNum indicates the multi-line text field (0-4) to be displayed.
ShowText is a boolean (0/1). Indicates if text will be displayed or not.

Function returns ErrorLevel (0 if performed successfully).
Picture-related Functions

GPF_SetPicture( FileFullPath )

FileFullPath is the full path of the desired picture.

Allowed formats are BMP, DDS, DIB, HDR, JPG, PFM, PNG, PPM and TGA.
There is no transparency except for picture's own transparent color.
Having a picture size with the powers of 2 is recommended for compatibility with some graphics cards (e.g. better use 256x256 than 200x200).

Function returns ErrorLevel (0 if performed successfully).
GPF_ShowPicture( ShowPic , PosX , PosY )

ShowPic is a boolean (0/1). Indicates if picture will be displayed or not.
PosX/Y indicate position (upper left corner of picture).

Function returns ErrorLevel (0 if performed successfully).
GPF_TakeScreenShot( bFormat , SaveFullPath )

bFormat is a boolean (0/1). Indicates format of saved screenshot. 0 = BMP and 1 = JPG.
SaveFullPath is the full path of saved screenshot (including file extension).

If a previous screenshot request is still pending (being processed), a subsequent call to this function will fail.
Function returns ErrorLevel (0 if performed successfully).
Note that 0 indicates that the request has successfully been passed. It does not indicate that the screenshot has already been taken.
Checking existance of screenshot file would be a good workaround.
Remarks

"Based on current screen resolution": whenever this is stated, it means that a picture or text-field will not be scaled for windowed games. Let's say you're playing a game in fullscreen mode. If you have a 256x256 picture, it will be displayed normally. Now, if you switch to windowed mode and scale it to 50% of fullscreen size, the picture will not be scaled and will look like a 512x512 picture ingame.
Examples

Download Example 1
; =========================================

#Include GPF_v1.1c.ahk

var_ObjNumber := 0 ; ------------ from 0 to 4
var_PosX := 420 ; --------------- text X position
var_PosY := 230 ; --------------- text Y position
;   var_SizeX := 500 ; ---------- X multiline field size
;   var_SizeY := 500 ; ---------- Y multiline field size
var_TextLine := "LineTest1!" ;--- text
var_ARGB := 0xFF000000 ; -------- Alpha,Red,Green,Blue
var_UseBlackBG := 0 ; ----------- boolean, use black background
var_UseBold := 1 ; -------------- boolean, use bold text
var_FontSize := 20 ; ------------ font size (in units)
var_FontFamily := 0 ; ----------- 0 = SWISS (proportional) --- 1 = MODERN (monospace)
var_ShowText := 0 ; ------------- boolean, show text or not

Return

; =========================================

; F12 toggles the overlayed text by toggling
; library loaded or not via GPF_Main()
F12::

; If not loaded, open/load library, otherwise close/free library
;
; Return values for GPF_Main():
;  1 = Success (load library)
; -1 = Fail (load library)
;  2 = Sucess (free library)
; -2 = Fail (free library)

GPF_Main()

; If library isn't loaded at this point, other
; functions will return ErrorLevel different
; than 0 and will simply not work (as expected).

; Boolean for showing text TRUE
var_ShowText := 1

; Current var_ObjNumer is 0, so it sets the data of the first SingLine Text Field
GPF_SetSingleLine(var_ObjNumber,var_PosX,var_PosY,var_TextLine,var_ARGB,var_UseBlackBG,var_FontSize,var_UseBold,var_FontFamily)

; Shows the SingleLine Text Field number 0 (the first one)
GPF_ShowSingleLine(var_ObjNumber,var_ShowText)

Sleep, 1000

; Now previous text will be replaced by a new one
GPF_SetSingleLine(var_ObjNumber,var_PosX,var_PosY,"Test number 2!",var_ARGB,var_UseBlackBG,var_FontSize,var_UseBold,var_FontFamily)

Return

; =========================================
Download Example 2
; =========================================

;
; Example function - f_Change_SL_Text_0
;
; Function to change only the text parameter
; of SingleLine Text Field number 0.
; All other parameters are fixed.
; A static variable checks if text really changed.
; Must have GPF_v1.1c.ahk included, of course.
;

f_Change_SL_Text_0(newText)
{
  static oldText
  if ( oldText = newText )
    return "NoChange"  ;  indicates I'm performing an unecessary attempt to change text
  oldText := newText
  return GPF_SetSingleLine(0,100,100,oldText,0xFFFFFFFF,0,20,1,0)
}

; =========================================
Download Example 3
; =========================================
;
; This example shows usage of picture functions
;
; =========================================

#Include GPF_v1.1c.ahk

; -- Picture X position
var_PosX := 100
; -- Picture Y position
var_PosY := 150
; -- Boolean for showing picture
var_ShowPic := 0
; -- Picture to be shown (MUST BE FULL PATH)
var_PicFullPath := "C:\My Folder\This is a full path\picture.png"

Return

;

; -- Pressing F10 will toggle library via GPF_Main()
F10::GPF_Main()

; -- Pressing F11 will set desired picture
F11::GPF_SetPicture(var_PicFullPath)

; -- Pressing F12 will toggle
; picture display once the library
; is loaded and the picture is set
F12::

var_ShowPic := !var_ShowPic

GPF_ShowPicture(var_ShowPic,var_PosX,var_PosY)

Return

; =========================================


Источник: http://forum.script-coding.com/viewtopic.php?id=9840


Поделись с друзьями



Рекомендуем посмотреть ещё:



Похожие новости


Как десерт можно сделать из яблок
Как сделать из бутылки глушитель
Сиденья для ваз 2109 своими руками
Как сделать схему кораблика
В домашних условиях определить группу крови


Как сделать в центре экрана прицел
Как сделать в центре экрана прицел


Точка по центру на мониторе - Вопросы - Escape from Tarkov Forum
Как сделать чтобы прицел был всегда в одном месте экрана? - Вопросы по



ШОКИРУЮЩИЕ НОВОСТИ