 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
el Guest
|
Posted: Sun Nov 01, 2009 1:05 am Post subject: how to make things simple look complicated? |
|
|
for example, i have an equation in my script
| Code: | X := 1
Y := X**2 + 3*X + 10 |
i want it to look complicated so even ppl read it, they wont understand and hesitate to modify the script. but on the other hand, the function needs to be call frequently (few times per sec and a lot longer that the example equation, i am dealing with vectors and coordinates), so i dont want to affect the performance that much
i am thinking something like:
| Code: |
X := 1
A := sqrt(100)
Y := X**(2*sin(1.570))
D := Y + Mod(7,4)*X + A
|
what about hex calculation or NumPut, what do u guys think?
the script are read by normal ppl (leechers.....), so dont expect them to be as experienced as u guys. so the above example should stop most ppl, but just want something more complicated to stop more ppl |
|
| Back to top |
|
 |
el Guest
|
Posted: Sun Nov 01, 2009 1:08 am Post subject: |
|
|
if u guys can create something that even i dont understand, then that will be nice, but please do put some comments on whats going on, so i can convert the rest of my equations
thank you |
|
| Back to top |
|
 |
jethrow
Joined: 24 May 2009 Posts: 1907 Location: Iowa, USA
|
Posted: Sun Nov 01, 2009 2:18 am Post subject: |
|
|
The ternary operator can be confusing for people who don't understand programming. Maybe something like this: | Code: | X:=NumGet(&x,0,"UInt")+32>>5 ; If X is blank, this is the same as 0 + 32 / 2**5
Y:=SubStr(Round(4*ATan(1),16),2,1)="." ? X+x*x+10+X*2:<put whatever expression here - it won't matter> |
Note - the test part of the ternary operator checks if the 2nd character of PI is a decimal. Also, it would be fairly easy to put some more ternary operators (& nested ternary operators) to make it look confusing. _________________
- in case I forgot to smile
Basic Webpage Controls
COM Object Reference
Last edited by jethrow on Sun Nov 01, 2009 3:48 am; edited 1 time in total |
|
| Back to top |
|
 |
Guest
|
Posted: Sun Nov 01, 2009 3:19 am Post subject: |
|
|
....it does look confusing (even after i check help file)
ok, i think i will go with NumGet, BitShift and Ternary operator
thank you |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Sun Nov 01, 2009 3:43 am Post subject: Re: how to make things simple look complicated? |
|
|
| el wrote: | | i want it to look complicated so even ppl read it, they wont understand and hesitate to modify the script. |
The technical jargon is Code Obfuscation.
Try the Search Results for the forum. |
|
| Back to top |
|
 |
el Guest
|
Posted: Sun Nov 01, 2009 3:57 am Post subject: |
|
|
thanks also
i wasnt looking for something that complicated that requires multi-script or modification on the syntax of the compiler or jump around using goto...
but because of the searching, i did get a new idea from a user's signature
| Code: | | vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
i heard it is slow using regex, but wasnt that bad, everything less than 1ms is fine with me |
|
| Back to top |
|
 |
Slanter
Joined: 28 May 2008 Posts: 739 Location: Minnesota, USA
|
Posted: Sun Nov 01, 2009 7:29 pm Post subject: |
|
|
RegEx likely won't work for the purposes of math functions, it's meant for advanced string matching and replacing. _________________ Unless otherwise stated, all code is untested
(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination. |
|
| Back to top |
|
 |
Guest
|
Posted: Sun Nov 01, 2009 7:56 pm Post subject: |
|
|
it seems work
| Code: | NewStr := RegExReplace("abc123", "i)^ABC") + 2 ;123+2
msgbox, % NewStr |
|
|
| Back to top |
|
 |
Scratch
Joined: 22 Jan 2009 Posts: 72
|
Posted: Mon Nov 02, 2009 12:08 am Post subject: |
|
|
| Code: |
3dvector := asc("{Bumpmapping(Object,shadermodel:=(Directx11.handler))}")
DLLCache := asc("? * random(nonsense) > DEVICE NULL")
;
; you can hide actual numbers in asc("string"), will only return the first character in the string as
; a numerical ASCII value, {=123 and ?=63 , the rest of the strings are pure nonsense
UseReversePolishNotation := chr((9471/3dvector))
Beziercurve1 := chr(79)
Z_Plane := chr(68)
;
; Likewise you can hide characters as numbers, CHR(9471/123=77)="M" + CHR(79)="O" + CHR("68") ="D" "Mod", modulus function, many people recognize standard asci tablenumbers in alphabet range so the "M" from mod is calculated from already fuzzed number
;
GetFrom = %UseReversePolishNotation%%BezierCurve1%%Z_plane%
;
; Bring it all together in uebergeeky function:
;
Msgbox % 3dvector %getfrom% (DLLCache) ; or even use in a regex
|
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|