Page 2 of 5

Re: AHKathon! [AHK Hackathon] 12/17

Posted: 17 Nov 2017, 09:50
by BoBo
AHKBigglier.png
AHKBigglier.png (83.4 KiB) Viewed 5391 times
:mrgreen:

Re: AHKathon! [AHK Hackathon] 12/17

Posted: 18 Nov 2017, 01:05
by Masonjar13
Browser automation could most certainly be a topic! That would have many interesting results, I'm sure! I'll make a note :thumbup:

@Capn Odin, don't sell yourself short; you've done great work on here :) and sometimes creativity doesn't show up in a typical manner.. ;) Good luck with your assignment!

Bigglier, you say? :lol:

Re: AHKathon! [AHK Hackathon] 12/17

Posted: 29 Nov 2017, 04:56
by BoBo
Image
Communication breakdown :lolno:

Re: AHKathon! [AHK Hackathon] 12/17

Posted: 30 Nov 2017, 20:12
by Masonjar13
It's time for the topic announcement! Apologies for the hour delay, I forgot to compensate for DST :oops:

Anyways, the first topic will be something that I typically start with when teaching people AutoHotkey, due to the simplicity and room for extra creativity: Auto-clicking!

As mentioned, the script simply needs to be based around the concept. Please be sure not to break any of the rules posted on the OP to avoid being disqualified! No further entries will be allowed after Friday, December 8th @ 11:59pm UTC, so be sure to get them in before that time!

Also a note: if someone wishes to participate, but does not want to be eligible for the prize, simply state so in your entry. I'll still score it, and I'll leave a mention if it qualified for a prize when posting winners.

Re: AHKathon! [AHK Hackathon] 12/17

Posted: 01 Dec 2017, 04:00
by just me
Auto-clicking! And the prize: "The top 3 winners will get Steam/UPlay game keys of incremental value." :facepalm:

Re: AHKathon! [AHK Hackathon] 12/17

Posted: 01 Dec 2017, 04:34
by jeeswg
I'd better watch that film Click, to give me some ideas. Is the film any good?

Re: AHKathon! [AHK Hackathon] 12/17

Posted: 01 Dec 2017, 05:28
by Masonjar13
just me wrote: :facepalm:
I presume you didn't read the rules? :roll: Plenty of other uses to be made of the topic, and it's about code design, anyway.

Being serious though, I trust you have something better to do than complain about your morals not being met, yes?
jeeswg wrote:I'd better watch that film Click, to give me some ideas. Is the film any good?
:lol: Never seen it. Though, it has a below-average rating, so probably not.

Re: AHKathon! [AHK Hackathon] 12/17

Posted: 01 Dec 2017, 05:31
by nnnik
just me wrote:Auto-clicking! And the prize: "The top 3 winners will get Steam/UPlay game keys of incremental value." :facepalm:
Talking about games when you have no idea about gaming :facepalm:
Spoiler

Re: AHKathon! [AHK Hackathon] 12/17

Posted: 01 Dec 2017, 14:18
by Capn Odin
You will never again need to click manually, with this one simple entry.

Code: Select all

loop {
	Click
}

Re: AHKathon! [AHK Hackathon] 12/17

Posted: 01 Dec 2017, 16:05
by waetherman
Capn Odin wrote:You will never again need to click manually, with this one simple script.

Code: Select all

loop {
	Click
}
I modified your code a lil bit:

Code: Select all

#NoEnv
SendMode Input
SetBatchLines -1

CoordMode Mouse, Client
send #r
WinWait Run ahk_class #32770 ahk_exe explorer.exe
send mspaint{Enter}
WinWait Untitled - Paint ahk_class MSPaintApp ahk_exe mspaint.exe
send ^w
WinWait Resize and Skew ahk_class #32770 ahk_exe mspaint.exe
send {right}{Tab}400{Tab}{Tab}{Space}+{Tab}400{Enter}
WinWaitActive Untitled - Paint ahk_class MSPaintApp ahk_exe mspaint.exe
start := A_TickCount
OFFSET_X := 5
OFFSET_Y := 152
DIAMETER := 250
CENTER_X := OFFSET_X + 200
CENTER_Y := OFFSET_Y + 200
STEPS := 1000
MouseMove, % CENTER_X, % CENTER_Y, 0
send ^{NumpadAdd}^{NumpadAdd}^
send {Lbutton down}

Loop 2 {
	offset := A_Index - 1
	Loop % STEPS {
		if (offset == 0) {
			baseval := A_Index
		} else {
			baseval := STEPS - A_Index + 1
		}
		angle := baseval * 0.1337
		distance := DIAMETER/2 * (baseval/STEPS)
		distance -= offset*8
		x := CENTER_X + Sin( angle ) * distance
		y := CENTER_Y + Cos( angle ) * distance
		MouseMove, %x%, %y%, 0
		if ( Mod(A_Index, 2) ) {
			send {Lbutton up}
		} else {
			send {Lbutton down}
		}
	}
}
send {Lbutton up}
exitapp

