 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Moderator! Guest
|
Posted: Sun Dec 09, 2007 2:37 am Post subject: |
|
|
| Joy2DWorld wrote: | | (ps: is even worth responding to 'guest' with username "Moderator!" ???) |
not at all, then why do it ?  |
|
| Back to top |
|
 |
emoyasha
Joined: 12 Nov 2007 Posts: 64
|
Posted: Sun Dec 09, 2007 3:16 am Post subject: |
|
|
okay i understand the concers here, and although i have veiwed this for a few minutes i can tell that these functions cannot be used to exploit, and if IF someone found ou tthe program they where using was wrote in ahk, a cracking program would be difficult to find. so there should be no wories about it period cause its not going to happen, and thanks for the functions ill study them. _________________ online .ini reader with encryption
[url=http://www.autohotkey.com/forum/viewtopic.php?p=164102]
advanced tetris game many features [/url] |
|
| Back to top |
|
 |
Guest
|
Posted: Sun Dec 09, 2007 12:19 pm Post subject: |
|
|
| lexikos wrote: | | Could you give an example of how a name could be more useful? |
...without the double underscores...I hate function calls with any amount of underscores at the beginning...it just looks tacky...the actual naming itself is fine..."static" is "__static"...but the double underscores look really bad...I don't like this practice in any lang...
| lexikos wrote: | | Given that the functions aren't really united under a single purpose, I am against adding a prefix. |
...I am mostly against adding a prefix too...that's what I meant by "...why is everyone so centered on being "stdlib compliant""...but you effectively have the prefix "__" (double underscore)...whenever I release code I am not going to give my functions dumb names to be "stdlib compliant"...I will do the SomeName_Init() trick tho...but I won't give all my functions prefixes...& I will also not give them bare underscores at the beginning...they will only get prefixes if I want them to...not bow down to the almighty "stdlib compliant"-ness...I guess the most blatant case of useless bowing down to being "stdlib compliant" is API Wrappers (is that just on the wiki or is there a forum thread too?...I couldn't find it to link)...I mean come on...do those need prefixes?...no!...include a WinAPI_Init() function (that does nothing/is blank)...& no prefix on each function...still "stdlib compliant"...but not with dumb prefixes on each function...
On a lazy note (I would normally try to find out myself, but you're already knee-deep in AutoHotkey's internals)...can LowLevel be used to call the built-in AutoHotkey functions or routines?...like the #SingleInstance directive...I don't know if that, internally, is an AutoHotkey function or not, but can that be called with this LowLevel script?...I want a SingleInstance command, so the top part of the script can do some sanity checking...or some "call myself to do something in another process" stuff...but also enforce the built-in SingleInstance code if the 2nd call wasn't from myself...like I did manually with script in Multiple tray icons?...so I know LowLevel can call user functions...can it call whatever the SingleInstance directive does?...then instead of a built-in SingleInsance command, I could use a SingleInstance function...also, that script I wrote in that thread only handles the "prompt" case of SingleInstance, but ideally the function should be able to do all that the directive can...for example SingleInstance("force")...so I guess...is it possible?...& also can it take params?
| Code: | ; Based on v1.0.47.04.
;
; DISCLAIMER: MAY CRASH OTHER VERSIONS OF AUTOHOTKEY. |
...have you tested with 1.0.47.05 yet?...did you start writing LowLevel before 1.0.47.05 was out?
...& can I thank you profusely for linking to your script as an .ahk...so many people on this forum link to a damn .rar it's annoying...other people link to a .zip, which is fine for downloading, but when I just wanna read the code in the browser it's annoying...other people (*cough*Sean*cough*) link with the text "Script.ahk" but the link points to a "Script.zip"...really annoying!...so THANK YOU for linking to the .ahk!...(& if, in the future you link to a .zip, please keep a link to the .ahk {but please never, even in the future, link to a .rar [it should only be .7z or .zip for downloading & .ahk for viewing, never .rar]})... |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3652 Location: Belgrade
|
Posted: Sun Dec 09, 2007 12:24 pm Post subject: |
|
|
You obviously don't understand many things about proper encapsulation. _________________
 |
|
| Back to top |
|
 |
DerRaphael
Joined: 23 Nov 2007 Posts: 604 Location: 127.0.0.1
|
Posted: Sun Dec 09, 2007 1:17 pm Post subject: |
|
|
| emoyasha wrote: | | okay i understand the concers here, and although i have veiwed this for a few minutes i can tell that these functions cannot be used to exploit, and if IF someone found ou tthe program they where using was wrote in ahk, a cracking program would be difficult to find. so there should be no wories about it period cause its not going to happen, and thanks for the functions ill study them. |
make up a lil demoscript and point to this as password complied ahk exe and
ill send you the source - in case you dont believe |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2739 Location: Australia, Qld
|
Posted: Sun Dec 09, 2007 1:56 pm Post subject: |
|
|
| Anonymous wrote: | | ...without the double underscores...I hate function calls with any amount of underscores at the beginning... | I hate reading text with poor grammar and an abundance of ellipses... but I do anyway.
The functions need some sort of prefix to prevent naming conflicts. No one will object if you rename the functions in your own copy, though.
| Quote: | | can LowLevel be used to call the built-in AutoHotkey functions or routines?...like the #SingleInstance directive...I don't know if that, internally, is an AutoHotkey function or not, but can that be called with this LowLevel script? | Yes, __expr works with built-in functions, and no, #SingleInstance is not a function, and cannot be called by the script.
As for "single instance" handling, there are several solutions on the forums. Search for... "single instance".
If you wanted, you could use majkinetor's IPC module to send an expression to the other instance, call __expr, then use IPC to send the result back.
| Quote: | | ...have you tested with 1.0.47.05 yet?...did you start writing LowLevel before 1.0.47.05 was out? | About half of the script was written before .05 was released. I tested it very briefly before I initially released the script. I am running a modified version of 1.0.47.04, and have not been bothered to port my modifications to 1.0.47.05 yet. Most changes to AutoHotkey require only code changes, with no change to the internal structures. The "disclaimer" probably should have read "use at your own risk."
| Quote: | | ...& can I thank you profusely for linking to your script as an .ahk...so many people on this forum link to a damn .rar it's annoying...other people link to a .zip, which is fine for downloading, but when I just wanna read the code in the browser it's annoying...other people (*cough*Sean*cough*) link with the text "Script.ahk" but the link points to a "Script.zip"...really annoying! | I agree with you on that. It also annoys me when "people" zip up a single small text file. I hadn't said anything, since it's only a minor inconvenience. There is one advantage though: zip files generally don't suffer from cache problems... |
|
| Back to top |
|
 |
Guest
|
Posted: Sun Dec 09, 2007 3:19 pm Post subject: |
|
|
| lexikos wrote: | | I hate reading text with poor grammar... |
...what "poor grammar"?...but I do like ellipses...but almost never with spaces around them...(you wrote "ellipses... but")...
| lexikos wrote: | | Yes, __expr works with built-in functions... |
...my use of "built-in functions" there was misleading, I meant the AutoHotkey-program built-in functions -- the C-functions, not script-related built-in functions...
| lexikos wrote: | | ...and no, #SingleInstance is not a function, and cannot be called by the script. |
...what is it tho?...it can't be called at all? I know it's not a (script-related) "built-in function"...but it is code inside the AutoHotkey process...& calling that code is exactly what this LowLevel thing does...
| lexikos wrote: | Search for... "single instance".  |
...I really don't need told to search (& with a roll eyes image to boot!)...I search all the time...& I linked to my own "solution"...
| lexikos wrote: | | If you wanted, you could use majkinetor's IPC module... |
...I don't know if this will relate to my need to invoke SingleInstance's automatic handling...but I will look into it...it's not 2 copies of the same script talking to each other, it's a script that needs to be SingleInstance, unless it's calling itself...with the command line param -open...
| majkinetor wrote: | | You obviously don't understand many things about proper encapsulation. |
| lexikos wrote: | | I hate reading text with poor grammar... |
| lexikos wrote: |  |
...personal attacks like these are exactly what the world doesn't need...in the last few days playing Tremulous I've been called "noob" "stupid" "idiot"...now I "don't understand" & have "poor grammar" & I'm too stupid to search...maybe I should just /kill...(/kill in games is a command to suicide...but I'm also to stupid to know that)...
| lexikos wrote: | | I agree with you on that. |
...hey!...friends again...so what's the point of saying I have "poor grammar"?...people can't be nice all the time, instead of some of the time?
| lexikos wrote: | | It also annoys me when "people" zip up a single small text file. |
Sean
| lexikos wrote: | | I hadn't said anything, since it's only a minor inconvenience. |
...it is a major annoyance...I don't wanna download & unzip, just to read a script I'll never use...& I can't even open .rar's...(& no I'm not getting WinRAR & using it only to extract)...
| lexikos wrote: | | There is one advantage though: zip files generally don't suffer from cache problems... |
...there is usually an option to check the page on "Every visit to the page" so it's not stale... |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5390 Location: /b/
|
Posted: Sun Dec 09, 2007 3:50 pm Post subject: |
|
|
| Anonymous wrote: | | why is everyone so centered on being "stdlib compliant" | I think it's important for accessibility, if one releases a script in this forum they ought to assume responsibility over copyright/attribution, safety and see that it ties in with AutoHotkey's schematics. This doesn't mean I agree with Chris decision, but I don't see any viable alternative.
Bad naming decisions is a poor excuse... someone had to manage the entire .NET library and that went quite well.
| Anonymous wrote: | | so many people on this forum link to a damn .rar it's annoying. | Sometimes I just refuse to even open those links. I repackage the AutoHotkey source files from WinRar sfx to 7zip not only because it has far superior compression ratios but because I can rest assured that anybody can view what's inside with almost any archiving tool available.
| lexikos wrote: | | zip files generally don't suffer from cache problems | If you're using a real browser like Firefox you shouldn't have such problems with any format. Autohotkey.net compresses text files with deflate so there is no difference with zips/rars with regards to size. Archiving allows authors to add auxiliary files without changing links so I suppose there are practical reasons for using them.
btw. sorry for diverging off topic lexikos x_x _________________
 |
|
| Back to top |
|
 |
Joy2DWorld
Joined: 04 Dec 2006 Posts: 425 Location: Galil, Israel
|
Posted: Sun Dec 09, 2007 3:55 pm Post subject: |
|
|
| lexikos wrote: | | Joy2DWorld wrote: | | ps: suggest, deserves lib "Eval_" | Given that (I think) __expr now uses every __function (directly or indirectly) except __listLabels and __listFuncs, I couldn't really make a separate library for it.  |
actually, was suggesting LIBRARY NAME of "Eval",
and... main eval function as base.. ie. "Eval_(xxx)"
btw. regarding "Guest"(s), there are some very bright minds under 16 who can (1) learn much from the posts, and (2) even contribute amazing stuff [even innovations, etc.], **but**,
extended argument with their commentary is likely less than fruitful.
@"Guest", with lots of people making different function sets, there is a large chance that more then one will name a totally DIFFERENT FUNCTION with the same name. since ahk can't handle 2 functs with same name, script is broken.. to prevent this, each function set gets a "library' name. if *every* function and global var within the function set (ie. library) starts with the library name xxx_ there will NEVER be a conflict between even thousands of libararies (so long as each lib gets a unique name).
this YOU can just download and use any, from among hundreds of libraries.
if this helps. _________________ Joyce Jamce |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6264
|
Posted: Sun Dec 09, 2007 4:14 pm Post subject: |
|
|
| Anonymous wrote: | | lexikos wrote: | | It also annoys me when "people" zip up a single small text file. |
Sean |
I never felt annoyed and accept it as pearl diving.
Maybe Sean does not like his code being copy pasted without proper reference to the source. When you download and extract a file out of it, the filestamp is original and it is clear you have to contact the author for a special license.
Do you really like ask-for-help code-copy-pasted posts that do not even say "I found this code somewhere in forum" ?
About .rar, yes I find it very unconventional, But I need a Pearl... so I have to dive for it.
 |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2436
|
Posted: Sun Dec 09, 2007 4:18 pm Post subject: |
|
|
| lexikos wrote: | | About half of the script was written before .05 was released. I tested it very briefly before I initially released the script. I am running a modified version of 1.0.47.04, and have not been bothered to port my modifications to 1.0.47.05 yet. Most changes to AutoHotkey require only code changes, with no change to the internal structures. The "disclaimer" probably should have read "use at your own risk." | Time to download and play Russian roulette then I guess... |
|
| Back to top |
|
 |
Guest
|
Posted: Sun Dec 09, 2007 4:19 pm Post subject: |
|
|
| Titan wrote: | | This doesn't mean I agree with Chris decision, but I don't see any viable alternative. |
..."Chris decision" to what?
| Titan wrote: | | Sometimes I just refuse to even open those links. |
...you could deny uploading those to AutoHotkey.net...hehehe...remove it from the "Allowed Types" list...if it's in there...or deny it some other way...7z all the way!...but even if people are "packaging" a script with other stuff...they should still link to each .ahk file inside the zip, so people can read the code, without downloading & unzipping...& people should never zip a single .ahk file...except perhaps to force the browser download dialog, but still, include an .ahk link along with the .zip...
To everyone: I understand the concept of a namespace...but putting the prefix on each function...1) looks ugly...2) is more to type when you are trying to use the library...3) for the API Wrappers is completely unnecessary cuz who is going to make a function called BitBlt that isn't the WinAPI BitBlt...I support AutoHotkey getting some type of 'namespace' syntax, but not this prefix crap...at least not on everything...some specialized stuff, yeah, but not everything... |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2436
|
Posted: Sun Dec 09, 2007 4:27 pm Post subject: |
|
|
| Anonymous wrote: | | ...personal attacks like these are exactly what the world doesn't need...in the last few days playing Tremulous I've been called "noob" "stupid" "idiot"...now I "don't understand" & have "poor grammar" & I'm too stupid to search...maybe I should just /kill...(/kill in games is a command to suicide...but I'm also to stupid to know that)... | ...but this forum is a friendly place...  | Skan wrote: | About .rar, yes I find it very unconventional, But I need a Pearl... so I have to dive for it.
 | As you're likely aware, WinRAR can generate .zip files also so there's really no need to make someone download and install WinRAR just to extract a single file that in most cases didn't need to be compressed in the first place. I usually only zip .exe files (because some people are too paranoid to download a .exe file for some bizarre reason) or projects that require additional files for functionality... |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2739 Location: Australia, Qld
