AutoHotkey Community

It is currently May 26th, 2012, 1:04 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 55 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject:
PostPosted: March 1st, 2005, 2:39 pm 
Quote:
I wonder what Rajat thinks of it?

@ toralf
spekulierst du auf Heiligsprechung ? :lol:
Da werden wir wohl erstmal deine Frau zu deinen nächtlichen Coding-Sessions befragen müssen ! :wink:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 1st, 2005, 8:15 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
toralf wrote:
I wonder what Rajat thinks of it?

*sorry for being late* i must say toralf that this is coming along really well. and as i once started doing a similar script, i know that ahk's syntax poses certain difficulties, which are being well handled by u! Image

a li'l section from one of my codes where brackets are not accurately placed is here for you. it might help u to improve your script.
Code:
Loop
{
PixelSearch, PosX, PosY, 1, %A_Index%, %A_ScreenHeight%, %A_Index%, %11%

Loop
{
Y = %A_Index%

Loop
{
X = %A_Index%
StringTrimRight, CurrClr, %X%%Y%, 0
IfEqual, CurrClr,, Break

CurrX := PosX + X
Found = 1
PixelGetColor, CheckCol, %CurrX%, %Y%
IfNotEqual, CheckClr, %CurrClr%
{
Found = 0
Break
}
}

Y ++
StringTrimRight, YCheck, 1%Y%, 0
IfEqual, YCheck,
{
MsgBox, %PosX% %PosY%
}
}
}


@BoBo
this is what google offered. how accurate is it?
Quote:
do you speculate on holy speaking? There we will have to ask probably first times your wife to your nocturnal Coding sessions

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 1st, 2005, 10:16 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
Pretty good translation with google.

I will have a look at the code you posted.

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 1st, 2005, 10:33 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
Dear Rajat,

I had a look at the snippet you posted. It works ok on my machine.
Here is what I got
Code:
Loop
{
   PixelSearch, PosX, PosY, 1, %A_Index%, %A_ScreenHeight%, %A_Index%, %11%
   Loop
   {
      Y = %A_Index%
      Loop
      {
         X = %A_Index%
         StringTrimRight, CurrClr, %X%%Y%, 0
         IfEqual, CurrClr,
            Break
         CurrX := PosX + X
         Found = 1
         PixelGetColor, CheckCol, %CurrX%, %Y%
         IfNotEqual, CheckClr, %CurrClr%
         {
            Found = 0
            Break
         }
      }
      Y ++
      StringTrimRight, YCheck, 1%Y%, 0
      IfEqual, YCheck,
      {
         MsgBox, %PosX% %PosY%
      }
   }
}


Please note that the one-liners like "ifequal,something,somethingelse,break" are not supported by my script. therefore I changed it in the code. I deleted the empty lines for smaller size.

This indentation is 1Tab with Rajat style.

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 1st, 2005, 11:02 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
my bad! i forgot abt the note that one line if cmds don't work well. by the way can't u parse the if cmd line and check the number of commas to determine how to format it?

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 2nd, 2005, 6:26 am 
How?
The somethingelse is a value. There might be literal commas in it, right?
So I do not see any chnace to parse it correctly.
Unless someone writes that peace of code, I will not work on it. My main concern was to get rid of a lot of manual modifications. That's what it does. This relatively small shortcome is fine with me.

Does anyone know how to parse these if cmds without regex?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 2nd, 2005, 7:20 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
when parsing the cmd line check for the last char of A_LoopField and see if it is `. and if its so then keep A_LoopField in a buffer and add it to next one as its the same parameter and the comma was escaped.

this is just from the top off my head, there might be some aspect that i've not yet thought of.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 2nd, 2005, 7:27 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
and toralf, it'd be nice if u make settings available to individually select what changes we'd like your script to do... as u've already made some things optional, other settings like just case-correction, or just indentation etc. should be nice.

and now that u've already made a GUI for your script, i think what would be optimum is u move all settings to another tab and keep the report (its nice btw!) etc on first tab.

thanx.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 2nd, 2005, 7:50 am 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
I'm very sorry Rajat, but I stopped developing that script any further. I will only look for bugs. As for the options: All options are in the GUI. CaseCorrection is not in the script, so there is no option for it.
I have a new project. This one was just a side product. And I already spend too much time on it.
If anyone feels like it: make a mod.

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 2nd, 2005, 4:50 pm 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
Like I said a while ago, I'll be making a script like this, and now that toralf's already done some very nice work I'll have something to build on. It's on my todo list, but I'm not sure when I'll get to it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 2nd, 2005, 9:20 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
its sad that u're leaving the project toralf... but probably jonny (as he said) will take it up. nice work!

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2005, 3:54 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
Ok you got me, Rajat. I found a way to parse the one-line if statements. The script in first post is updated. Please try it, I haven't tested it heavily.

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2005, 10:34 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
hey toralf!

with the latest update to your script i din't do any heavy testing yet... i just ran it on the old piece of code... the brackets aren't rightly placed. except that it looks great!

Code:
Loop
{
   PixelSearch, PosX, PosY, 1, %A_Index%, %A_ScreenHeight%, %A_Index%, %11%
   Loop
   {
      Y = %A_Index%
      Loop
      {
         X = %A_Index%
         StringTrimRight, CurrClr, %X%%Y%, 0
         IfEqual, CurrClr,
         Break
         CurrX := PosX + X
         Found = 1
         PixelGetColor, CheckCol, %CurrX%, %Y%
         IfNotEqual, CheckClr, %CurrClr%
         {
            Found = 0
            Break
         }
   }
   Y ++
   StringTrimRight, YCheck, 1%Y%, 0
   IfEqual, YCheck,
   {
      MsgBox, %PosX% %PosY%
   }
}
}

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 4th, 2005, 11:34 am 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
Dear Rajat,
I can't reproduce it on my machine.

- Please check if you have specified the syntax file correctly (just below the #singleinstance). In the script I use the path "Programme" due to german OS. You might need %Program Files%.

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 4th, 2005, 7:01 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
that was it toralf! now it runs great!...actually i never really went through the code... just ran it as it was..

and the cmd case correction can be a nice feature... its just a simple function to replace the occurrances of cmdnames in script with the ones in list... a li'l check to not modify items with less than 5 char length would b better as they might be part of text on msgbox etc. (eg. run, sort, menu)... i can code it for u if u say.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 55 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], sjc1000, Yahoo [Bot] and 44 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group