Sign in to follow this  
Followers 0
Metigue

IS there anyway to..

10 posts in this topic

#1 ·  Posted (edited)

Set a rectangle for it to search for more then one pixel using pixel search, having it look for more then one colour or just look for a colour change within the rectangle? Because atm I've made a ffr bot but its not registering the Arrows :/ Is this because the timer on my pixelget is too slow? or is it because I'm only searching for one dot of black to change colour?

If you haven't played the game you really should to know what I'm talking about

www.flashflashrevolution.com

I'm comfortable with posting my entire script here for analysing so here it is, Erm.. what else? oh yeah.. I'm not sure if I'm using While correctly here :) help?

CODE
Opt("WinWaitDelay", 100)

Opt("WinTitleMatchMode", 2)

Opt("WinDetectHiddenText", 1)

Opt("MouseCoordMode", 2)

Opt("PixelCoordMode", 2)

WinWait("FFR The Game FlashFlashRevolution.com - Windows Internet Explorer", "")

If Not WinActive("FFR The Game FlashFlashRevolution.com - Windows Internet Explorer", "") Then WinActivate("FFR The Game FlashFlashRevolution.com - Windows Internet Explorer", "")

WinWaitActive("FFR The Game FlashFlashRevolution.com - Windows Internet Explorer", "")

HotKeySet("{END}", "Terminate")

MouseMove(500, 500, 1)

MouseDown("left")

MouseUp("left")

$var = PixelGetColor(378, 578)

$var2 = PixelGetColor(454, 588)

$var3 = PixelGetColor(513, 588)

$var4 = PixelGetColor(590, 591)

$bot = 0

while $bot = 0

$Start = TimerInit()

While $Start = 1

If TimerDiff($Start) > 25 Then

If TimerDiff($Start) < 50 Then

$gamestart = PixelGetColor(500, 500)

if $gamestart <> "0x000000" Then

$bot = 0

Else

$bot = 1

EndIf

While $bot = 1

$Start2 = TimerInit()

While $start2 = 1

If TimerDiff($Start2) > 25 Then

If TimerDiff($Start2) < 50 Then

$var = PixelGetColor(378, 578)

$var2 = PixelGetColor(454, 588)

$var3 = PixelGetColor(513, 588)

$var4 = PixelGetColor(590, 591)

If $var <> "0x000000" then

sleep (25)

Send("{LEFT}")

EndIf

If $var2 <> "0x000000" then

sleep (25)

Send("{DOWN}")

EndIf

If $var3 <> "0x000000" then

sleep (25)

Send("{UP}")

EndIf

If $var4 <> "0x000000" then

sleep (25)

Send("{RIGHT}")

EndIf

EndIf

EndIf

If $Bot = 1 then $Start2 = TimerInit()

WEnd

If $Bot = 0 then $Start = TimerInit()

WEnd

EndIf

EndIf

WEnd

WEnd

Func Terminate()

Exit

EndFunc ;==>Terminate

Edited by Metigue

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I've waited an hour for a reply now :) so I'm bumping this back up.

Also it wont let me edit my post to include extra details, so I'm doing it here, and yes I used the search button, lol.

In the current script the coordinates are just above the arrows on the background which is normally black, but when an arrow passes over the black it wont be, so the loop I have set up (I think) is so it searches the 4 black pixels until atleast one of them is not black and then presses the corresponding key after waiting the appropraite delay time, I had to include the first while because otherwise the bot would just go crazy before the game started, I'm not sure if I have done it correctly

Edited by Metigue

Share this post


Link to post
Share on other sites

Metigue,

An hour is not long enough to wait before bumping your own post - normal etiquette in this forum is to wait for at least 24 hours.

Please remember that this is not a commercial 24/7 support desk. We are all individuals helping others as part of the large Autoit community. At the moment there is no-one online who is able or willing to offer a solution. Stick around and be patient and if someone can help they will.

If not - tough! :-)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Metigue,

An hour is not long enough to wait before bumping your own post - normal etiquette in this forum is to wait for at least 24 hours.

Please remember that this is not a commercial 24/7 support desk. We are all individuals helping others as part of the large Autoit community. At the moment there is no-one online who is able or willing to offer a solution. Stick around and be patient and if someone can help they will.

If not - tough! :-)

M23

Lol sorry, but I was watching other people get help who had just posted, and I don't need that much help I just want to know either how to set pixelsearch looking for more then one pixel, or how else to go about creating this Bot.

Share this post


Link to post
Share on other sites

Metigue,

If you ask a question which someone online can answer you will get a quick response - if not you might have to wait a bit. Luck of the draw I am afraid. As soon as someone appears who knows about PixelSearch and wants to help you create your bot I am sure you will get help.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

what would help you would be to put a

