BuddyBoy Posted June 9, 2006 Author Share Posted June 9, 2006 Ok so let me get this straight, cant i just get the x,y coord in the middle of each 40 box? you said that i hav eto get top left and botto mright of each box why cant i just get middle? And whats wrong with pixelsearch for this? just do an If/then statement for each box, if color gray appears in box 35 then click (of course that would have to be written in coding but tahts jsut example) Could those ideas work smoke n? or would i HAVE to do what you sed becuz i didnt learn the for/next and the pixelchecksum yet >.< Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 9, 2006 Moderators Share Posted June 9, 2006 (edited) Ok so let me get this straight, cant i just get the x,y coord in the middle of each 40 box? you said that i hav eto get top left and botto mright of each box why cant i just get middle? And whats wrong with pixelsearch for this? just do an If/then statement for each box, if color gray appears in box 35 then click (of course that would have to be written in coding but tahts jsut example) Could those ideas work smoke n? or would i HAVE to do what you sed becuz i didnt learn the for/next and the pixelchecksum yet >.<If there is a destinctive color for each item at the specific x an y location, then sure you could use just simply PixelGetColor(), I don't play your game or any online game for that matter, so I don't know what to expect from them, and I always assume the worse. Ideally, if each items color is unique in one specific x and y coord then you could use PixelGetColor() like:;Create arrays Local $xCoords[41] = ['', 100, 200, 300, etc...]; all the 1 x coords for each box Local $yCoords[41] = ['', 20, 30, 40, etc...]; all the 1 y coords for each box (same location as x) Local $itemColors[6] = ['', 0x000000, 0xFFFFFF, 0x940085, etc...]; all the colors for each item Local $itemDescription[6] = ['', 'Vase', etc...]; Each item description should match the color above location ie... 0x000000 = 'Vase' ;Create markers Local $FoundColor = 0, $ColorCount = '' ;Start loops For $xycount = 1 To UBound($xCoords) - 1 For $ColorCount = 1 To UBound($itemColors) - 1 If (PixelGetColor($xCoords[$xycount], $yCoords[$xycount]) == $itemColors[$ColorCount]) Then $FoundColor = 1 ExitLoop EndIf Next If $FoundColor = 1 Then ExitLoop Next ;Now you would have your item and if it were found If $FoundColor = 1 Then MsgBox(0, 'Info', 'Found Item: ' & $itemDescription[$ColorCount]) EndIfThis is not a "working example", the arrays are not finished, and these type of arrays the way they are designed need AutoIt Beta. Also, I think Simucal had done an "AIMBot" before, but I don't even know what that is to be honest or if it's for the same game. Edit: Had a For/Next loop that wasn't needed. Edited June 9, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
BuddyBoy Posted June 9, 2006 Author Share Posted June 9, 2006 Lol yours is so confusing. But i think i found a new way that might work the same way but easier only problem is, is my pixelchecksum must be wrong?If BitAND(GUICtrlRead($Checkbox_11), $GUI_CHECKED) = $GUI_CHECKED Then $checksum = PixelChecksum(959,332, 508,403) While $checksum = PixelChecksum(959,332, 508,403) Sleep(100) WEnd MouseClick("right", 800, 45) EndIf Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 9, 2006 Moderators Share Posted June 9, 2006 Lol yours is so confusing. But i think i found a new way that might work the same way but easier only problem is, is my pixelchecksum must be wrong?Mine is just 2 loops (your using one with a While)... and if you fill out the 40 x and y spots you'll be ok or if you only need the location of one then do it that way. Simple is not always correct. I guess I may be confused, but you circled 3 boxes so I assumed all 40.I gave you the foundation, now you need to build from it... If you have questions about anything specific I'd be glad to help, but after your last explination, PixelGetColor() seems to be more suitable to the task, and would prove to be much faster since it is only looking for 1 pixel. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
BuddyBoy Posted June 9, 2006 Author Share Posted June 9, 2006 I checked up on the pixelgetcolor, i alrdy know the color from the window help tool. I changed my course of plans a bit becuase my first one would take a bit longer so im going to do my next project first since it be faster. How come that script right on my last post doesnt work? It runs fine but the script itself dont work. It runs when i hit f5 etc but nothing happens. Any ideas? Link to comment Share on other sites More sharing options...
BuddyBoy Posted June 9, 2006 Author Share Posted June 9, 2006 Am i doing the right code here? Pixelchecksum would be the right code to do my script as i just put. But nothing happens, ive been looking around and i ahvent found anything, someone please help me lol Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 9, 2006 Moderators Share Posted June 9, 2006 Am i doing the right code here? Pixelchecksum would be the right code to do my script as i just put. But nothing happens, ive been looking around and i ahvent found anything, someone please help me lol Why don't you look at Simucals AIMBot and see if you can figure out a good/better/or just a simple solution in general. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
BuddyBoy Posted June 9, 2006 Author Share Posted June 9, 2006 Yes i ahve read that but thats not for my game lol, i wouldnt know how to make it for my game cuz al lthe chars have different skin colors and my allies might ahve same skin color as enemy so it would screw up. This project im working on right now is just a miner bot. Once the box gets full of ores (pixelchecksum the last box) it uses a scroll (and then further steps after that but those are easy) So all i need to find out is the pixelcehcksum of my last script i gave. Any idea smoke n? Link to comment Share on other sites More sharing options...
BuddyBoy Posted June 9, 2006 Author Share Posted June 9, 2006 Bump, any idea smoke? this last request i should be asking from autoit (hopefully ican figure all the rest out myself) but the next few days ill be working on stuf fi know how to do if i can figure this one thing out Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 9, 2006 Moderators Share Posted June 9, 2006 Bump, any idea smoke? this last request i should be asking from autoit (hopefully ican figure all the rest out myself) but the next few days ill be working on stuf fi know how to do if i can figure this one thing out No, sorry, I really don't have an idea... I don't play the game, so everything your saying to me, is like the code I showed you earlier to you Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
BuddyBoy Posted June 9, 2006 Author Share Posted June 9, 2006 Lol com on you know what im saying. For the alst of those 40 boxes i want it to do a pixelchecksum and if a pixel chagnes in that box i want it to go up and right click on the first box ( i got the coords for the boxes) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 9, 2006 Moderators Share Posted June 9, 2006 Lol com on you know what im saying. For the alst of those 40 boxes i want it to do a pixelchecksum and if a pixel chagnes in that box i want it to go up and right click on the first box ( i got the coords for the boxes)1 ... You have to do a PixelCheckSum() on each box that has a picture of what your looking for... if there are 5 different items you'll 5 different checksums... once you have those values, you'll do a PixelCheckSum on all 40 boxes, and the sum returned will tell you what is in the box based of the initial checksum you did. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
BuddyBoy Posted June 9, 2006 Author Share Posted June 9, 2006 Well say i KNOW the last box is going to have an iron ore (the gray one) Cant i just checksum the last box with that color? Link to comment Share on other sites More sharing options...
Steronius Posted June 10, 2006 Share Posted June 10, 2006 BUDDYBOY i think what you stated is that you want to pixelsearch only when item box is open and to NOT pixelseach when the item box is closed... CORRECT? if so think about this. open the item box and choose some very small area to calculate the pixelchecksum. for example choose the are that shows the close button. then later in your program, you check the checksum of the current screen and if it matches the checksum you recorded for an open item box, then you can check your ores; however if the checksum of the current screen does not match recorded checksum, then item box is closed therefore skip the ore check. Link to comment Share on other sites More sharing options...
BuddyBoy Posted June 10, 2006 Author Share Posted June 10, 2006 BUDDYBOYi think what you stated is that you want to pixelsearch only when item box is open and to NOT pixelseach when the item box is closed... CORRECT?if so think about this.open the item box and choose some very small area to calculate the pixelchecksum. for example choose the are that shows the close button.then later in your program, you check the checksum of the current screen and if it matches the checksum you recorded for an open item box, then you can check your ores; however if the checksum of the current screen does not match recorded checksum, then item box is closed therefore skip the ore check.Thx but i must have not detailed good enough. I want the pixelchecksum to check the LAST box in the item box. I will always ahve the item box open. So say i mine the very last ore and the checksum checks the last box and sees something changes (the new ore) it will right click on my specific spot. Hope its clearer now Link to comment Share on other sites More sharing options...
BuddyBoy Posted June 11, 2006 Author Share Posted June 11, 2006 Bump Link to comment Share on other sites More sharing options...
nfwu Posted June 12, 2006 Share Posted June 12, 2006 I think all the above people have already done a very good job of attempting to help you. Maybe I can write out the script in pesudocode? ;;This code would not run on any compiler. You have to translate it first. while 1 while;;Pixel Checksum of area where close button of the item box is correct, (Steronius' post) If;;Pixelcheck sum of last box of inventory is wrong;; Then ;;Rightclick on a specific spot. EndIf Sleep(100) wend Sleep(100) wend Now all you have to do is translate those comments into working code! #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() 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