Search found 156 matches

by LinearSpoon
16 Nov 2013, 09:57
Forum: Ask for Help (v1)
Topic: Trouble emplementing a simple XOR cipher
Replies: 17
Views: 8086

Re: Trouble emplementing a simple XOR cipher

It occurs to me to ask, why nulls can't be added to a string? Character 0 in the asc() character table is a null. The relevant part of that sentence is that nulls ARE characters. Why are other non printing characters OK but nulls are not? How would a XOR cipher be implemented in other languages so ...
by LinearSpoon
15 Nov 2013, 14:53
Forum: Ask for Help (v1)
Topic: Trouble emplementing a simple XOR cipher
Replies: 17
Views: 8086

Re: Trouble emplementing a simple XOR cipher

I think you've missed the point of the xor cipher.. The same function is used to encode and decode the text... Your function returns something like: Plaintext: The Quick Brown Fox Jumps Over The Lazy Dog. Key: why won't this work?why won't this work?why won't this work? Enciphered: AAAcAAAAJgAaAAcAR...
by LinearSpoon
15 Nov 2013, 12:35
Forum: Ask for Help (v1)
Topic: Trouble emplementing a simple XOR cipher
Replies: 17
Views: 8086

Re: Trouble emplementing a simple XOR cipher

So would this without an extra if statement in the loop :lol: txt := "The Quick Brown Fox Jumps Over The Lazy Dog." key := "why won't this work?why won't this work?why won't this work?" enc := xorcipher(txt, key) dec := xorcipher(enc, key) ;<---------------- You had them flipped msgbox, % "Plaintext...
by LinearSpoon
15 Nov 2013, 06:14
Forum: Ask for Help (v1)
Topic: Trouble emplementing a simple XOR cipher
Replies: 17
Views: 8086

Re: TRouble emplementing a simple XOR cipher

The problem occurs when a letter in the text happens to be the same as its corresponding letter in the key For example, the 'h' here: "T h e Quick Brown Fox Jumps Over The Lazy Dog." "w h y won't this work?why won't this work?why won't this work?" Any number xored with itself produces zero (null). A...
by LinearSpoon
08 Nov 2013, 19:18
Forum: Ask for Help (v1)
Topic: Generic GetParameters Function
Replies: 7
Views: 3108

Re: Generic GetParameters Function

Well, AHK does have a debugger..viewing local variables as well as the stack should be possible. SciTE4AutoHotkey comes with support for it built in. The link and more info is in the manual here:
http://l.autohotkey.net/docs/AHKL_DBGPClients.htm
by LinearSpoon
08 Nov 2013, 16:31
Forum: Ask for Help (v1)
Topic: Generic GetParameters Function
Replies: 7
Views: 3108

Re: Generic GetParameters Function

What do you need this for? Reading the script file for parameters and such is only going to work as long as the script isn't compiled... If you want a set of parameters passed as keys associated with values, why not just use an associative array? http://l.autohotkey.net/docs/Objects.htm#Usage_Associ...
by LinearSpoon
06 Nov 2013, 19:27
Forum: Ask for Help (v1)
Topic: mouse click syntax
Replies: 3
Views: 1931

Re: mouse click syntax

Maybe something like this Loop { clickStart := A_TickCount while (getKeyState("LButton", "P") && getKeyState("RButton", "P")) { if (A_TickCount-clickStart >= 4000) Msgbox Insert shutdown command here after testing Sleep, 10 ;Sleep just prevents it from eating all the cpu time } Sleep, 10 }
by LinearSpoon
06 Nov 2013, 15:27
Forum: Ask for Help (v1)
Topic: Selecting items randoms from a list
Replies: 12
Views: 6210

Re: Selecting items randoms from a list