|
Posted: Mon Dec 10, 2007 2:58 am Post subject: |
|
|
| Anonymous wrote: | | ...what is it tho?...it can't be called at all? | It is a directive, as you already said. It is parsed and dealt with at script load-time. To call the specific code for a directive (or simulate it by modifying the necessary variables/structures directly), we need an "entry point" - i.e. a pointer to the specific C++ function or variable/structure.
There are quite a few things that could be done if we had access to the global variables defined in C++, but we do not. (At least, not without modifying AutoHotkey in ways I suspect wouldn't be appropriate for the main distribution.)
| Quote: | | it's not 2 copies of the same script talking to each other, it's a script that needs to be SingleInstance | So a second instance never runs? How would you manage that?
| Quote: | | ...personal attacks like these are exactly what the world doesn't need... | That was not a personal attack. To say it more constructively, if you improve the grammar of your posts, people (like me) will be more likely to read what you have posted. Random ellipsis-delimited "thoughts" are difficult to read.
| Quote: | | ...it is a major annoyance...I don't wanna download & unzip, just to read a script I'll never use...& I can't even open .rar's...(& no I'm not getting WinRAR & using it only to extract)... | You mentioned 7z earlier. 7-zip can read RAR files. It takes much longer to write a script than to unzip it, so be grateful.
| Joy2DWorld wrote: | | actually, was suggesting LIBRARY NAME of "Eval", | "Eval" is too specific. The script was not and is not intended solely for evaluating dynamic expressions. In fact, I added __expr mainly to make use of __MakeExpressionArg, which will be used to generate dynamic code - i.e. for insertion into the script rather than one-time evaluation.
| Anonymous wrote: | | for the API Wrappers is completely unnecessary cuz who is going to make a function called BitBlt that isn't the WinAPI BitBlt... | Bit blitting is not specific to GDI.
More to the point, if __mcode() had no prefix, it would collide with the existing MCode(). Having a common prefix also makes it clear that the functions have a similar or related purpose.
| Quote: | | I support AutoHotkey getting some type of 'namespace' syntax, | As do we all, I suppose.
| Quote: | | but not this prefix crap...at least not on everything...some specialized stuff, yeah, but not everything... | What is more specialized than this script?
| Joy2DWorld wrote: | | include auto init within eval_ funct. | Good idea. It wouldn't be practical for __getVar to self-init, but calling __init from __expr is not a problem. (Script updated.)
For those that are interested, I have uploaded an outline of some of the structures (Var, Line, Func, etc.) accessible by the script. I use this as a reference when accessing the structures with NumGet/NumPut.
lowlevel_outline.txt
(Optimally viewed in Notepad.)
Last edited by Lexikos on Mon Dec 10, 2007 3:07 am; edited 1 time in total |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Dec 10, 2007 1:38 pm Post subject: |
|
|
| lexikos wrote: | | To call the specific code for a directive..., we need an "entry point" |
...ok that's what I was wondering...the code, internally, isn't encapsulated in a way to be called. Just as one final question...speaking in AutoHotkey Source terms...LowLevel can call all the BIF* functions...so can it call all the non-BIF functions?...(AutoHotkey internal helper functions, not related to scripts)...& the code for the #SingleInstance directive isn't in any function?...or it might be in WinMain, but it's not isolated by itself...so calling it would call all the "load-time" stuff & not just SingleInstance...
| lexikos wrote: | So a second instance never runs? How would you manage that?  |
...the script I linked to shows what it does, the 2nd instance runs, but they don't talk (they talk on the command line, but not about being SingleInstance). I'm not trying to "prevent the user from running it twice"...I'm trying to get the automatic SingleInstance behavior. In Notepad2, I press Ctrl+L to run the script I'm editing, with #SingleInstance force, this means if the program is already running, it reloads & the new code is there to test...with that script I linked to, using the directive would really mess it up...it's ok if it's still not possbile yet, but this looked like a real close shot, it's just that the directive code isn't isolated enough to call...
| lexikos wrote: | | Random ellipsis-delimited "thoughts" are difficult to read. |
...I figured that was clearer, it shows my thought process, instead of just showing the end result (for example when I'm answering a post for help with their code, I show how I got to the solution)...I'm sure I can't not (yes can't not) use ellipses & I'm not sure how to not string together all my thoughts, I do use commas & proper punctuation, I capitalize I & use an apostrophe in I'm, unlike most of the online gaming people do in chat...constructive help here welcome...yes more ellipses...
| lexikos wrote: | | You mentioned 7z earlier. 7-zip can read RAR files. |
...as much as I promote 7-zip, I don't actually have it "installed"...I download it & I use the 7za command line version currently, but that don't support rar, apparently the full, installed version is supposed to open rar, but I haven't installed it yet...
| lexikos wrote: | | It takes much longer to write a script than to unzip it, so be grateful. |
...yes, but most of the time I just wanna read the code...& I never want to dig into a rar, unless the contents are something I REALLY want...for example I downloaded JGR's WinEventHook example... on 10-4-07 & still haven't extracted them...nice enigma there...but I really need the hooks for a script I'm trying to write... |
|
| 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
|