I'm always making new functions, so I decided to post a decent amount of them here. Several are modified functions of others' and should be noted as such. If they derived from someone elses code and isn't noted as such, please let me know, thanks.
Note: some are just commands turned into functions. You may also notice syntax style varies, which is due to some being written as long as 3 years ago.
The library has been moved to Github.
Masonjar13's Library List
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Masonjar13's Library List
Last edited by Masonjar13 on 29 Jul 2016, 02:38, edited 6 times in total.
Re: Masonjar13's Library List
Interesting! I very often turn to google to find the exact way of typing certain AHK functions, or I turn to previous scripts to find some code-lines I need (instead of writing it again from scratch).
I suppose it is very helpfull to have a list of functions stored somewhere where you can always turn to when making a new script... No need to turn to google or other scripts all the time! Not sure if I will ever need to convert an hours to milliseconds or something like that - but I really like the concept of a list like this
I suppose it is very helpfull to have a list of functions stored somewhere where you can always turn to when making a new script... No need to turn to google or other scripts all the time! Not sure if I will ever need to convert an hours to milliseconds or something like that - but I really like the concept of a list like this
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: Masonjar13's Library List
You can save these to your standard library, so you won't ever need to include them. Check here.florisvos wrote:I suppose it is very helpfull to have a list of functions stored somewhere where you can always turn to when making a new script.
Re: Masonjar13's Library List
Thanks so much! Never knew that! So simple but so helpful, I'm sure!Masonjar13 wrote:You can save these to your standard library, so you won't ever need to include them. Check here.florisvos wrote:I suppose it is very helpfull to have a list of functions stored somewhere where you can always turn to when making a new script.
Re: Masonjar13's Library List
Nice collection
However, you should use one of the following to get the Ip for less bandwidth usage.
http://dazzlepod.com/ip/me.json
http://checkip.dyndns.org
However, you should use one of the following to get the Ip for less bandwidth usage.
http://dazzlepod.com/ip/me.json
http://checkip.dyndns.org
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: Masonjar13's Library List
Thank you
Had I known this existed.. I'll update it soon. It'll be pretty quick, seeing as I don't have to work with any HTML shenanigans. Thanks a lot for this!joedf wrote:http://dazzlepod.com/ip/me.json
Re: Masonjar13's Library List
@Masonjar13 No problem, my friend!
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: Masonjar13's Library List
It has been updated. The fact that the "ISP" portion is much longer slightly annoys me, but it works and tells the information it needs to. I implemented a seemingly sound method to get rid of the excess. It's consistent across the IP's I've tested with, anyway. I've also kept the old version in the post as well, noted as such.
Using an old bandwidth monitor I wrote, the difference is quite significant: old method hits (in Kb) from 42-148, where the new method is 3-6. That's 1400-2466 percent less bandwidth used
P.S. If someone has a problem with my excess ridding method for the organization/ISP string (cutting off too much or too little), post the string and I'll see if I can fix it.
Using an old bandwidth monitor I wrote, the difference is quite significant: old method hits (in Kb) from 42-148, where the new method is 3-6. That's 1400-2466 percent less bandwidth used
P.S. If someone has a problem with my excess ridding method for the organization/ISP string (cutting off too much or too little), post the string and I'll see if I can fix it.
Re: Masonjar13's Library List
Using a JSON lib instead of RegEx.
Code: Select all
IPInfo := externalIP()
MsgBox, % IPInfo.ip "`n"
. IPInfo.prefix "`n"
. IPInfo.country_code "`n"
. IPInfo.asn "`n"
. IPInfo.city "`n"
. IPInfo.country "`n"
. IPInfo.region "`n"
. IPInfo.hostname "`n"
. IPInfo.longitude "`n"
. IPInfo.latitude "`n"
. IPInfo.organization
externalIP(){
static URL := "http://dazzlepod.com/ip/me.json"
return json_toobj(urlDownloadToVar(URL)) ; https://autohotkey.com/board/topic/96244-func-convert-objects-tofrom-json-like-strings/
}
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: Masonjar13's Library List
Seems like more of a hassle than it's worth for just one file. If you already use the library, that makes perfect sense, but I'd prefer to: A) keep it simple. B) keep claimed copyright out of my library. I also have no need to work with JSON files, this would be the first and possibly last.
To each their own; I won't be adding that to the first post.
To each their own; I won't be adding that to the first post.
Re: Masonjar13's Library List
I thought of the same thing Masonjar13
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Re: Masonjar13's Library List
I prefer the JSON lib to regex, but that's just me.
@joedf You thought the same thing as who?
Doesn't Shift+Delete do this already?permDel
Delete highlighted files (does not recycle)
@joedf You thought the same thing as who?
Re: Masonjar13's Library List
Code: Select all
for i, v in externalIP()
Msg .= """" i """: """ v """`n"
MsgBox, % Msg
return
externalIP() {
ipInfo := {}
for i, v in StrSplit(Trim(urlDownloadToVar("http://dazzlepod.com/ip/me.json"), " {}`r`n"), "`n", "`r") {
s := StrSplit(v, ":", " ,""")
ipInfo[s.1] := s.2
}
return ipInfo
}
Re: Masonjar13's Library List
Another version. This might be better than using StrSplit to split the line at ":", since that could fail if the second part contains a ":".
Code: Select all
externalIP() {
ipInfo := {}
for i, v in StrSplit(Trim(urlDownloadToVar("http://dazzlepod.com/ip/me.json"), " {}`r`n"), "`n", "`r")
ipInfo[Trim(SubStr(v, 1, (p := InStr(v, ":")) - 1), " """)] := Trim(SubStr(v, p + 1), " , """)
return ipInfo
}
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: Masonjar13's Library List
Correct, but it prompts the user. Maybe there's a way to remove the prompt though? I didn't bother with doing so at the time.Guest wrote:Doesn't Shift+Delete do this already?permDel
Delete highlighted files (does not recycle)
For everyone else writing variants of externalIP(): by all means, continue to do so if you feel like it but I won't be changing my version, as I made an exception for "organization" to be "ISP," and also trimmed it. My computer doesn't notice a difference using RegEx; the one I'm using now is virtually instant. Just tested using a_tickCount and my for-loop is less than one tick.
Re: Masonjar13's Library List
I thought of utilizing the json, but then I told myself it's going a little overboard for a small self-contained/independent function.Guest wrote:@joedf You thought the same thing as who?
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: Masonjar13's Library List
The library has been moved to Github (link on first post). It'll be easier for me to maintain it this way
I'll still post updates here, probably.
I'll still post updates here, probably.
- Added strI()
- Added regExMatchI()
- Added regExReplaceI()
- Added strReplaceI()
- Added mtos()
- Updated randStr() - will likely have another update very soon
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: Masonjar13's Library List
Update!
Finally, I've pushed an update to my git rep. Below are the additions and edits.
Edit: Added "ip" parameter to externalIP to allow look-up of other IP addresses.
Finally, I've pushed an update to my git rep. Below are the additions and edits.
- Updates:
- externalIP - Fixed ISP (dazzlepod updated their ISP value a while back), added extra values to the returning object, and condensed the code.
- urlDownloadToVar - Added raw option.
- New functions:
- audioRouter (class)
- fileUnblock
- getImageSize
- getSelected
- invertCaseChr
- invertCaseStr
- mouseOverWin
- strToLower
- strToUpper
Edit: Added "ip" parameter to externalIP to allow look-up of other IP addresses.
Re: Masonjar13's Library List
Masonjar13
Nice library Thank you
Nice library Thank you
DRAKON-AutoHotkey: Visual programming for AutoHotkey.
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: Masonjar13's Library List
No problem, glad you like it!vasili111 wrote:Masonjar13
Nice library Thank you
- Added toolSpeak() (similar to tool(), but uses SAPI.SpVoice to vocalize the given string)
Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: Marium0505 and 119 guests