Sign in to follow this  
Followers 0
Metigue

Help with my timers and NOT operator.

4 posts in this topic

#1 ·  Posted (edited)

I'm trying to create a simple but effective FFR bot, I want a timer that loops the pixelget's about every 25 ms and checks the pixelgets against the pixel that they normally are and if they are not that pixel to press the arrow key that that coordinate requires, I need help with getting my timers right and the use of my not operator because it doesn't work atm :)

This is what I have so far for the part I am having trouble in:

CODE
While $bot = 1

$Start = TimerInit()

While 1

If TimerDiff($Start) > 25 Then

If TimerDiff($Start) < 50 Then

$var = PixelGetColor(399, 633)

$var2 = PixelGetColor(470, 635)

$var3 = PixelGetColor(536, 631)

$var4 = PixelGetColor(606, 632)

If $var = not (0x210504) then

Send("{LEFT}")

EndIf

If $var2 = not (0x210504) then

Send("{DOWN}")

EndIf

If $var3 = not (0x210504) then

Send("{UP}")

EndIf

If $var4 = not (0x210504) then

Send("{RIGHT}")

EndIf

$Start = TimerInit()

EndIf

EndIf

WEnd

WEnd

Edited by Metigue

Share this post


Link to post
Share on other sites



Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Look at the operators in the helpfile.

If $var <> "blah" Then MsgBox (0, "", "$var is not equal to blah!")

Cheers

Brett

Thanks, lol this is my first script :) heh, lol. Any help with my timers or is there a simpler way to get it to loop till it finds an irregularity? EDIT: Fixed the timers :) lol. Edited by Metigue

Share this post


Link to post
Share on other sites

Not sure what you mean there, but this is okay for me... :)

$bot = 1
While $bot = 1
    $Start = TimerInit()
    While 1
        $diff = TimerDiff($Start)
        If $diff >= 25 And $diff <= 50 Then
            $var = PixelGetColor(399, 633)
            $var2 = PixelGetColor(470, 635)
            $var3 = PixelGetColor(536, 631)
            $var4 = PixelGetColor(606, 632)

            If $var <> 0x210504 Then
                Send("{LEFT}")
            EndIf

            If $var2 <> 0x210504 Then
                Send("{DOWN}")
            EndIf

            If $var3 <> 0x210504 Then
                Send("{UP}")
            EndIf

            If $var4 <> 0x210504 Then
                Send("{RIGHT}")
            EndIf
            $Start = TimerInit()
        EndIf
    WEnd
WEnd

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