conolewrite("this $x event has been triggered"&@Lf)oÝ÷ Ú;¬¶Ú,yèʺw!j÷yéí®( z·jwZºÚ"µÍÛÛÛ]Ü]J  ÌÍÝ[Ð

so you can see in the console what has actually been detected.?

Edited by Aceguy

Share this post


Link to post
Share on other sites

what would help you would be to put a

conolewrite("this $x event has been triggered"&@Lf)oÝ÷ Ú;¬¶Ú,yèʺw!j÷yéí®( z·jwZºÚ"µÍÛÛÛ]Ü]J  ÌÍÝ[Ð

so you can see in the console what has actually been detected.?

That would probably help, but I've changed my script completely now and now I know its working because as soon as I start it I get about 500 boos, lol. So either Its always detecting my colour or my use of @error is wrong

New-ish Script:

CODE
Opt("WinWaitDelay", 100)

Opt("WinTitleMatchMode", 2)

Opt("WinDetectHiddenText", 1)

Opt("MouseCoordMode", 2)

Opt("PixelCoordMode", 2)

; Opt("SendKeyDelay", 0) ;200 milliseconds

WinWait("FFR The Game FlashFlashRevolution.com - Windows Internet Explorer", "")

If Not WinActive("FFR The Game FlashFlashRevolution.com - Windows Internet Explorer", "") Then WinActivate("FFR The Game FlashFlashRevolution.com - Windows Internet Explorer", "")

WinWaitActive("FFR The Game FlashFlashRevolution.com - Windows Internet Explorer", "")

HotKeySet("{END}", "Terminate")

;~ Click to Get Focusof Web flash object

MouseMove(500, 500, 1)

MouseDown("left")

MouseUp("left")

$bot = 1

While $bot = 1

$Start = TimerInit()

While 1

If TimerDiff($Start) > 2 Then

If TimerDiff($Start) < 5 Then

$left = PixelSearch( 365, 605, 435, 665, 0xEDF5FB )

$left2 = PixelSearch( 365, 605, 435, 665, 0xFFF590 )

$left3 = PixelSearch( 365, 605, 435, 665, 0xFFFF00 )

$left4 = PixelSearch( 365, 605, 435, 665, 0xEDFF00 )

$left5 = PixelSearch( 365, 605, 435, 665, 0x1EEFFF )

$left6 = PixelSearch( 365, 605, 435, 665, 0xB700FF )

$down = PixelSearch( 435, 605, 500, 665, 0xEDF5FB )

$down2 = PixelSearch( 435, 605, 500, 665, 0xFFF590 )

$down3 = PixelSearch( 435, 605, 500, 665, 0xFFFF00 )

$down4 = PixelSearch( 435, 605, 500, 665, 0xEDFF00 )

$down5 = PixelSearch( 435, 605, 500, 665, 0x1EEFFF )

$down6 = PixelSearch( 435, 605, 500, 665, 0xB700FF )

$up = PixelSearch( 505, 605, 570, 665, 0xEDF5FB )

$up2 = PixelSearch( 505, 605, 570, 665, 0xFFF590 )

$up3 = PixelSearch( 505, 605, 570, 665, 0xFFFF00 )

$up4 = PixelSearch( 505, 605, 570, 665, 0xEDFF00 )

$up5 = PixelSearch( 505, 605, 570, 665, 0x1EEFFF )

$up6 = PixelSearch( 505, 605, 570, 665, 0xB700FF )

$right = PixelSearch( 575, 605, 635, 665, 0xEDF5FB )

$right2 = PixelSearch( 575, 605, 635, 665, 0xFFF590 )

$right3 = PixelSearch( 575, 605, 635, 665, 0xFFFF00 )

$right4 = PixelSearch( 575, 605, 635, 665, 0xEDFF00 )

$right5 = PixelSearch( 575, 605, 635, 665, 0x1EEFFF )

$right6 = PixelSearch( 575, 605, 635, 665, 0xB700FF )

If $left or $left2 or $left3 or $left4 or $left5 or $left6 = Not @error then

Send("{LEFT}")

EndIf

If $down or $down2 or $down3 or $down4 or $down5 or $down6 = Not @error then

Send("{DOWN}")

EndIf

If $up or $up2 or $up3 or $up4 or $up5 or $up6 = Not @error then

Send("{UP}")

EndIf

If $left or $right2 or $right3 or $right4 or $right5 or $right6 = Not @error then

Send("{RIGHT}")

EndIf

$Start = TimerInit()

EndIf

EndIf

WEnd

WEnd

Func Terminate()

Exit

EndFunc ;==>Terminate

Now its detecting colours but.. all the time. lol, Am I using or and @error correctly?

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

i wrote this a while ago,... this will help u i think,...

http://www.autoitscript.com/forum/index.ph...c=81701&hl=

basically lets you get a pixel colour and state the variation... ie 10 shades away from green....

Edited by Aceguy

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

i wrote this a while ago,... this will help u i think,...

http://www.autoitscript.com/forum/index.ph...c=81701&hl=

basically lets you get a pixel colour and state the variation... ie 10 shades away from green....

It must look like I'm trying to incorporate many different shades of the same colour, but its just the many different coloured arrows ffr insists on using, I think my bot spams the keys because the pixels I chose are in the arrows at the bottom of the screen (All bots have to play in dark mode which doesn't entirely get rid of the arrows but helps)

I have made a ton of progress, It no longer spams the keys but only presses it when the arrow is approaching, Just have to get the timing right and does anyone know how to only make it send once? lol

Edited by Metigue

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