Page 1 of 1

AutoIT help...

Posted: Sat Jun 09, 2007 8:27 pm
by Lith
I posted it here since we got some professional PK2 Editors, and maybe they know a little bit of AutoIT or scripting, and I don't think many people look in the questions and help forum too. Please don't post unless you know you can help and if this thread is in the violation of some rule I don't know about... remove it as well.

Okay, so I got this off from some forum... it's a AutoIT code where if SRO disconnects you overnight stalling, its supposed to shut SRO and make the computer shut down.

Code: Select all

$a=1
While $a==1
Sleep(1000)
If PixelGetColor(361,318)=0x424242 Then
If PixelGetColor(472,410)=0xDECE94 Then
 $a=0
 Shutdown(1)
EndIf
EndIf
WEnd


So I compiled it into .exe and left my stall overnight. So when I wake up, I find that I was disconnected due to the inspection. The script was on, but it didn't work. I find that the idea can be useful and would like to get help on it, then maybe most of you can use it too when you stall and get disconnected. Why leave the computer on for like a straight 8 hours? Thats waste of electricity. :/

Posted: Sat Jun 09, 2007 9:17 pm
by Cruor
Not sure of the legitimacy of discussing AutoIT here, but since you are just trying to shut down your computer I guess it's okay. There are two immediate ideas I have about why it doesn't work. Either you are using the wrong resolution (the script is designed for 1024x768) or the script maker's DC window was slightly off from the stock. Here's an image to illustrate:

Image

The pixels in red are all valid pixels for the first check. The pixels in blue are all valid pixels for the second check (the second check is just to be safe). The pixels in green (there's two of them) are what is checked by the script. To fix it, I suggest you take a screenshot of your DC window, then look for any of the pixels highlighted in my picture in Paint and use their coordinates.

Posted: Sat Jun 09, 2007 10:09 pm
by Lith
Thats some great help there, thanks man. Its the screen resolution that was the problem. I guess I have to change the resolution just to stall but thats better then leaving it on being DC'ed. Again thank you. :D

Posted: Sat Jun 09, 2007 10:41 pm
by Cruor
You can still get it to work with your resolution. Just find the coordinates from a screenshot of your own.