muzle6074 Posted January 4, 2008 Share Posted January 4, 2008 Hi guys! I'm making an anti-afk bot for an RPG I play because if you stand still for to long in a particular area then you get booted. The script currently sends ("{SPACE}") key stroke every 2 minutes. I didnt want this to be a consistent 2 minutes(because may get detected) so is there a way I could make it a randomized time between 90 & 120 seconds? Here is my current code... $szTitle = "World of Warcraft" WinWaitActive($szTitle);Wait for WoW window WinMove($szTitle, "", 0, 0, 1570, 1000);Move and resize WoW window While 1 = 1;While always True Sleep(120000) Send("{SPACE}") WEnd I was also wondering is there a way to find an x & y location in a game screen so I can perform a mouse click on a certain event? All help appreciated! - muzle6074 Link to comment Share on other sites More sharing options...
Aassdd Posted January 4, 2008 Share Posted January 4, 2008 I was also wondering is there a way to find an x & y location in a game screen so I can perform a mouse click on a certain event?PixelSearch(), i think it's a bit hard, especially with WoW. Btw, does the send(space) work? I thought it's blocked. Link to comment Share on other sites More sharing options...
Jex Posted January 4, 2008 Share Posted January 4, 2008 (edited) Sleep(Random(90000, 120000, 1)) for random jump. Edited January 4, 2008 by Jex My scripts : Immediate Window , My Web Browser , Travian , Text Effect , Characters & Words per minute or second , Image Editor (ImageMagick) , Matrix style background effect ( Screensaver ) , Mail Sender , Protectlinks decoder and Rapidshare links checker , Fonts Fetcher , Region determine , Compare pictures , Gradient color box , Mouse Coordinates, Colors, Pixel Search things , Encrypt/Decrypt and embeding file in jpeg thing , Hard disk space monitor , Reflex game , Multiplayer Tic Tac Toe , WLM ( MSN ) personal message changer Link to comment Share on other sites More sharing options...
muzle6074 Posted January 4, 2008 Author Share Posted January 4, 2008 (edited) Thanks for the quick response Aassdd Yes so far all keys I have sent to WoW have worked. EDIT: Thx Jex I'll see how it goes. Edited January 4, 2008 by muzle6074 Link to comment Share on other sites More sharing options...
muzle6074 Posted January 4, 2008 Author Share Posted January 4, 2008 Can anybody give me an example on how to use PixelSearch()? I want to find a button in the middle of the screen that's red or even if there is a way to click the middle of the screen using co-ords? Link to comment Share on other sites More sharing options...
Aassdd Posted January 4, 2008 Share Posted January 4, 2008 Can anybody give me an example on how to use PixelSearch()? I want to find a button in the middle of the screen that's red or even if there is a way to click the middle of the screen using co-ords?Use window info to get the buttons color code and use it with pixelsearch. Link to comment Share on other sites More sharing options...
muzle6074 Posted January 4, 2008 Author Share Posted January 4, 2008 Hey guys this is a practice script I use to test if I could get pixelsearch to work but as you can see I'm very new to this Can someone tell me the syntax please? $szTitle = "World of Warcraft" WinWaitActive($szTitle);Wait for WoW window WinMove($szTitle, "", 0, 0, 1570, 1000);Move and resize WoW window $rez = PixelSearch(CD140B) While 1 = 1;While always True Sleep(random(1000, 2000, 1)) MouseMove($rez) MouseClick("{LEFT}") Sleep(random(1000, 2000, 1)) Send("{SPACE}") WEnd Link to comment Share on other sites More sharing options...
Bonchen Posted January 4, 2008 Share Posted January 4, 2008 Can anybody give me an example on how to use PixelSearch()? I want to find a button in the middle of the screen that's red or even if there is a way to click the middle of the screen using co-ords?#Include <misc.au3> $Dll = DllOpen("User32.Dll") HotKeySet("{ESC}","qt") MsgBox(0,"HowTo","Hold your mouse over the color you want, then click mouse1") While 1 IF _IsPressed("01", $Dll) Then $pos = MouseGetPos() $var = PixelGetColor( $pos[0] , $pos[1] ) MsgBox(0,"The decmial color is", $var) MsgBox(0,"The hex color is", Hex($var, 6)) MsgBox(0,"Exit","Press ESC if you are done") EndIf WEnd DllClose($Dll) Func qt() Exit EndFunc This Script will give you the HEX and Decimal of the color. Sleep(1000) $c=PixelSearch(7,77,1245,922,4936024) If IsArray($c) Then MouseMove($c[0], $c[1]) This script will Move the mouse to the selected color. For more info lookup PixelSearch in the help file. Link to comment Share on other sites More sharing options...
muzle6074 Posted January 4, 2008 Author Share Posted January 4, 2008 Thanks for prompt response Bonchen! Where do i put that in my script? also u got msg boxs in there which i cant have in game or is that an example script? All I'm wanting to do is find 1 pixel in the game window. Link to comment Share on other sites More sharing options...
Bonchen Posted January 4, 2008 Share Posted January 4, 2008 (edited) Thanks for prompt response Bonchen!Where do i put that in my script? also u got msg boxs in there which i cant have in game or is that an example script? All I'm wanting to do is find 1 pixel in the game window.The MsgBoxes are there to help you, however you can remove all the MsgBoxes except MsgBox(0,"The decmial color is", $var) andMsgBox(0,"The hex color is", Hex($var, 6)), Because you need the color. Oh and by the way, you can save this script as "Color.au3"I think you can but the PixelSearch whereever you want. Edited January 4, 2008 by Bonchen Link to comment Share on other sites More sharing options...
muzle6074 Posted January 4, 2008 Author Share Posted January 4, 2008 Thanks again for the prompt response but I'm still struggling to comprehend how PixelSearch() works. Please dont laugh at me $szTitle = "World of Warcraft" WinWaitActive($szTitle);Wait for WoW window WinMove($szTitle, "", 0, 0, 1570, 1000);Move and resize WoW window While 1 = 1;While always True Sleep(random(1000, 2000, 1)) $c=PixelSearch(7,77,1245,922,4936024) If IsArray($c) Then MouseMove($c[0], $c[1]) MouseClick("{LEFT}") Sleep(random(1000, 2000, 1)) Send("{SPACE}") WEnd Can you please explain the parameters in PixelSearch()? I might understand better. Link to comment Share on other sites More sharing options...
Bonchen Posted January 4, 2008 Share Posted January 4, 2008 (edited) Thanks again for the prompt response but I'm still struggling to comprehend how PixelSearch() works. Please don’t laugh at me… $szTitle = "World of Warcraft" WinWaitActive($szTitle);Wait for WoW window WinMove($szTitle, "", 0, 0, 1570, 1000);Move and resize WoW window While 1 = 1;While always True Sleep(random(1000, 2000, 1)) $c=PixelSearch(7,77,1245,922,4936024) If IsArray($c) Then MouseMove($c[0], $c[1]) MouseClick("{LEFT}") Sleep(random(1000, 2000, 1)) Send("{SPACE}") WEnd Can you please explain the parameters in PixelSearch()? I might understand better.First you need to run the color script i gave you. Then go ingame and press mouse1 on the red color. When a window called "The decimal color is" pops up, you go to you'r script and type in the numbers that are shown in the popup window on this line: $Color =. So the code will look like this. $szTitle = "World of Warcraft" WinWaitActive($szTitle);Wait for WoW window WinMove($szTitle, "", 0, 0, 1570, 1000);Move and resize WoW window $Color = TheNumbersYouGot While 1 = 1;While always True Sleep(random(1000, 2000, 1)) $c=PixelSearch(5,8,1277,968,$Color) If IsArray($c) Then MouseClick("Left",$c[0], $c[1],1,0) Sleep(random(1000, 2000, 1)) Send("{SPACE}") WEnd I hope you understand. I'm not very good at explainig. Oh and by the way, the script I posted should work. Edited January 4, 2008 by Bonchen Link to comment Share on other sites More sharing options...
muzle6074 Posted January 4, 2008 Author Share Posted January 4, 2008 Thanks again Bonchen for your input. Yes I do understand it a bit better now and the script sort of works. I'm struggling to get it to select the right color but ill get there in the end I was just wondering what the parameters "5,8,1277,968" mean in $c=PixelSearch(5,8,1277,968,$Color) Link to comment Share on other sites More sharing options...
Bonchen Posted January 4, 2008 Share Posted January 4, 2008 Thanks again Bonchen for your input. Yes I do understand it a bit better now and the script sort of works. I'm struggling to get it to select the right color but ill get there in the end I was just wondering what the parameters "5,8,1277,968" mean in $c=PixelSearch(5,8,1277,968,$Color)5,8 Is The coordinate of the top left corner of World of Warcraft. 1277,968 Is The coordinate of the bottom right corner of World of Warcraft. PixelSearch searches after the color between these two coordinates. If you want the script to use other coordinates you can use this scritp: #Include <misc.au3> $Dll = DllOpen("User32.Dll") HotKeySet("{ESC}","qt") While 1 IF _IsPressed("01", $Dll) Then $pos = MouseGetPos() MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1]) EndIf WEnd DllClose($Dll) Func qt() Exit EndFunc This works exactly as the Color script. Link to comment Share on other sites More sharing options...
muzle6074 Posted January 5, 2008 Author Share Posted January 5, 2008 Thank you so much Bonchen! I understand the functionality of pixel search now and your little scripts you made for me have been a great help! Regards - muzle6074 Link to comment Share on other sites More sharing options...
DirtDBaK Posted January 5, 2008 Share Posted January 5, 2008 you do know this is a noob post for a reason right?... [center][/center] Link to comment Share on other sites More sharing options...
muzle6074 Posted January 5, 2008 Author Share Posted January 5, 2008 Hi DBak, What are you referring to? If you mean how noob I am at Autoit then yes I only just started 2-3 days ago lol. The script works and prevents me from been booted from my game so it's an anti afk script as I wanted Link to comment Share on other sites More sharing options...
DirtDBaK Posted January 5, 2008 Share Posted January 5, 2008 Hello, I want you to know a little about me, DBaK, I love to help and inspire noobs BUT I highly dislike users (mostly noobs do this) that make bots to cheat in there games. You are the ones that take all the fun out of it. But, if you need help with a real script that has a non-cheating purpose I'd be glad to help! Like my media player it has an actual purpose, and it isn't helping me cheat when I play my games. Not trying to be an A$$ to you or just be red with noobs but I dislike bots. Besides that I'm really cool... [center][/center] Link to comment Share on other sites More sharing options...
muzle6074 Posted January 5, 2008 Author Share Posted January 5, 2008 DBak, That's understandable. It does take the fun out of the game but in this specific game (World of Warcraft) there is a major AFK problem and the team I have to side with has 98-99% lose rate which defeats the purpose of playing. Having an AFK script means that I don't have to waste my time until they fix the problem. Don't get me wrong I know where youre coming from. - muzle6074 Link to comment Share on other sites More sharing options...
DirtDBaK Posted January 5, 2008 Share Posted January 5, 2008 good I'm glad you undstand lol see here for another nagging of bot requestsAnyway I can understand that situtation but I still will not help with a bot I don't have many posts but I am skilled scripter and I like helping noobs with USEFULL things so let me know if you need help! [center][/center] Link to comment Share on other sites More sharing options...
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