DWad
Active Members-
Posts
22 -
Joined
-
Last visited
DWad's Achievements
Seeker (1/7)
0
Reputation
-
VIRTUAL MACHINES..specific question
DWad replied to Thornhunt's topic in AutoIt General Help and Support
Using virtual box in seamless mode (requires a little work to set up, but it's not too bad), you should be able to use a blind send just fine, I don't know about a control send though (I don't think it will know which control it's looking at). The mouse can go seamlessly between clicking the virtual machine and the host machine, so normal clicking shouldn't be a problem. -
Checksum starting from unknown coordinates?
DWad replied to DWad's topic in AutoIt General Help and Support
I'm sure someone will have some sort of input on this.. The way I got it to work was to search a small area of the screen that I knew would have the image I was looking for, but what if you're searching the whole screen? -
Oh ok I got you now. You can hit print screen and paste the image into paint, then use the image to get the pixel color you're looking for. Only problem then is that if your game is still blocking the colors (if that's possible..) you still wouldn't be able to get checksums directly from the game. As a workaround you could have it use print screen and paste it into paint, do your checksum, close paint, then have it click where you want. That would definitely be a pain though.
-
Could you post your script? I don't quite understand your question.. The checksum basically takes an image and turns it into a unique number, the same image will always translate into the same unique number.
-
Hey guys. I'm trying to write a script that looks for a checksum of an image that moves around a lot (not fast, but once every few minutes or so). If I got a checksum starting with every pixel on the screen, that would probably take a lot of time, right? Even at 800x600 resolution, I'm guessing it would take awhile. Is there a better way to find an image that's always exactly the same image, but in different places? If not, is there an easy way (or a script even) to get a checksum in relation to mouse coordinates (right now my problem is that the cursor changes, so I don't know exactly how far away the image is that I want to checksum.. Thanks! -DWad
-
Pixelgetcolor returns the color of a pixel at specified coordinates. Make sure your coordinates aren't on a white square (hence the 0-00000). The easiest way is to use the autoit window info tool (included with the autoit download). Hover your mouse over a color, and it can tell you the color code for that color.
-
Hey all. I wrote a pretty basic script for clicking through a user-defined amount of squares, source is on http://newtechrevolution.blogspot.com. I also wrote a tree harvester (also available on the page) Source for tree harvester is- While 1 HotKeySet ("{pause}", "HarvestTree") HotKeySet ("{9}", "HarvestTreeOp") HotKeySet ("{esc}", "exitScript") WEnd Func exitScript() Exit EndFunc Func HarvestTree() $startPos = MouseGetPos() For $i = 30 to 1 Step -1 $pos = MouseGetPos() MouseMove($pos[0]-4,$pos[1]-2, 1) MouseClick("left") $pSum = PixelChecksum($pos[0],$pos[1],$pos[0]+15, $pos[1]+53) If $pSum = 1847393948 Then $tPos=MouseGetPos() MouseMove($tPos[0]+1,$tPos[1]+1) MouseClick("left",$pos[0]+15, $pos[1]+53) mousemove($startPos[0],$startPos[1]) HarvestTree() Sleep (4000) EndIf Next $pos = MouseGetPos() EndFunc Func HarvestTreeOp() $startPos = MouseGetPos() For $i = 30 to 1 Step -1 $pos = MouseGetPos() MouseMove($pos[0]+4,$pos[1]-2, 1) MouseClick("left") $pSum = PixelChecksum($pos[0],$pos[1],$pos[0]+15, $pos[1]+53) If $pSum = 1847393948 Then $tPos=MouseGetPos() MouseMove($tPos[0]+1,$tPos[1]+1) Mouseclick("left",$pos[0]+15, $pos[1]+53) mousemove($startPos[0],$startPos[1]) HarvestTreeOp() Sleep (4000) EndIf Next $pos = MouseGetPos() EndFunc Pretty simple, just clicks from bottom right to upper left tree until it sees the checksum for the 'harvest' button pop up (in relation to mouse position), clicks it, and starts over again. Farmer must be trapped for it to be useful though.
-
Select Case / Selecting multiple cases?
DWad replied to DWad's topic in AutoIt General Help and Support
Zisly got me slightly closer. I ended up using a variable that would close the GUI after the Switch statements unless it got to the case else (which would set the variable to keep the GUI open). Is there no way to say something along the lines of "If case 1,2,3 or 4, do this, else do that"? -
Background - I have a Select Case statement with 18 possible cases. I want to close my GUI when one of those cases occurs, but for ALL other cases, I want to leave the GUI alone. The way I did it originally was to add a line to close the GUI in each of those 18 cases, but that means adding 18 more lines of code to do one function. Is there a way to say (for example) "If case = case 1 through case 18, then closeGUI()"? Or a better way to do this? Pseudo code of my current script- While1 Select Case 1 $msg=ms1 closeGUI() Case 2 $msg=ms2 closeGUI() Case 3 $msg=ms3 closeGUI() Case 4 $msg=ms4 closeGUI() EndSelect Wend For this particular script, the speed increase would be noticeable, but it makes my code look messy to have 18 extra lines of code, and I want to try to get my future scripts cleaner/faster. Thanks all, -DWad
-
My company currently uses Google Analytics to track web site usage statistics. However, using google analytics in an offline widget would be a huge pain (basically building in functionality that mirrors a web browser, if I understand correctly). I looked around but couldn't find a simple tracking script to add into an existing piece of software (we don't write the software ourselves, we hire other companies, and I don't have the compiler or anything like that to directly edit their code, although we could probably just tell them what to add in). If anyone knows of a script or program or something that does this, a link would be appreciated. My idea was to build in an auto-it script that opens up the program, but also sends our servers some small piece of information to identify the user, such as an IP address (which we could analyze ourselves or something like that I guess). Either that or get the program to open a browser window with one of our webpages once in awhile and track stats for that page with google analytics.. We had a program that was a flop, and out of the relatively few downloads it had, we have no idea if anyone is actually still using it, so for the next version of it we would like to be able to track this information. As usual, your help is much appreciated. -D
-
Ok figured it out..after a quick skimming back through the help file again. Seems you can't set just shift, control, or alt as a hotkey, you have to combine them with someone else. Thanks again for the help.
-
Ah ok, I had an extra variable for the TimeDiff I think, I'll try that out, thanks Danwilli. As for question 2, the functions themselves are working fine, the only thing I did was change PgDn to LSHIFT or LCTRL to have it set to a different hotkey. I'll post up the code later, probably an id-10-T error in there somewhere.
-
Ok so first off, I'm trying to write a loop that will run for x seconds. I have unworking code that repeats the script indefinitely.. Could someone post a sample of how to repeat for x milliseconds? I know that I should use timeInit and timerDiff but I haven't gotten anywhere with them, I guess I just don't understand exactly how they work (yes I read the helpfile ) Also, I have a GUI with a button to set a hotkey to PgDn. GUICtrlSetOnEvent($bindTo1Button, "bind1") and Func bind1() HotKeySet ("{pgDn}", "sendWhat") EndFunc This part works fine. However, I have 2 other function set up the same way replacing pgDn with LSHIFT or LCTRL and when I try to use them the same way nothing happens. Any idea here or do I need to supply some more info? Thanks guys.
-
Haha, I mod another forum and I see users say 'closed'. It's amusing.
-
Still need help with this. If you need proof that I'm actually doing this before helping me (understandable), I can send you the source so far via pm or email or whatever. Thanks again guys. -DWad