here's a cheap way to get the poor code to work faster...
just run about 10 copies of my new code at the same time, its very fast and almost good enough for playing with. set for red, large red ranger and xr .05
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Code:
xr = 0.5
xm = 0.2 ;0.2
xl = 0.2 ;0.2
Process, priority, , Low
;mycolor = 0x00004d
RegRead, mycolor, HKEY_LOCAL_MACHINE, SOFTWARE\TestKey, colorcheck
;tooltip, %mycolor%
;sleep 4000
;mycolor = 0x060633
#SingleInstance Off
;;;;
con = 3
MouseMove 640, 500
crosshaircolor := 0x00FE00
screenwidth := 1280
screenheight := 1024
;CoordMode, Pixel, Relative
;CoordMode, Mouse, Relative
coordmode,mouse,screen
coordmode,pixel,screen
steady = 0
couy := 400
coux := 300
xx := 1
yy := 1
foundcolor := 0
StringMid, myl, mycolor, 3,2
StringMid, mym, mycolor, 5,2
StringMid, myr, mycolor, 7,2
myl = 0x%myl%
mym = 0x%mym%
myr = 0x%myr%
SetFormat, integer, d
myl -= 0
mym -= 0
myr -= 0
;Tooltip, %myl% %mym% %myr%
;sleep 400
;mycolor = 0xFFD8E8
foundx := MouseX
foundy := MouseY
;
; AutoHotkey Version: 1.1.2878+
; Language: English
; Platform: Win9x/NT
;
;
; Only run this script when bf2.exe is running in the foreground
;
;#SingleInstance force
#InstallKeybdHook
#InstallMouseHook
#NoEnv
SendMode, Input
;;;;;;;;;;;;;;;;;;;;;;;
loop
{
GetKeyState, you, u, P
GetKeyState, down, d, P
if you = D
{
xr += 0.05
if xr > 1
xr = 0.99
;xm += 0.05
;xl += 0.05
Tooltip, %xr% %color%
Sleep 200
}
if down = D
{
xr -= 0.05
if xr < 0
xr = 0
;xm -= 0.05
;xl -= 0.05
Tooltip, %xr% %color%
Sleep 200
}
GetKeyState, state, Space, P
if state = D
{
steady = 1
foundx := MouseX
foundy := MouseY
;MouseMove, 640, 480
MouseGetPos, MouseX, MouseY
;PixelGetColor, colorcheck, %MouseX%, %MouseY% ;;, Slow ; RGB
PixelGetColor, colorcheck, %crossx%, %crossy% ;;, Slow ; RGB
RegWrite, REG_SZ, HKEY_LOCAL_MACHINE, SOFTWARE\TestKey, colorcheck, %colorcheck%
mycolor = %colorcheck%
StringMid, myl, mycolor, 3,2
StringMid, mym, mycolor, 5,2
StringMid, myr, mycolor, 7,2
myl = 0x%myl%
mym = 0x%mym%
myr = 0x%myr%
SetFormat, integer, d
myl -= 0
mym -= 0
myr -= 0
}
MouseGetPos, MouseX, MouseY
;1152x864
ranger = %myr%
ranger *= %xr%
;if ranger = %0%
;ranger = 1
ranger = 162
rangeru := myr + ranger
rangerd := myr - ranger
;
rangel = %myl%
rangel *= %xl%
;if rangel = %0%
;rangel = 1
rangel = 10
rangelu := myl + rangel
rangeld := myl - rangel
;
rangem = %mym%
rangem *= %xm%
;if rangem = %0%
;rangem = 1
rangem = 10
rangemu := mym + rangem
rangemd := mym - rangem
;;;;;;;;;;;;;;;;;;;
;if (rangeru >= r && r >= rangerd)
;if (rangemu >= m && m >= rangemd)
;if (rangelu >= l && l >= rangeld)
{
;foundcolor = 1
;Tooltip, %rangemu% %rangemu% %m% %color%
}
;else
;foundcolor = 0
;Tooltip, %color%
;Sleep 400
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;if foundcolor = 1
;if mycolor = %color%
;if beer
if (rangeru > r && r > rangerd)
if (rangemu > m && m > rangemd)
if (rangelu > l && l > rangeld)
if steady = 0
{
Goto, ppp
;Tooltip, %ranger% %rangel% %rangem% %r% %l% %m% %color%
;Tooltip, %color%
foundx := coux
foundy := couy
movex := foundx
movey := foundy
movex -= %MouseX%
movey -= %MouseY%
;gg
;Tooltip, %foundx% ; %movex% %movey%
;sleep 400
;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;coux, foundx = position of pixel
;MouseX = position of mouse
superposx := MouseX*65535/screenwidth
superposy := MouseY*65535/screenheight
foundx := foundx*65535/screenwidth
foundy := foundy*65535/screenheight
movex := foundx
movex -= superposx
movey := foundy
movey -= superposy
movex := abs(movex)
movey := abs(movey)
;Tooltip, %superposx% %superposy% %foundx% %foundy% %movex% %movey%
;sleep 1400
;MouseEvent(foundx,foundy)
;if foundx > %superposx%
;MouseEvent(movex,0)
;if foundx < %superposx%
;MouseEvent(movex,0)
;if foundy > %superposy%
;MouseEvent(0,movey)
;if foundy < %superposy%
;MouseEvent(0,movey)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ppp:
foundx := coux
foundy := couy
;compare PixelGetColor to center of screen
;movex := 640
;movex -= %foundx%
;movey := 480
;movey -= %foundy%
;;;;;;;;;;;;;;;;;;;;;;;
if con = 1
{
;foundx := 300
;foundy := 300
movex := crossx
movex -= foundx
movey := crossy
movey -= foundy
;Tooltip, %crossx% %crossy% %foundx% %foundy% %movex% %movey%
;Tooltip, %holdx% %holdy% %foundx% %foundy%
;Sleep 500
;MouseEvent(movex,movey)
; .02
movex *= .02
movey *= .02
}
;;;;;;;;;;;;;;;;;;;;;;;;
if (holdx != foundx)
{
holdx := foundx
MouseEvent(-movex,0)
;sleep 400
;MouseMove crossx,crossy,
;tooltip, X moving
;sleep 1000
;;;;;;;;;;MouseEvent(-movex,0)
;tooltip, X set
}
if (holdy != foundy)
{
holdy := foundy
MouseEvent(0,movey)
;sleep 4
;MouseMove crossx,crossy
;tooltip, Y moving
;sleep 1000
;;;;;;;;;;;MouseEvent(0,movey)
;tooltip, Y set
;tooltip, %foundx% %foundy% %movex% %movey%
;sleep 500
}
;ppp:
g := 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;if foundx > %MouseX%
;MouseEvent(movex,0)
;if foundx < %MouseX%
;MouseEvent(movex,0)
;if foundy > %MouseY%
;MouseEvent(0,movey)
;if foundy < %MouseY%
;MouseEvent(0,movey)
;;;;;;;;;;;;;;;
;if foundx > %MouseX%
;MouseEvent(10,0)
;if foundx < %MouseX%
;MouseEvent(-10,0)
;if foundy > %MouseY%
;MouseEvent(0,10)
;if foundy < %MouseY%
;MouseEvent(0,-10)
;;;;;;;;;;;
;Tooltip, %color%
;sleep 100
;Tooltip, %myr% %myl% %mym% %r% %l% %m%
;RegWrite, REG_SZ, HKEY_LOCAL_MACHINE, SOFTWARE\TestKey, color, %color%
}
foundcolor := 0
if coux > 1000
{
coux := 300
couy += 5
}
if couy > 600
{
couy := 400
coux := 300
;break
}
coux +=5
PixelGetColor, color, %coux%, %couy% ;, Slow ;, Slow
;mix := coux*65535/screenwidth
;miy := couy*65535/screenheight
;MouseEvent (mix, miy)
;MouseMove, coux, couy
if color = %crosshaircolor%
if con = 3
{
;tooltip, found crosshairs!!!
;sleep 2000
crossx := coux
crossy := couy
con := 1
;MouseMove crossx,crossy
;sleep 2000
}
;Tooltip, %ranger% %rangem% %rangel% %r% %m% %l% %MouseX% %MouseY%
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
VariableContainingAnInteger := color
SetFormat, integer, d
VariableContainingAnInteger -= 0
SetFormat, integer, hex
;;;;;;;;;;;;;;
;color = 0x0102F0
String = %color%
StringMid, lefty, String, 3,2
StringMid, middly, String, 5,2
StringMid, righty, String, 7,2
l := lefty
m := middly
r := righty
l = 0x%l%
m = 0x%m%
r = 0x%r%
SetFormat, integer, d
l -= 0
SetFormat, integer, hex
;;
SetFormat, integer, d
m -= 0
SetFormat, integer, hex
;;
SetFormat, integer, d
r -= 0
SetFormat, integer, hex
;Tooltip, %r% %m% %l% %color%
addup = %r%%m%%l%
rback = %r%
SetFormat, integer, hex
rback += 0
SetFormat, integer, d
;;
mback = %m%
SetFormat, integer, hex
mback += 0
SetFormat, integer, d
;;
lback = %l%
SetFormat, integer, hex
lback += 0
SetFormat, integer, d
;;
if StrLen(lback) < 4
{
StringRight, lback, lback, 1
lback = 0%lback%
}
;
if StrLen(mback) < 4
{
StringRight, mback, mback, 1
mback = 0%mback%
}
;
if StrLen(rback) < 4
{
StringRight, rback, rback, 1
rback = 0%rback%
}
StringRight, ls, lback, 2
StringRight, ms, mback, 2
StringRight, rs, rback, 2
final = 0x%ls%%ms%%rs%
;Tooltip, %r% %m% %l% %color% %final% %lback% %mback% %rback% ; %ls% %ms% %rs%
;;;;;;;;;;;;;
;Tooltip, %color%
;Tooltip, %VariableContainingAnInteger%
}
MouseEvent(a_xpos, a_ypos)
{
DllCall("mouse_event", uint,1, int,a_xpos, int,a_ypos, uint,0, int,0 )
; DllCall("mouse_event", uint,0x8001, int,a_xpos, int,a_ypos, uint,0, int,0 )
}
;~$Space::
;Pause, Toggle,
;return
$Pause::
Pause, Toggle,
return
~$/::
;Pause, Toggle,
steady = 0
return
~Esc::
ExitApp
return
;~,::
;MouseMove crossx,crossy
;return