Jump to content

Metigue

Active Members
  • Posts

    30
  • Joined

  • Last visited

Everything posted by Metigue

  1. Ok change of question, Since Direct x 9 platforms block all methods of input besides direct, is there anyway of using autoit to create direct input?
  2. Read the edit of the post above you , Now any help? I previously thought MouseMove was global? Edit: It definitely has no trouble with finding the pixel, as it is finding it in screen captures of the forms, however, it will not move the mouse to the coordinates when running the form platform. Edit2: Does not work with ActivateWindow('FormHandler 2.0')
  3. I don't think I am in conflict with anything there, as this is for automation of form completion. Not for anything game related. Edit: The topic says games, Because form platform would have driven more people away from my thread. And that rule is a new addition since I joined over a year ago.
  4. I'm trying to code an autoclicker for form completion, Just for kicks. The forms are rendered inside of a direct X form platform, which is a fullscreen executable, the forms themselves are one click jobs on 3 different coloured options. The background of the form platform is all greyscale, so conflicting pixels is not a problem. However, when I'm in the form platform, my code will not move the mouse. I've never bothered with using ActiveWindow or whatever before in autoit, as it was never needed. Is this a possible solution? My code looks like this: Global $FormClicker = 0 Opt("MouseCoordMode", 0) Opt("PixelCoordMode", 0) Opt("MouseClickDelay", 0) Opt("MouseClickDownDelay", 0) Hotkeyset ("{HOME}", "FindForm") Hotkeyset ("{INS}", "FindClickForm") HotKeySet ("{End}", "TurnoffFormFinder") Global $searchcolor = 0xD1A177 Find() Func Find() While 1 If $FormFinder = 1 then $coord = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, $searchcolor) If IsArray($coord) = 1 Then MouseMove($coord[0], $coord[1], 0) EndIf EndIf If $FormFinder = 2 Then; Find + Click $coord = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, $searchcolor) If IsArray($coord) = 1 Then MouseClick('left', $coord[0], $coord[1], 1, 0) EndIf EndIf If $FormFinder = 0 Then sleep(1000) EndIf Wend EndFunc Func FindForm() $FormFinder = 1 Tooltip("FormFinder is Auto-Finding", 0, 0) Find() EndFunc Func FindClickForm() $FormFinder = 2 Tooltip("FormFinder is Auto-Clicking", 0, 0) Find() Endfunc Func TurnoffFormFinder() $FormFinder = 0 Tooltip("Formfinder is Off", 0 ,0) Find() Endfunc Any help would be appreciated
  5. I don't even know rofl try doing this instead of my if statements at the top: HotKeySet("{PGUP}", $Bot = 1) HotKeySet("{PGDN}", $Bot = 0)
  6. Thats odd, it's fine for me.
  7. In the program I have created, It searches the same pixel over and over for a change in the colour, although some colours I don't want it to register a change for, so I created a seperate program to find out all the colours that pass over my single pixel. However, I am distributing the program and on screen coordinates change depending on your resolution, so the colours change aswell, the beggining of the colour or group it is in does not change, so my question is, Is there a way of creating a range between two pixel colours or having a wildcard? So e.g. $Colour = 0x66**** or $colour = 0x66BBBB:0x999999
  8. It would end without doing anything lol. It's not finding the pixel and My timerdiff = 30, thats 30 MS not 30 seconds, lol 30000 MS = 30 seconds
  9. $bot = 0 ;Define bot if "{PGUP}" Then $bot = 1 ;when you press pageup make bot = 1 Endif if "{PGDN}" Then $bot = 0 ;when you press pagedown make bot = 0 Endif While $bot = 1 ;a simple loop, that is always on when bot = 1 $coord = PixelSearch(0, 0, 4, 187, 0xB20000) If @error Then ;it's better to do, if it fails first $Start = TimerInit() ;a timer that starts when it doesn't count the pixel Else ;Else function, meaning if that doesn't happen, then do this MouseClick("primary", $coord[0], $coord[1], 2) Sleep(5000) ;five seconds MouseClick("primary", 1230, 167) EndIf If TimerDiff($Start) > 30 Then ;when the timer is over 30 the script will exit Exit EndIf WEnd ;Ending the While loop I noted it, read what I wrote.
  10. I have a new problem. In my FFR bot the backlash of when you hit an arrow succesfully is triggering my bot to think another arrow is there, the colours of the backlash are around 0x201D18 0x201E18 0x201D19 0x201E19 0x20201A 0x20201B 0x201F19 and more, how would I set it to cover all the colours around that area? and how would I tell my if statement to ignore it? Example: The green dots are where I'm detecting a pixel change, I need to keep it there, but make it ignore the backlash. My code for the pixelchange is: $Start3 = TimerInit() While 1 If TimerDiff($Start3) > 1 Then $up = PixelGetColor(518, 394) If $Up <> 0x000000 and $U = 0 and $starter3 = 0x000000 then $U = 1 Send("{Up}") EndIf While $U = 1 $up = PixelGetColor(518, 394) if $up = 0x000000 then $U = 0 EndIf WEnd $Start3 = TimerInit() EndIf WEnd How would I make it so, that around those pixels 0x201D18 0x201E18 0x201D19 0x201E19 0x20201A 0x20201B 0x201F19 It will ignore it, like as in making that shade of colour within about 5 variations $badc The game is: http://www.flashflashrevolution.com/FFR_the_Game.php
  11. Its not my game, lol. Its a bot for the game, what my bot does, is it scans the black part just above the arrow (the green dots are the bits they scan) until its not black, then presses the corresponding key depending what part its scanning, when you do an arrow correctly though, the game gives that backlash that you can see above, so I need to exclude that from my IF statement, the backlash is actually causing me all the problems I have atm so when I exclude it, the bot will be completed . The problem with searching for a specific pixel in the arrows that are coming is that the arrows change colour and are thousands of tones, (they hate botters) http://www.flashflashrevolution.com/FFR_the_Game.php if you want to check it out.
  12. I don't really have a main script and also now I have a new problem, The backlash of the arrows is triggering my other arrows to go off, the colours of the backlash are around 0x201D18 0x201E18 0x201D19 0x201E19 0x20201A 0x20201B 0x201F19 and more, how would I set it to cover all the colours around that area? and how would I tell my if statement to ignore it? Example: The green dots are where I'm detecting a pixel change and its one of the only places where a pixel does actually change when an arrow goes across, so I need to keep it there, but make it ignore the backlash.
  13. I'm prefering the 4 seperate scripts, as it speeds up the check to about one every 0.3 ms which is quite good, and it is also all at the same time. I just need an incredibly simple GUI and to learn how to include them. Also does anyone know of a better way instead of $L = 0 / 1 to stop it from key spamming?
  14. Can you show me an example of how to do that? (I'm pretty new at autoit) If I run the 4 scripts together they all do everything twice for no reason apart from the last one I ran, but they all work perfectly by themselves. If I call or include them it wont happen (I think)
  15. your trying to run 2 events on the same loop $Start is a variable, make it $start2 if they are both different events, lol. And <> means if its not that colour
  16. OK, I made them all seperate scripts and now it works perfectly, If I build a gui script could I make it so all 4 scripts run through there?
  17. In that case is there any other way I can get it to consider my IF's all at exactly the same time? because if it doesn't my bot wont be able to do combos.
  18. Ok well in my ffr bot I have one loop currently: While $bot = 1 $Start = TimerInit() While 1 If TimerDiff($Start) > 1 Then $left = PixelGetColor(380, 394) $down = PixelGetColor(449, 394) $up = PixelGetColor(518, 394) $right = PixelGetColor(587, 394) $starter = Pixelgetcolor(735, 545) If $left <> 0x000000 and $L = 0 and $starter = 0x000000 then Send("{LEFT}") $L = 1 EndIf While $L = 1 $left = PixelGetColor(380, 394) if $left = 0x000000 then $L = 0 EndIf WEnd If $down <> 0x000000 and $D = 0 and $starter = 0x000000 then Send("{DOWN}") $D = 1 EndIf While $D = 1 $down = PixelGetColor(449, 394) if $down = 0x000000 then $D = 0 EndIf WEnd If $Up <> 0x000000 and $U = 0 and $starter = 0x000000 then Send("{Up}") $U = 1 EndIf While $U = 1 $up = PixelGetColor(518, 394) if $up = 0x000000 then $U = 0 EndIf WEnd If $Right <> 0x000000 and $R = 0 and $starter = 0x000000 then Send("{Right}") $R = 1 EndIf While $R = 1 $right = PixelGetColor(587, 394) if $right = 0x000000 then $R = 0 EndIf WEnd $Start = TimerInit() EndIf WEnd WEnd This searches for left, down, up, right in that order, but what I want is for it to search for them all at the same time, is it possible to create 4 loops that will run at the same time searching for those pixels seperately? If so, how do I do it?
  19. Whats this for? it ties in with elements of my ffr bot CODE$Start = TimerInit() While 1 If TimerDiff($Start) > 1 Then $pxcolor = PixelGetColor(665, 153) $pxcolor1 = pixelgetcolor (665,156) If $pxcolor AND $pxcolor1 <> 0x000000 then MouseClick("left",584,188,1,0) EndIf $Start = TimerInit() EndIf Wend Try that, should work perfectly. Although it will still loop after the bar is gone, but I can't not do that without the rest of your script, lol.
  20. What do you mean? If I take that code out it just spams the arrow key about 400 times for the one pixel while the key is being pressed, and is there anyway for it to check all of my if statements at the same time instead of one after the other? and to increase the speed of my loop by putting the whiles and ifs elsewhere? and people testing this, if its not working, change 392 to 394 on all of the getpixel coords, arrows have to be going to the top of the screen (default) and you have to be scrolled all the way up
  21. Thanks for the advice, and Its just to click in there to make sure the flash windows active, its not even necessary, what is switch-case? will it let me run more then 2 of the if statements at the same time.. e.g. for combos? and can you think of a better method then $L=1 then make it scan the pixel like a thousand times a second till its black again $L=0, because sometimes in FFR you get parts where theres too many notes for it to turn black again, and it gets stuck in that loop, all I want is it to press left once, and carry on with the cycle ignoring left till its black again
  22. Right. Entire source so far: (I'm ok with it as source will be public (without combos) when I'm done) CODEOpt("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(735, 545, 1) MouseDown("left") MouseUp("left") $bot = 0 $L = 0 $D = 0 $U = 0 $R = 0 while $bot = 0 $starter = Pixelgetcolor(735, 545) if $starter = 0x000000 Then $bot = 1 EndIf Wend While $bot = 1 $Start = TimerInit() While 1 If TimerDiff($Start) > 25 Then If TimerDiff($Start) < 50 Then $left = PixelGetColor(380, 394) $down = PixelGetColor(449, 394) $up = PixelGetColor(518, 394) $right = PixelGetColor(587, 394) $starter = Pixelgetcolor(735, 545) If $left <> 0x000000 and $L = 0 and $starter = 0x000000 then Send("{LEFT}") $L = 1 EndIf While $L = 1 $left = PixelGetColor(380, 392) if $left = 0x000000 then $L = 0 EndIf WEnd If $down <> 0x000000 and $D = 0 and $starter = 0x000000 then Send("{DOWN}") $D = 1 EndIf While $D = 1 $down = PixelGetColor(449, 392) if $down = 0x000000 then $D = 0 EndIf WEnd If $Up <> 0x000000 and $U = 0 and $starter = 0x000000 then Send("{UP}") $U = 1 EndIf While $U = 1 $up = PixelGetColor(515, 392) if $up = 0x000000 then $U = 0 EndIf WEnd If $Right <> 0x000000 and $R = 0 and $starter = 0x000000 then Send("{RIGHT}") $R = 1 EndIf While $R = 1 $right = PixelGetColor(587, 392) if $right = 0x000000 then $R = 0 EndIf WEnd $Start = TimerInit() EndIf EndIf WEnd WEnd Func Terminate() Exit EndFunc ;==>Terminate Yes its working, you can turn it on and go to http://www.flashflashrevolution.com/FFR_the_Game.php and if you don't scroll down it will AAA any song you choose that doesn't have combos in. Right, the thing I need help with is the timers, I have no idea about whats faster or slower, I kind of want.. about 50 checks a second? and Have I organised my code well? will it only read into the if statements if the events happened? or shall I move them outside of the loop? Also, How do I go about adding combos? should I do them as seperate IF statements or what? because I tried that and it failed epicly. And is there anyway for it to call my IF statements all at the same time instead of one after the other?
  23. 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
  24. 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: CODEOpt("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?
  25. 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.
×
×
  • Create New...