AutoHotkey Community

It is currently May 26th, 2012, 11:01 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: November 1st, 2009, 2:05 am 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 1st, 2009, 2:08 am 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 1st, 2009, 3:18 am 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
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.

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Last edited by jethrow on November 1st, 2009, 4:48 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 1st, 2009, 4:19 am 
....it does look confusing (even after i check help file)
ok, i think i will go with NumGet, BitShift and Ternary operator
thank you


Report this post
Top
  
Reply with quote  
PostPosted: November 1st, 2009, 4:43 am 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 1st, 2009, 4:57 am 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 1st, 2009, 8:29 pm 
Offline

Joined: May 28th, 2008, 2:11 am
Posts: 739
Location: Minnesota, USA
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 1st, 2009, 8:56 pm 
it seems work
Code:
NewStr := RegExReplace("abc123", "i)^ABC") + 2 ;123+2
msgbox, % NewStr


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2009, 1:08 am 
Offline

Joined: January 22nd, 2009, 3:43 pm
Posts: 84
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


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], hyper_, JSLover, Kirtman, Leef_me, Miguel, XstatyK, Yahoo [Bot] and 63 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group