Sign in to follow this  
Followers 0
vivec45

I need help finding a script

4 posts in this topic

#1 ·  Posted (edited)

Is it possible to create a script that does the following?

I want this script to be like this:

while 1

If(color of pixel under mouse = red) Then

MouseClick("left")

sleep(500)

wend

while 1

sleep(1)

wend

(Yes, I am aware the If statement is rubbish, thats just what I want it to do lol)

Keep in mind, I only want to check a very small area around the mouse, this script is for Counter-Strike:Source

Thank you,

Vivec45

Edited by vivec45

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Is it possible to create a script that does the following?

I want this script to be like this:

while 1

If(color of pixel under mouse = red) Then

MouseClick("left")

sleep(500)

wend

while 1

sleep(1)

wend

(Yes, I am aware the If statement is rubbish, thats just what I want it to do lol)

Keep in mind, I only want to check a very small area around the mouse, this script is for Counter-Strike:Source

Thank you,

Vivec45

While 1

$pos = MouseGetPos()

$pixel = PixelGetColor ($pos[0], $pos[1])

If $pixel = redcolor (you need to find it =)) Then

MouseClick ("Left", $pos[0], $pos[1])

EndIf

WEnd

Add a few sleeps in the code so it doesn't use all CPU :D

Edited by mafioso

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

While 1

$pos = MouseGetPos()

$pixel = PixelGetColor ($pos[0], $pos[1])

If $pixel = redcolor (you need to find it =)) Then

MouseClick ("Left", $pos[0], $pos[1])

EndIf

WEnd

Add a few sleeps in the code so it doesn't use all CPU :D

This is my original code, seems to be very similar yours, yet does not work:

Global $Paused
HotKeySet("{F1}", "Stop")
HotKeySet("{F2}", "Quit")

;Pause on start
Stop()

;Pixel Search Color
;$left = "1"
;$top = "1"
;$right = "1"
;$bottom = "1"
;$shadevar = "1"
;$step = "1"
$color = "0xff0000"
$delay = "250"
$pos = MouseGetPos()
$curcolor = PixelGetColor($pos[0], $pos[1])

While 1
If $curcolor = $color Then
MouseClick("left", $pos[0], $pos[1], "", "")
Sleep($delay)
EndIf
WEnd

Func Stop()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Stopped',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Quit()
    Exit
EndFunc

The script is supposed to check if the pixel under the mouse is red, triggering left clicks until it isn't red any more.

Anybody know why it's not working? (I do unpause it first)

Edited by vivec45

Share this post


Link to post
Share on other sites

HI,

Global $Paused
HotKeySet("{F1}", "Stop")
HotKeySet("{F2}", "Quit")

$color = 0xE26200; change THIS!!!
$delay = 25

While 1
    $pos = MouseGetPos()
    $search = PixelGetColor($pos[0], $pos[1])
    If $search = $color Then
;~       MouseClick("left", $pos[0], $pos[1], "", "")
        ConsoleWrite("FOUND" & @CRLF)
        Sleep($delay)
    EndIf
    ConsoleWrite($search & " " & $color & @CRLF)
WEnd

Func Stop()
    $Paused = Not $Paused
    While $Paused
        Sleep(100)
        ToolTip('Stopped', 0, 0)
    WEnd
    ToolTip("")
EndFunc  ;==>Stop

Func Quit()
    Exit
EndFunc  ;==>Quit

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0