It is necessary actually. A_Index still increments even if the random number chosen was picked in a prior loop iteration. It could be removed with a second loop I suppose...but that's probably more work than it saves. Also, since you have a comma on that line... your entire expression is just this: ...
by LinearSpoon
02 Nov 2013, 11:46
Forum: Ask for Help (v1)
Topic: Center Image
Replies: 3
Views: 2421

Re: Center Image

Inside the function, a newly declared variable (MyPic) is considered "local". The easiest fix would be to use 'global MyPic' as the first line of the function. Also nombreImagen should be in %% when you add the picture. CentrarImagen(nombreImagen) { Global MyPic Gui, Margin, 0,0 Gui 1:-owner -toolwi...
by LinearSpoon
30 Oct 2013, 21:59
Forum: Ask for Help (v1)
Topic: Any way to find if window is a desktop app?
Replies: 10
Views: 4920

Re: Any way to find if window is a desktop app?

Well, WS_EX_TOOLWINDOW is an extended style rather than a "regular" style (There is a difference). Try this: WinGet, windows, List NonAppWindows := "", AppWindows := "" Loop % windows { WinGetTitle, title, % "ahk_id " windows%A_Index% WinGet, ex, ExStyle, % "ahk_id " windows%A_Index% if (ex & 0x80) ...
by LinearSpoon
30 Oct 2013, 11:41
Forum: Ask for Help (v1)
Topic: Any way to find if window is a desktop app?
Replies: 10
Views: 4920

Re: Any way to find if window is a desktop app?

Your output var does not match the var used in the if statement (I realize the manual example is confusing since it uses the same var name as the cmd parameter). It should be one of these: WinGet, Style, Style, WinTitle if (Style & 0x40000000) ... or WinGet, ExStyle, ExStyle, WinTitle if (ExStyle & ...
by LinearSpoon
30 Oct 2013, 08:33
Forum: Ask for Help (v1)
Topic: Any way to find if window is a desktop app?
Replies: 10
Views: 4920

Re: Any way to find if window is a desktop app?

My understanding was that having or not having certain window styles affects what appears in the taskbar. I've only got 10 minutes before class so I can't investigate much but maybe this will help: http://msdn.microsoft.com/en-us/library/windows/desktop/cc144179(v=vs.85).aspx (Look for "Managing Tas...
by LinearSpoon
28 Oct 2013, 15:29
Forum: Ask for Help (v1)
Topic: Help with a script to listen to a port
Replies: 23
Views: 13343

Re: Help with a script to listen to a port

WSA error codes & descriptions: http://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx From recvfrom() msdn page: If the from parameter is nonzero and the socket is not connection oriented, (type SOCK_DGRAM for example), the network address of the peer that sent the data is c...
by LinearSpoon
24 Oct 2013, 00:55
Forum: Ask for Help (v1)
Topic: Help with a script to listen to a port
Replies: 23
Views: 13343

Re: Help with sockets

I don't know how this can be done but I've done enough with AHKsock and this is closer to the proper usage: AHKsock_Listen(9, "notify") notify(sEvent, iSocket = 0, sName = 0, sAddr = 0, sPort = 0, ByRef bData = 0, bDataLength = 0) { str := "Event: " sEvent "`nIP: " sAddr "`nPort: " sPort if (sEvent ...
by LinearSpoon
09 Oct 2013, 05:15
Forum: Off-topic Discussion
Topic: Old Forum
Replies: 7
Views: 4402

Re: Old Forum

There's still the censoring of Drainx and deranking of mods involved in this forum... that alone makes me want to abandon the old forum completely. I do not have high hopes for anything from Polyethene.
by LinearSpoon
03 Oct 2013, 10:21
Forum: Ask for Help (v1)
Topic: #MaxMem: How much is too much?
Replies: 7
Views: 5718

Re: #MaxMem: How much is too much?

FileRead already ignores #MaxMem and just reads the whole file into a variable.

If you're really worried about coming across a huge file that would exceed your RAM, try a file parsing loop or a file object to only read a portion at a time...

Go to advanced search