Search found 156 matches

by LinearSpoon
21 Jul 2014, 17:00
Forum: Ask For Help
Topic: LinkedIn API and oAuth2
Replies: 6
Views: 2629

Re: LinkedIn API and oAuth2

I do not have or wish to create a LinkedIn account, so I can't provide you with a full demonstration script. I have dealt with Oauth 2 in the past using the Imgur API, and the process seems to be very similar. 1. Register your application with LinkedIn to receive an API and secret key. 2. Build the ...
by LinearSpoon
03 Jul 2014, 20:41
Forum: Ask For Help
Topic: Extreme GDI+ project - video game
Replies: 5
Views: 1408

Re: Extreme GDI+ project - video game

I don't know the exact mechanics of the gdip rotation functions, but I would assume it would be rotated with the rest of the image if you draw the rectangle before rotation.
by LinearSpoon
27 Jun 2014, 07:54
Forum: Ask For Help
Topic: [Ignored priority]Condition of Ternary operator
Replies: 2
Views: 1177

Re: condition of Ternary operator

Having just a space with no other operators is implicit string concatenation in AutoHotkey. So your first example evaluates to ",0" ? 0 : 1. Since ",0" is not a pure number, AutoHotkey evaluates it as a string, with empty string ("") being false and any other string being true. In this case, you can...
by LinearSpoon
24 Jun 2014, 01:20
Forum: Ask For Help
Topic: Extreme GDI+ project - video game
Replies: 5
Views: 1408

Re: Extreme GDI+ project - video game