esc::
pause::
	exitapp

Re: AHKathon! [AHK Hackathon] 12/17

Posted: 01 Dec 2017, 17:25
by BoBo
nnnik wrote:
just me wrote:Auto-clicking! And the prize: "The top 3 winners will get Steam/UPlay game keys of incremental value." :facepalm:
Talking about games when you have no idea about gaming :facepalm:
Spoiler
Exactly what I pray, day - after - day - after day : stop playing games !! :mrgreen: (I'll go with #4!)

Re: AHKathon! [AHK Hackathon] 12/17

Posted: 01 Dec 2017, 20:37
by A_AhkUser
Entries will be judged on performance, UI, ease of use, and readability
:headwall:

Code: Select all

Loop {
	A.(U,T,O,_,C,L,I,C.K,I,N,G)
	A.(U,T,O,_,C,L,I,C.K,I,N,G)
	sleep, 1000
}
return

f(arguments:="") {
local string, i, n
n := StrLen(arguments+(i:=!!(string:=""))) // 2
while (n--)
	string .= %v%(SubStr(arguments, 2*i+1, 2)), i++, O := O + ((O - 2) ? -2 : 2)
return (string) ? (%w%(%v%(123) . %v%(58) . %v%(76) . %v%(125), string)) : 0
}
g() {
static dummy := g()
global a,u,t,o,_,c,l,i,k,n,g,v,w

	v :="chr", w:="format"
	o := (i := g := f() + 4)
	_ := l := n := f(737884)
	a := f(68767667657676)
	u := f(7779858369) . f(956986697884)
	(c:={}).k := t := f(85737884)
	
}
Spoiler
Can we say that it is at least more readable? No comments needed: the script speak for itself :lol:

Re: AHKathon! [AHK Hackathon] 12/17

Posted: 01 Dec 2017, 21:13
by Capn Odin
A_AhkUser wrote:Can we say that it is at least more readable? No comments needed: the script speak for itself :lol:
I am at a loss, I can't find the place where you do the DllCall("mouse_event"). (In my defense it is fairly late here, and I am not on my medication)

Re: AHKathon! [AHK Hackathon] 12/17

Posted: 01 Dec 2017, 23:50
by Masonjar13
waetherman wrote:I modified your code a lil bit
Just a tad ;) I quite like how concise it is, actually.
A_AhkUser wrote:Can we say that it is at least more readable?
This is for AutoHotkey, not minimized JS :lol:

Notice: I changed the participation portion slightly. So on your entries, please state it as being your entry at the top of your post. Thanks!

Re: AHKathon! [AHK Hackathon] 12/17

Posted: 02 Dec 2017, 18:26
by A_AhkUser
@Capn Odin I know it's hard to fool insight of ahksuperstars; once one is able to see that this relies on mouse_event function via dllcall, it's done. Btw, saying that the script speak for itself I had in mind the fact that without any comments one can still guess this will go auto-clicking since the call borrow the letters of the theme to perform the dllcall and only after I realized that one can also see some irony seeing how the script is written... :terms: :lol:

@Masonjar13 I "prettified" it... However, jslint still says it is unable to finish - any ideas? :lol:

Re: AHKathon! [AHK Hackathon] 12/17

Posted: 03 Dec 2017, 13:45
by Masonjar13
A_AhkUser, that took me a while to comprehend.. It's really quite clever. And unable to finish? In the sense that it's an indefinite loop? :P

Re: AHKathon! [AHK Hackathon] 12/17

Posted: 04 Dec 2017, 02:18
by Capn Odin
I am sorry Masonjar13, that my entry is so good that no one else dares submit one.

Re: AHKathon! [AHK Hackathon] 12/17

Posted: 04 Dec 2017, 04:38
by Micromegas
Oh, don't worry about that, Capn Odin, there's always rule #5; that sounds like a good enough reason to invoke it. :lol:

Re: AHKathon! [AHK Hackathon] 12/17

Posted: 04 Dec 2017, 07:01
by waetherman
Micromegas wrote:Oh, don't worry about that, Capn Odin, there's always rule #5; that sounds like a good enough reason to invoke it. :lol:
Such rules are actually great to demotivate people from putting too much effort in their participation. I mean, for example, I wanted to try and make as good enry as Captain's, but I'm not going to lose my time if I can get disqualified for some absurd reason like "entry too simple" or something like that.

Re: AHKathon! [AHK Hackathon] 12/17

Posted: 04 Dec 2017, 09:25
by Micromegas
waetherman wrote:Such rules are actually ...
OK, it seems it's time for a serious discussion. When you write "actually", do you actually have anything to back up your claim, such as a scientific study or some concrete real-life experience, or is it just your gut feel? Or do you mean that you yourself are feeling demotivated by this rule?