Good coders gone wild!

Discuss Autohotkey related topics here. Not a place to share code.
Forum rules
Discuss Autohotkey related topics here. Not a place to share code.
User avatar
tidbit
Posts: 1272
Joined: 29 Sep 2013, 17:15
Location: USA

Good coders gone wild!

03 Dec 2019, 17:36

(an expansion from discord fun)
Try to write working code using as much bad practices as possible.
poor indenting, ahk quirks, generally frowned upon practices, do it all in one script!
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
AHKStudent
Posts: 1472
Joined: 05 May 2018, 12:23

Re: Good coders gone wild!

09 Dec 2019, 05:25

How do I protect this code? MPRESS is not enough, is MCode good? Should I just watch the intellectual property webinar? I tried learning c++ but its very buggy, I went to change the STD:: hotkey to Q:: and my program broke. :thumbdown:

Code: Select all


SetBatchLines, -1 ; for great things
DetectHiddenText, on ; for optimal things
#NoEnv ; for amazing things
Global yourName ; avoid function headaches, make everything global
Global removeQuotes
Global TidBit
Global Hello
Global CountSomething
TimeNow := A_Now
TimeLate := A_TickCount
Greeting = "Hello" ; bug in ahk it should know only to look on the text in the quotes, maybe in V3 it will be fixed
yourName = "TidBit"
Sleep, 60 ; to protect the mouse from running too fast
Clipboard := RemoveQuotes(greeting) " " RemoveQuotes(yourName) ; store it in clipboard in case you need it later
ClipWait, 2 ; always wait a little 
MsgBox, % clipboard " The Date and Time now is " 
. TimeNow 
. " + " 
. (A_TickCount - TimeLate) 
. " MS."
if greeting = "Hello" 
if yourName = "Tidbit"
{
SetTimer, CountSomething, 200 ; start the loop
}
else
ExitApp
return


CountSomething:
Loop,
{
if A_index = 6
{
Settimer, CountSomething, Off  ; stop the timer
ToolTip ; turn off the tooptip or it can remain stuck until you remove the battery on your motherboard 
		ExitApp
break
}
toolTip, % A_Now
Sleep, 300 ; always add a sleep or the machine could overheat 
}
return

ExitApp

