Jump to content

Pixelsearch help


Recommended Posts

Hi guys!

I am starting to know how pixelsearch and i have no problem finding my pixel on screen.

I have a picture here that shows what i want to do to make the script better:

Posted Image

I want to search for the red pixel.

When i find it i want to hold down the button A so the screen rotates. When the red pixel is inside the black square i want it to stop pressing A.

I then want it to rightclick on that pixel and then press F :)

I know basic pixelsearch, Send("{a down}"), Send("{a up}") and some more but i don't know how to scan this and rotate. Any suggestions?

Link to comment
Share on other sites

This is what i have now:

Global $Paused
Hotkeyset("{HOME}","attack")
Hotkeyset("{END}","stop")
HotKeySet("p", "TogglePause")

$RED=0xFF1432;Red name above head
$YEL=0xFFDAFD;Yellow circle around enemy
$TAR=0x9F1B0B;Red circle around enemy
look()

while 1
pixel()
WEnd

Func look()
If Not WinActive("Requiem","") Then WinActivate("Requiem","");Switch window
WinWaitActive("Requiem","")
sleep (200)
EndFunc

Func pixel()
while 1
$coord = PixelSearch( 894, 140, 1008, 588, $TAR, 50 );Target Enemy
If @error Then
Send("{a down}")
sleep(300)
Send("{a up}")
send("f")
    
    sleep (100)
    send("{TAB}")
    sleep(50)
    send("2")
Else
    sleep(500)
MouseClick ("right", $coord[0],$coord[1], 1, 1);Click Enemy
sleep(1000)
Send("{a down}")
sleep(300)
Send("{a up}")

EndIf


$coord = PixelSearch( 988, 988, 1099, 1099, 0x1E8F1B, 20 );HP bar scanning for buff
If @error Then
    Send("´")
EndIf

WEnd
EndFunc

Func TogglePause()
   $Paused = NOT $Paused
   
   while $Paused
     sleep(100)
   Wend
EndFunc

Func stop()
Exit
EndFunc
Link to comment
Share on other sites

  • 3 months later...

Hmm I tried to make a bot for this but there is some sort of AntiHack software included in Requiem. I can't simulate keypresses, nothing happens except for the mouse cursor is flickering

Link to comment
Share on other sites

I was actually doing something very similar to this for another game, the problem I had is it was too slow to work effectively. I basically had it push the button until a pixel reached a certain area, it always picked up the pixel, but sometimes it would turn past that range, sometimes it would barely turn fast enough. Lets take degrees for example, lets say it has to turn at least 90 degrees. Sometimes it would turn exactly 90 degrees, other times it would turn 95-100 degrees. This would still work for what I was using it for, but it wasnt as precise as I had hoped.

Basically you would do something like:

Func rotate()
    Send("{a down}");push and hold A
    while 1
        $coord = PixelSearch( 894, 140, 1008, 588, WHATEVER_COLOR, 50 );search for the red color, MAKE SURE you change the coordinates to that of the box you want to search in.
        If Not @error Then;if it finds the red color
            ExitLoop
        EndIf
                        Sleep(100);Just so you dont slam the processor
    WEnd
    Send("{a up}");Loop exited so stop holding A

    sleep(500)
    MouseClick ("right", $coord[0],$coord[1], 1, 1);Click Enemy

    send("f")

That should hold A down, infinite loop looking for red, if it finds it, it breaks out of the loop which continues the rest of the script.

On a side note, I am not 100% sure that will work, but it should give you an idea of how to do it.....for my program I actually did it differently because I completely forgot you could have it hold keys down. (I knew like ALTDOWN and stuff but forgot you could do {a down}, {d down} etc)

Edited by mwpeck
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...