Why would you expect the black rectangle to stick around after you draw on top of it? UpdateLayeredWindow(hwnd2, hdc, (A_ScreenWidth-RWidth)//2, (A_ScreenHeight-RHeight)//2, RWidth, RHeight) You should draw the black rectangle into the rotated image (this can be done before rotation if necessary), t...
by LinearSpoon
19 Jun 2014, 10:15
Forum: Ask For Help
Topic: FadeOut Math
Replies: 4
Views: 1034

Re: FadeOut Math

The solution is to calculate transparency based off time elapsed rather than calculating the interval that it should change...Also, static variable assignments (on the same line as their declaration) run once at the start of the script and never again. So you would have had an issue if you tried to ...
by LinearSpoon
17 Jun 2014, 19:21
Forum: Ask For Help
Topic: Trouble with GDI+ showing on visible gui
Replies: 5
Views: 1503

Re: Trouble with GDI+ showing on visible gui

If you're still using BitBlt for drawing, the easiest option would be to replace it with a call to StretchBlt (included in gdip.ahk right under BitBlt). I don't have his examples handy, but I may look into it further after a while.
by LinearSpoon
17 Jun 2014, 15:18
Forum: Ask For Help
Topic: Trouble with GDI+ showing on visible gui
Replies: 5
Views: 1503

Re: Trouble with GDI+ showing on visible gui

There are many ways to do this. I think perhaps you did not realize there is a difference between GDI and GDI+ (also called gdip), as you were mixing code from both. #Include gdip.ahk Menu, FileMenu, Add, Open, Open Menu, MyMenuBar, Add, File, :FileMenu Gui, Menu, MyMenuBar Gui, +Resize +hwndhwnd ;H...
by LinearSpoon
14 Jun 2014, 07:13
Forum: Ask For Help
Topic: All commands don't work on specific window
Replies: 2
Views: 962

Re: All commands don't work on specific window

Could be UAC blocking interactions with an elevated process. Try disabling UAC or running the script as administrator?
by LinearSpoon
11 Jun 2014, 13:41
Forum: Ask For Help
Topic: Gdip_SetPixel()
Replies: 1
Views: 1222

Re: Gdip_SetPixel()

There isn't a way to use Gdip_SetPixel() without pBitmap. There are several ways to proceed. 1. Start with a GDI+ bitmap and use Gdip_SetPixel(). When you are ready to show the image, use Gdip_CreateHBITMAPFromBitmap() to get hbm for UpdateLayeredWindow(). 2. Again, start with a GDI+ bitmap and use ...
by LinearSpoon
08 Jun 2014, 00:51
Forum: Ask For Help
Topic: Does AHK v.1.0.48.05 work with Windows 8?
Replies: 5
Views: 1882

Re: Does AHK v.1.0.48.05 work with Windows 8?

The reason it did not work for me earlier was because AHK couldn't find ntoskrnl.exe. Whatever. The functionality can be replaced by Numput. As far as I can tell, the function is takes a hex string which represents unicode characters, splits them up, and alternates sending key down and key up events...
by LinearSpoon
07 Jun 2014, 21:06
Forum: Ask For Help
Topic: Does AHK v.1.0.48.05 work with Windows 8?
Replies: 5
Views: 1882

Re: Does AHK v.1.0.48.05 work with Windows 8?

Offhand, I would guess it's stopped working because the INPUT structure layout is different under x64. With no explanation and without running through the code by hand, I can only guess at what it's meant to do. (perhaps send a unicode string converted from ANSI?) I suspect there is a simpler versio...
by LinearSpoon
06 Jun 2014, 16:30
Forum: Ask For Help
Topic: How to seperate 12 digit account number and add 2 digits
Replies: 4
Views: 1330

Re: How to seperate 12 digit account number and add 2 digits

RegexReplace searches input for the pattern .*?(\d{3})(\d+).*?(\d+) , and replaces the pattern found with subpatterns 1,3,2. Specifically .*? Find 0 or more of any character. ? toggles greedy mode, which has to do with whether .* consumes characters it doesn't need. Here it's used to consume "Acct N...
by LinearSpoon
06 Jun 2014, 15:10
Forum: Ask For Help
Topic: How to seperate 12 digit account number and add 2 digits
Replies: 4
Views: 1330

Re: How to seperate 12 digit account number and add 2 digits

Regex is usually the shortest way to parse text.

Code: Select all

input := "Acct Num: 001564965458 Account Code: 20"
output := RegexReplace(input, ".*?(\d{3})(\d+).*?(\d+)", "$1$3$2")
Msgbox %output%
by LinearSpoon
06 Jun 2014, 04:08
Forum: Ask For Help
Topic: [Solved] Different behaviour of compiled version
Replies: 3
Views: 1029

Re: Different behaviour of compiled version

It would seem this is intentional. I believe this is the relevant part of the source: https://github.com/Lexikos/AutoHotkey_L/blob/master/source/script2.cpp //Line 18255 of script2.cpp #ifdef CONFIG_DEBUGGER int offset = TokenIsPureNumeric(*aParam[1]) ? ParamIndexToInt(1) : 0; if (offset < 0) { DbgS...
by LinearSpoon
04 Jun 2014, 03:20
Forum: Ask For Help
Topic: creating many objects automatically
Replies: 9
Views: 2366

Re: creating many objects automatically

It was just a test to see what it would do on bad input that didn't follow the earlier format (name,color,type).
by LinearSpoon
03 Jun 2014, 16:02
Forum: Ask For Help
Topic: creating many objects automatically
Replies: 9
Views: 2366

Re: creating many objects automatically

I suspect this is not your actual data, so this regex may need to be rewritten. This demonstrates a way to dynamically create objects though. input = ( fox, white and orange, mammal turtle, green, reptile crocodile,green,reptile elephant, grey, mammal eagle, brown, bird invalid input (missing fields...
by LinearSpoon
02 Jun 2014, 20:52
Forum: Ask For Help
Topic: Function with custom name
Replies: 2
Views: 993

Re: Function with custom name

What is there to call if the function doesn't exist? The line you posted already demonstrates how to dynamically call a function. It calls the function whose name is in the WatchFolder variable. If the function doesn't exist, it silently fails (nothing is called). RegisterCallback() is for another p...
by LinearSpoon
29 May 2014, 21:39
Forum: Ask For Help
Topic: How to transform like "&#8364; " this code into character?
Replies: 8
Views: 3360

Re: How to transform like "&#8364; " this code into characte

I don't know if this is the most efficient way, but it's simple enough...

Code: Select all

test =
(Join<br>
ch &#21270;&#31911;&#21697;ch ch ch ch &#36890;&#36009;
&#8364;
)

Msgbox % Convert(test)

Convert(strHTML)
{
  doc := ComObjCreate("HTMLfile")
  doc.write(strHTML)
  return doc.body.innerText
}
by LinearSpoon
27 May 2014, 15:05
Forum: Ask For Help
Topic: __Get in a Class
Replies: 6
Views: 2378

Re: __Get in a Class

__Get will only be called when you try to "get" a key that doesn't exist. It's there if you need to return a meaningful value instead of "" MyInstance := New MyClass Msgbox % "Get a key that doesn't exist: " MyInstance.NotAKey class MyClass { __Get(key) { Msgbox % "Get: " key return "Invalid key" } ...
by LinearSpoon
27 May 2014, 02:19
Forum: Ask For Help
Topic: Multi-level associative arrays
Replies: 8
Views: 4596

Re: Multi-level associative arrays

2. More generally, you simply check if each item you come to is a subarray, and if so go through a for loop on the subarray. This is one of the few algorithms it feels natural to write recursively. This serialize function is something I wrote a while back to quickly print out the contents of most ob...

Go to advanced search