RemoveQuotes(Name) ; bug workaround 
{
{
removeQuotes := strreplace(Name, """") ; cleans up the data 0000.1 seconds faster than regex, took me a month to figure this out
	}
return removeQuotes
	}
	
User avatar
hoppfrosch
Posts: 443
Joined: 07 Oct 2013, 04:05
Location: Rhine-Maine-Area, Hesse, Germany
Contact:

Re: Good coders gone wild!

09 Dec 2019, 05:39

I would prefer the other way round: bad coders writing perfect code!
This would make more sense - and is surely a much bigger challenge! :lol:
SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: Good coders gone wild!

09 Dec 2019, 05:41

AHKStudent wrote:
09 Dec 2019, 05:25
How do I protect this code? MPRESS is not enough, is MCode good? Should I just watch the intellectual property webinar? I tried learning c++ but its very buggy, I went to change the STD:: hotkey to Q:: and my program broke. :thumbdown:
LOL! Why can't people try AutoHotkey_H or FeiYue's Encryptor for AutoHotkey_L first, before worrying about if they are getting enough "protection". Let's make the new unreadable and unbreakable AutoHotkey coded script.
User avatar
Hellbent
Posts: 2102
Joined: 23 Sep 2017, 13:34

Re: Good coders gone wild!

09 Dec 2019, 10:34

I humbly submit every script I've ever written.


@AHKStudent

lol, you had me going for half a second there. :thumbup:
DRocks
Posts: 565
Joined: 08 May 2018, 10:20

Re: Good coders gone wild!

24 Jan 2020, 17:43

Code: Select all

myautohotkeyscript

messagebox "Hello"
return
The docs say to use MsgBox to display message but when I use it (messagebox "Hello") it doesnt work wtf ?
Also why does my comment on top "myautohotkeyscript" is preventing to compile ? isnt it obvious that its plain text ?
User avatar
Masonjar13
Posts: 1555
Joined: 20 Jul 2014, 10:16
Location: Не Россия
Contact:

Re: Good coders gone wild!

17 May 2020, 13:19

Hey guys, I wrote a showcase script for AHKs best features! Hope you like it :shifty:
Btw, any way to avoid the join? Lmk.

Code: Select all

h
(join
o
t
k
e
y
)
,
(
a
)
,
(
a
)
s
(join
e
n
d
)
,
(
a
)
r
(join
e
t
u
r
n
)
a
(
:
)
m
(join
s
g
b
o
x
)
,
,
(join
K
i
l
l
%
a
_
s
p
a
c
e
%
M
e
)
,
(join
T
h
i
s
%
a
_
s
p
a
c
e
%
h
o
t
k
e
y
%
a
_
s
p
a
c
e
%
i
s
%
a
_
s
p
a
c
e
%
%
a
_
t
h
i
s
H
o
t
k
e
y
%
.
)
e
(join
x
i
t
A
p
p
)
OS: Windows 10 Pro | Editor: Notepad++
My Personal Function Library | Old Build - New Build
User avatar
Masonjar13
Posts: 1555
Joined: 20 Jul 2014, 10:16
Location: Не Россия
Contact:

Re: Good coders gone wild!

17 Jun 2020, 17:57

Hey everyone, just wanted to share this new loop I designed! I call it RegLoad. Ha, get it? c:

Code: Select all

x:="hkcu\Software\ahkdumb",y:="Hello, AHK.."
regRead,a,% x
if errorlevel{
	regWrite,reg_sz,% x,,% a:=1
	run,notepad
	winWait,ahk_exe notepad.exe
}else if !a{
	exitApp
}
send,% subStr(y,a,1)
if (a=strLen(y)){
	regDelete,% x
	exitApp
}else{
	regWrite,reg_sz,% x,,% ++a
	reload
}
Spoiler
OS: Windows 10 Pro | Editor: Notepad++
My Personal Function Library | Old Build - New Build
ShambleS1980
Posts: 37
Joined: 24 May 2020, 19:10

Re: Good coders gone wild!

29 Jul 2020, 23:51

just a simple autoclicker.


Code: Select all

#MaxThreadsPerHotkey 2
setbatchlines, -1 
while GetKeyState("xbutton1","T")
xbutton1::
toggle := !toggle
If (!Toggle)
    goto, stop
If (Toggle)
    goto, canyou
return
omg:
loop
{
click
}
return
ffs:
reload
return
canyou:
goto, really
return
seriously:
SoundBeep , 750, 500
goto, ffs
return
stop:
msgbox, pointless message here too
goto, seriously
return
really:
msgbox, Pointless message here
SoundBeep , 300, 600
goto, omg
return

p.s
i am not a good coder, Just decided to make a script to annoy the people who saw it..

p.p.s

I decided the above was too useful..
so here we go

Code: Select all

while GetKeyState("xbutton1","T")
$*xbutton1::
toggle := !toggle
If (!Toggle)
    goto, 111111
If (Toggle)
    goto, 1111111
return
11111:
send, {xbutton1}
SoundBeep , %11111%, %IIIII%
return
11111111:
send, {xbutton1}
SoundBeep , %11111%, %IIIII%
goto, 1111III
return
111111111:
loop
{
GetKeyState("capslock","T")
send, {xbutton1}
while GetKeyState("lshift","T")
send, {xbutton1}
while GetKeyState("rshift","T")
send, {xbutton1}
while GetKeyState("a","T")
send, {xbutton1}
while GetKeyState("b","T")
send, {xbutton1}
while GetKeyState("c","T")
send, {xbutton1}
reload
}
return

1111111:
SoundBeep , %11111%, %IIIII%
goto, IIIIIIII
return
IIIIIIIIII:
SoundBeep , %11111%, %IIIII%
goto, 11111111
return

111111:
msgbox, pointless message here too
SoundBeep , %11111%, %IIIII%
goto, IIIIIIIIII
return
IIIIIIII:
msgbox, Pointless message here
SoundBeep , %11111%, %IIIII%
goto, 11111
return
1111III:
reload
return
esc::exitapp

ShambleS1980
Posts: 37
Joined: 24 May 2020, 19:10

Re: Good coders gone wild!

30 Sep 2021, 17:44

Actually gave some one this dogs breakfast as code today..

"in my defence they pinged me for some un known reason, and i nad to put the kids to bed"

Code: Select all

$*a::
vara := 1
send, {blind}a
return
$*a up::
vara := 0
settimer, aspam, off
return

*$b::
varb := 1
send, {blind}b
return
$*b up::
varb := 0
settimer, bspam, off
return

#if vara
*a up::
vara := 0
settimer, aspam, off
return
*b up::
settimer, aspam, 20
return
#if

#if varb
$*b up::
varb := 0
settimer, bspam, off
return
a up::
settimer, bspam, 20
return
#if

aspam:
send, {blind}a
if !getkeystate("a","p")
{
settimer, aspam, off
vara := 0
}
return

bspam:
send, {blind}b
if !getkeystate("b","p")
{
settimer, bspam, off
varb := 0
}
return
ShambleS1980
Posts: 37
Joined: 24 May 2020, 19:10

Re: Good coders gone wild!

18 May 2022, 22:41

BEHOLD MY CREATION!

Code: Select all

#persistent
settitlematchmode 2
DetectHiddenWindows On

f2::
WinGet, count, list, ahk_class AutoHotkey
WinGet, title, ID, tester.ahk ahk_class AutoHotkey

loop % count
{
countvar%a_index% := count%a_index%
}
var := countvar1 " " . countvar2 " " . countvar3 " " . countvar4 " " . countvar5 " " . countvar6 " " .  countvar7 " " . countvar8 " " . countvar9 " " . countvar10 " " . countvar11 " "

output := StrReplace(var, title, ".")
array := StrSplit(output, A_Space, ".")


Loop % array.MaxIndex()
{
 PostMessage, 0x111, 65307,,, % "ahk_id" array[a_index]
}

reload ; comment this out, and uncomment "exitapp" if you wantto exit the script instead 
sleep 100
; exitapp "uncomment this if you want to close this script, and remember to comment out reload"
return
this works as intended, and i had to bend over backwards not to use a real array in this one.
ShambleS1980
Posts: 37
Joined: 24 May 2020, 19:10

Re: Good coders gone wild!

12 Jun 2022, 19:39

Ok this 1 im annoyed about..
some one refuzed to use

Code: Select all

:?*:nn::ñ
So I had to write this!

Code: Select all

~n::
doExtraStuff10++
settimer, clearvar, -200
if !getkeystate("capslock","t")
setTimer, extraStuffTimer10, -140
else
seTtimer, extrastuffdifferent, -140
return

~+n::
doExtraStuff10++
settimer, clearvar, -200
if getkeystate("capslock","t")  ; This time we want this timer to trigger IF caps lock is on
setTimer, extraStuffTimer10, -140
else
seTtimer, extrastuffdifferent, -140
return

extraStuffTimer10:
if (doExtraStuff10 == 2) {
    Send {Blind}{BackSpace}
    Send {Blind}{BackSpace}
    Send ñ
}
return

extrastuffdifferent:
if (doExtraStuff10 == 2) {
    Send {Blind}{BackSpace}
    Send {Blind}{BackSpace}
send Ñ
}
return

clearvar:
doExtraStuff10 := 0
return
User avatar
tidbit
Posts: 1272
Joined: 29 Sep 2013, 17:15
Location: USA

Re: Good coders gone wild!

13 Jun 2022, 15:47

I weep for you
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
User avatar
Delta Pythagorean
Posts: 627
Joined: 13 Feb 2017, 13:44
Location: Somewhere in the US
Contact:

Re: Good coders gone wild!

15 Jun 2022, 03:06

Forgive me father for I have sinned.

Code: Select all

name=  ;//Enter your name here!!!

email=  ;//Enter your email here!!!

password=  ;//Enter your password here, don't tell anyone!!!

setBatchLines,100 ;// Add 100 milliseconds in between each command.

goTo,AutoExecSection ;// Go to the AutoExecSection label.


;// Auto exec section

AutoExecSection:

msgBox,0,Best Hacker Script Ever!!,Thanks for downloading this script! It's the best hacker script ever!!, 5 ;// Display a message box.

formatTime,time,,HH:mm:ss tt ;//Get the current time.

toolTip,The Time is: %time% ;//Display the current time in a tool tip.

return ;//Close out of the auto exec section


;// Bunny hop when you hold spacebar!

Space::

getKeyState,space_keyPress,Space,P ;//Check if the spacebar is pressed.

ifEqual,space_keyPress,1,setTimer,BunnyHop,100 ;//If the spacebar is pressed, execute the BunnyHop label.

else

setTimer,BunnyHop,off ;//If the spacebar is not pressed, turn off the timer.

return


;// Bunny hop code
BunnyHop:

send,{Space} ;//Press the spacebar.

return ;//Close out of the BunnyHop label.

[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 18 guests