Masonjar13's Library List

Post your working scripts, libraries and tools
User avatar
Masonjar13
Posts: 1333
Joined: 20 Jul 2014, 10:16
GitHub: Masonjar13
Location: Не Россия

Re: Masonjar13's Library List

30 Aug 2017, 03:06

Added getCurrentTime() and getUTCOffset() (both require urlDownloadToVar() and strToLower())

Both use http://www.timeanddate.com, which uses TLS 1.2. If you're receiving an error from urlDownloadToVar(), see this page.

Examples:

Code: [Select all] [Expand] [Download] (getCurrentTime example.ahk)GeSHi © Codebox Plus



Code: [Select all] [Download] (getUTCOffset example.ahk)GeSHi © Codebox Plus

timezone:="IST"


UTCOffset:=getUTCOffset(timezone)
if(!UTCOffset)
msgbox,,Error,Timezone not found
else
msgbox,,UTC Offset,% "Offset for " . timezone . ": " . UTCOffset.sign . UTCOffset.hour . ":" . UTCOffset.minute
exitApp

The reason for getting the UTC offset is to allow client-side math to be performed to a_nowUTC for an active clock. Much more efficient than having to query the server constantly.

Code: [Select all] [Expand] [Download] (getUTCOffset example2.ahk)GeSHi © Codebox Plus

User avatar
Masonjar13
Posts: 1333
Joined: 20 Jul 2014, 10:16
GitHub: Masonjar13
Location: Не Россия

Re: Masonjar13's Library List

25 Jan 2018, 21:14

Important update!

With the release of AutoHotkey 1.1.27.00, Min() has been added as a native function. This function does not operate the same, so I've renamed all related functions (see newest commit).
User avatar
Masonjar13
Posts: 1333
Joined: 20 Jul 2014, 10:16
GitHub: Masonjar13
Location: Не Россия

Re: Masonjar13's Library List

14 Feb 2018, 22:28

Update!

Fixed exec[A]Func in threadMan class. I hadn't actually used it, so I never really knew if it worked or not (and nobody mentioned anything). Both allow up to 10 parameters. If there's a way to do a dynamic call so hard-coded exceptions aren't needed, please let me know!
pneumatic
Posts: 146
Joined: 05 Dec 2016, 01:51

Re: Masonjar13's Library List

06 Mar 2018, 19:20

Hi Masonjar

Came across a post of yours here regarding animated cursors not being restored after hiding them
https://autohotkey.com/board/topic/5727 ... ntry654705

Not sure if you had seen the fix, and I couldn't find it in your library, but it seems the animations can be restored by the example here
https://autohotkey.com/board/topic/3260 ... em-cursor/

Code: [Select all] [Download] GeSHi © Codebox Plus

SPI_SETCURSORS := 0x57
DllCall( "SystemParametersInfo", UInt,SPI_SETCURSORS, UInt,0, UInt,0, UInt,0 ) ; Reload the system cursors


It seems to work. Even if I change to different cursors in the windows mouse control panel, they are restored to those cursors and with animations. However this is on Windows 7.

I wanted this feature for the borderless full screen mode issue when the mouse cursor gets displayed on top of the game window. The Borderless Gaming app has this fix, and I wanted it in my own as well, and restoring the cursor properly with full animations.
User avatar
Masonjar13
Posts: 1333
Joined: 20 Jul 2014, 10:16
GitHub: Masonjar13
Location: Не Россия

Re: Masonjar13's Library List

06 Mar 2018, 20:22

I stopped trying to do it, because I came up with a solution more fitted. My problem was when the cursor would be visible over videos, especially when using VLC. So I made a 1x1 gui with WinSet,Transparent, locked the mouse buttons/mouse movement, and placed the gui to the cursor coordinates.

Glad to see there's a proper way to restore cursors though; thanks for letting me know!
User avatar
Masonjar13
Posts: 1333
Joined: 20 Jul 2014, 10:16
GitHub: Masonjar13
Location: Не Россия

Re: Masonjar13's Library List

08 Mar 2018, 01:15

Turns out that Dazzlepod is blocking some VPN servers, some of which I happen to be using. If anyone knows of an alternative site that uses minimal bandwidth (such as a single json file) (location necessary), please let me know!
burque505
Posts: 446
Joined: 22 Jan 2017, 19:37

Re: Masonjar13's Library List

16 Mar 2018, 13:46

Hi Masonjar13, maybe it's too resource-heavy for your purposes, but this one works well for me through a VPN.
Regards,
burque505
User avatar
Masonjar13
Posts: 1333
Joined: 20 Jul 2014, 10:16
GitHub: Masonjar13
Location: Не Россия

Re: Masonjar13's Library List

17 Mar 2018, 11:51

That's actually not bad at 60kb, but still pretty heavy. Fortunately, I found what I was looking for: https://ipapi.co/json/. I'll implement this as a secondary to Dazzlepod, because it appears to be in beta and may not always be free to use.

For those interested, visit the main site to see what all their API can do. It's quite nice!

Edit: I lied. Kept the old stuff in comments, but since this also supports v6, and the other one I had in there for v6 has limited queries per IP, I've just replaced it entirely.

On that note, externalIP() has been updated. Returning object changed slightly (info in comments).
burque505
Posts: 446
Joined: 22 Jan 2017, 19:37

Re: Masonjar13's Library List

17 Mar 2018, 16:42

Thanks for that link! Now that's what I call lightweight. Just tested it through the VPN, works fine.
User avatar
Masonjar13
Posts: 1333
Joined: 20 Jul 2014, 10:16
GitHub: Masonjar13
Location: Не Россия

Re: Masonjar13's Library List

14 Apr 2018, 14:42

Seems like Dazzlepod is now working through my VPN now. Still keeping the new one, of course, but at least I can use their nmap scan with it again :)

Update!
Added stringify(obj)
Added addScript and addFile methods to threadMan class

Since stringify seems kind of ambiguous, I'll explain why I wrote it. Objects can't be set to DLL threads via ahkassign, so I needed a workaround. I could be wrong, since I don't actually look at the change logs for _H, but the addScript and addFile functions seem to be new, or I at least didn't notice them in the help file prior. By making an object a string, you can effectively give it an object by adding it as code.

Code: [Select all] [Expand] [Download] (example1.ahk)GeSHi © Codebox Plus


Code: [Select all] [Download] (example2.ahk)GeSHi © Codebox Plus

while(!isObject(testObj))
sleep 10
for i,a in testObj
msgbox % "key: " . i . "`nvalue: " . a
exitApp
User avatar
Masonjar13
Posts: 1333
Joined: 20 Jul 2014, 10:16
GitHub: Masonjar13
Location: Не Россия

Re: Masonjar13's Library List

17 Apr 2018, 12:30

Updated the readme. Each function/class now shows required other functions/libraries (if applicable) and a short description. Doesn't look all that pretty, but at least there's more info!

Return to “Scripts and Functions”

Who is online

Users browsing this forum: arcticir and 9 guests