AutoIT help...

Here you can post guides and tutorials you have written for Silkroad Online. If submitting a guide from another forum, please post credit to the author.
Post Reply
Lith
Active Member
Posts: 565
Joined: Mon Jan 15, 2007 10:08 pm
Quick Reply: Yes
Location: Lulz

AutoIT help...

Post 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. :/
<<banned from SRF for moderator disrespect and rules violations. -SG>>

User avatar
Cruor
Loyal Member
Posts: 1999
Joined: Wed Apr 12, 2006 1:22 am
Quick Reply: Yes
Location: Off topic

Post 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.
Image

Lith
Active Member
Posts: 565
Joined: Mon Jan 15, 2007 10:08 pm
Quick Reply: Yes
Location: Lulz

Post 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
<<banned from SRF for moderator disrespect and rules violations. -SG>>

User avatar
Cruor
Loyal Member
Posts: 1999
Joined: Wed Apr 12, 2006 1:22 am
Quick Reply: Yes
Location: Off topic

Post by Cruor »

You can still get it to work with your resolution. Just find the coordinates from a screenshot of your own.
Image

Post Reply

Return to “Guides and Tutorials”