 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
BoBo Guest
|
Posted: Tue Mar 01, 2005 1:39 pm Post subject: |
|
|
| Quote: | | I wonder what Rajat thinks of it? |
@ toralf
spekulierst du auf Heiligsprechung ?
Da werden wir wohl erstmal deine Frau zu deinen nächtlichen Coding-Sessions befragen müssen !  |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1687
|
Posted: Tue Mar 01, 2005 7:15 pm Post subject: |
|
|
| 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!
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 |
_________________
 |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3910 Location: Bremen, Germany
|
Posted: Tue Mar 01, 2005 9:16 pm Post subject: |
|
|
Pretty good translation with google.
I will have a look at the code you posted. _________________ Ciao
toralf  |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3910 Location: Bremen, Germany
|
Posted: Tue Mar 01, 2005 9:33 pm Post subject: |
|
|
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  |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1687
|
Posted: Tue Mar 01, 2005 10:02 pm Post subject: |
|
|
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? _________________
 |
|
| Back to top |
|
 |
toralf as guest Guest
|
Posted: Wed Mar 02, 2005 5:26 am Post subject: |
|
|
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? |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1687
|
Posted: Wed Mar 02, 2005 6:20 am Post subject: |
|
|
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. _________________
 |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1687
|
Posted: Wed Mar 02, 2005 6:27 am Post subject: |
|
|
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. _________________
 |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3910 Location: Bremen, Germany
|
Posted: Wed Mar 02, 2005 6:50 am Post subject: |
|
|
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  |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 2951 Location: Minnesota
|
Posted: Wed Mar 02, 2005 3:50 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1687
|
Posted: Wed Mar 02, 2005 8:20 pm Post subject: |
|
|
its sad that u're leaving the project toralf... but probably jonny (as he said) will take it up. nice work! _________________
 |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3910 Location: Bremen, Germany
|
Posted: Thu Mar 03, 2005 2:54 pm Post subject: |
|
|
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  |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1687
|
Posted: Thu Mar 03, 2005 9:34 pm Post subject: |
|
|
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%
}
}
}
|
_________________
 |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3910 Location: Bremen, Germany
|
Posted: Fri Mar 04, 2005 10:34 am Post subject: |
|
|
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  |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1687
|
Posted: Fri Mar 04, 2005 6:01 pm Post subject: |
|
|
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. _________________
 |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|