RedX Posted April 29, 2011 Posted April 29, 2011 I need help with the pixelsearch Basically what I want is to be able to assign the search to more than one pixel, like assigning it to a certain colour INCLUDING similar pixel colours (exemple, blue/lightblue) I'm making basic bots, for games or for Windows, already did a AutoTalk for Msn (afk talk "Not here") and some others. this is my search $coord = PixelSearch (0, 0, @DesktopWidth, @DesktopHeight, 0x003CAB) And this is the WHOLE Script. ----------------------------- global $Paused HotKeySet ("{F8}","TogglePause") HotKeySet("{ESC}","Terminate") HotKeySet("{End}", "Stop") Hotkeyset("{Home}", "Restart") While 1 $coord = PixelSearch (0, 0, @DesktopWidth, @DesktopHeight, 0x003CAB) If NOT @error Then Sleep(1000) MouseClick("left", $coord[0], $coord[1], 2, 1) Sleep(1000) MouseMove(579, 446, 1) Sleep(500) Mouseclick("left") Sleep(500) Mousemove(547, 491, 1) Sleep(500) MouseClick("left") Endif Sleep(30000) Wend Func TogglePause () $Paused = NOT $Paused While $Paused Wend EndFunc Func Terminate () Exit 0 EndFunc Func Stop () MouseMove(1091, 349, 1) Sleep(500) MouseClick("left") EndFunc Func Restart() MouseMove(486, 660, 1) Sleep(500) Mouseclick("left") Sleep(500) MouseMove(644, 207, 1) Sleep(500) MouseClick("left") Sleep(500) MouseMove(579, 446, 1) Sleep(500) Mouseclick("left") Sleep(500) Mousemove(547, 491, 1) Sleep(500) MouseClick("left") Sleep(30000) EndFunc ------------------------------- The mousemove functions are atributed only on my PC due the exact coordinates, what I also want is to make it find the target without the coordinates, just by detecting the image, or something like that... because the pixel that I want to assign as the 2nd search is a 0x000000 (black), since there's lots of black pixels I switched the 2nd pixel search with the Exact MouseMove/MouseClick coordinates. I would be gratefull if someone helped ^^.
iamtheky Posted April 29, 2011 Posted April 29, 2011 I'm making basic bots, for gamesthere are plenty of examples if you search, but i doubt you will get much assistance providing incriminating ancillary information.http://www.autoitscript.com/forum/forum-2/announcement-12-game-bots-and-automation/ ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
RedX Posted April 29, 2011 Author Posted April 29, 2011 (edited) "...but i doubt you will get much assistance providing incriminating ancillary information."I see, I basically just do it for fun, not that I gain much from it besides experience, I need to start SOMEWHERE lol, for that I need to start creating some automation scripts, then I'll try and "lvl up" my scripting abilities PS: this script that I'm working on is not a bot for a game, it's for a windows program, Auslogic BoostSpeed, it's a program that cleanses your pc, making it run faster, I tryied to type this script run("BoostSpeed.exe") so I wouldn't need to pixel search it, still it works fine (the pixelsearch), the "run("BoostSpeed.exe")" function doesn't seem to work, and it works perfectly if I type run("notepad.exe").Still thanks for the link, even tho I can't see it because there's a "game" in the link so I can't see it, my dad blocked every link that inclues games, youtube or facebook in it lol... Edited April 29, 2011 by RedX
Valik Posted April 30, 2011 Posted April 30, 2011 I'm overly attempted to change this thread title to include "game" just so the user can't see it anymore because of the aforementioned parental block. Am I the only one who would find that hilarious?
RedX Posted April 30, 2011 Author Posted April 30, 2011 (edited) I'm overly attempted to change this thread title to include "game" just so the user can't see it anymore because of the aforementioned parental block. Am I the only one who would find that hilarious?My dad blocked it somehow, but he prefers that I do scripts than to play some games, I don't even play much lol, like 1 hour then it's back to study o.O. And how can you, Sir, find this hilarious? Edited April 30, 2011 by RedX
RedX Posted May 1, 2011 Author Posted May 1, 2011 hi again, I changed my options on PixelSearch and advanced to _ImageSearch, everything is fine, I have even put some ToolTips and MsgBox, but the thing is, i have just ths question... how to I make the image search reconigze the, well, Image, without having the .bmp files (image files) in your Computer, if you need those images then how do I make the script auto reconigze the User? For example the root of the desktop is C:\User\...(name of the user)\Desktop\File.bmp or C:\User\...(name of the user)\Desktop\Images\File.bmp. Any ideas? Here's the script #include-once #include <ImageSearch.au3> #include <IE.au3> MsgBox(0,"Instructions","Put the .bmp files in a New Folder in your C:\Users\Marcos\Desktop\Images. F8 to pause/ ESC to Stop script/ press END button if you want to stop the cleaning, Press ok to continue") Global $Paused HotKeySet("{ESC}","Terminate") HotKeySet("{END}","Stop") HotKeySet("{F8}", "Pause") $yes1 = GUICtrlCreateButton ("Yes", 10, 30, 50) $no1 = GUICtrlCreateButton ( "No", 0, -1) $x = 0 $y = 0 Send("{F8}") $ImageSearch = _waitforimagesearch("C:\Users\Marcos\Desktop\Images\shortcut.bmp",5,1,$x,$y,100) If $ImageSearch = 1 Then MouseMove($x,$y,50) Sleep(500) MouseClick("left",$x,$y, 2,10) Endif Sleep(1000) $ImageSearch = _waitforimagesearch("C:\Users\Marcos\Desktop\Images\arrow.bmp",5,1,$x,$y,100) If $ImageSearch = 1 Then MouseMove($x,$y,50) MouseClick("left",$x,$y, 1,10) $ImageSearch = _waitforimagesearch("C:\Users\Marcos\Desktop\Images\and repair.bmp",5,1,$x,$y,100) If $ImageSearch = 1 Then MouseMove($x,$y,50) MouseClick("left",$x,$y, 1,10) Endif Send("{F8}") Else MsgBox(0,"Information", "Unable to find target.") $text = Msgbox(4,"Information","Re-Search?") If $text = 6 Then $ImageSearch = _waitforimagesearch("C:\Users\Marcos\Desktop\Images\shortcut.bmp",5,1,$x,$y,100) If $ImageSearch = 1 Then MouseMove($x,$y,50) Sleep(500) MouseClick("left",$x,$y, 2,10) Endif Sleep(1000) $ImageSearch = _waitforimagesearch("C:\Users\Marcos\Desktop\Images\arrow.bmp",5,1,$x,$y,100) If $ImageSearch = 1 Then MouseMove($x,$y,50) Sleep(500) MouseClick("left",$x,$y, 1,10) $ImageSearch = _waitforimagesearch("C:\Users\Marcos\Desktop\Images\and repair.bmp",5,1,$x,$y,100) If $ImageSearch = 1 Then MouseMove($x,$y,50) MouseClick("left",$x,$y, 1,10) Endif Send("{F8}") Endif Elseif $text = 7 Then MsgBox(0,"Error","Search Canceled.") Exit 0 Endif Endif Func Terminate() Exit 0 EndFunc Func Stop() $ImageSearch = _waitforimagesearch("C:\Users\Marcos\Desktop\Images\Stop.bmp",5,1,$x,$y,100) If $ImageSearch = 1 Then MouseMove($x,$y,50) MouseClick("left",$x,$y, 1,10) EndIf MsgBox(0,"Information","Function Stopped.") Sleep(500) $text = MsgBox(4, "Information", "Restart Clean?") if $text = 6 Then $ImageSearch = _waitforimagesearch("C:\Users\Marcos\Desktop\Images\Back.bmp",5,1,$x,$y,100) If $ImageSearch = 1 Then MouseMove($x,$y,50) MouseClick("left",$x,$y, 1,10) Else MsgBox(0,"Information", "Unable to find 'Back' image") Endif $ImageSearch = _waitforimagesearch("C:\Users\Marcos\Desktop\Images\Scan Again.bmp",5,1,$x,$y,100) If $ImageSearch = 1 Then MouseMove($x,$y,50) MouseClick("left",$x,$y, 1,10) Endif $ImageSearch = _waitforimagesearch("C:\Users\Marcos\Desktop\Images\arrow.bmp",5,1,$x,$y,100) If $ImageSearch = 1 Then MouseMove($x,$y,50) Sleep(500) MouseClick("left",$x,$y, 1,10) Endif $ImageSearch = _waitforimagesearch("C:\Users\Marcos\Desktop\Images\and repair.bmp",5,1,$x,$y,100) If $ImageSearch = 1 Then MouseMove($x,$y,50) MouseClick("left",$x,$y, 1,10) Send("{F8}") Else $ImageSearch = _waitforimagesearch("C:\Users\Marcos\Desktop\Images\arrow.bmp",5,1,$x,$y,100) If $ImageSearch = 1 Then MouseMove($x,$y,50) Sleep(500) MouseClick("left",$x,$y, 1,10) Endif $ImageSearch = _waitforimagesearch("C:\Users\Marcos\Desktop\Images\and repair.bmp",5,1,$x,$y,100) If $ImageSearch = 1 Then MouseMove($x,$y,50) MouseClick("left",$x,$y, 1,10) Send("{F8}") Else MsgBox(0,"Information","Unable to find target, check if the window is visible or not minimized") Endif Endif EndIf Endfunc Func Pause() ToolTip("Script Paused, press F8 to resume",100,15,"Info",0,2) $Paused = NOT $Paused While $Paused WEnd ToolTip('') EndFunc
AdmiralAlkex Posted May 1, 2011 Posted May 1, 2011 Use @DesktopDir for the current users desktop folder. You could also use @ScriptDir for the scripts folder. See "Macro Reference" in helpfile for all macros. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
RedX Posted May 1, 2011 Author Posted May 1, 2011 (edited) Use @DesktopDir for the current users desktop folder. You could also use @ScriptDir for the scripts folder.See "Macro Reference" in helpfile for all macros.Hey thanks! Edited:Mhm... could you put in a sentence? I'm not sure where to put the @DesktopDir, because I want it o reconigze the files inside the folder Images likes C:\Users\...\Desktop\Images\File.bmp$ImageSearch = _waitforimagesearch("C:\Users\Marcos\Desktop\Images\shortcut.bmp",5,1,$x,$y,100)This is a script that searches a certain image located in Images Folder, and I want it to auto reconigze it in Different users and in that location. Edited May 1, 2011 by RedX
Jayson Posted May 1, 2011 Posted May 1, 2011 (edited) Like this I believe : $ImageSearch = _waitforimagesearch(@DesktopDir & "\Images\shortcut.bmp",5,1,$x,$y,100) Edited May 1, 2011 by Jayson
RedX Posted May 1, 2011 Author Posted May 1, 2011 (edited) Like this I believe : $ImageSearch = _waitforimagesearch(@DesktopDir & "\Images\shortcut.bmp",5,1,$x,$y,100) oh "&", ok thanks for your help . Edited May 4, 2011 by RedX
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now