AutoHotkey Community

It is currently May 27th, 2012, 12:51 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: July 30th, 2011, 10:56 pm 
Offline
User avatar

Joined: November 2nd, 2008, 4:23 pm
Posts: 2906
Location: 127.0.0.1
The challenge is to share the literal text "Just Another AutoHotkey Hacker" with whom ever runs your script. Bonus points go to anyone who finds a new way to share the phrase (e.g., MsgBox). Here's mine.

Code:
while (i?i++:i:=1)<30
o.=Chr(i|9=31&&i
^9<31?144-i:i=2||i=0xF
?0x75:(i+1)//2=2?i
|112:i=1||i=19?73
+2*i-!(i-1):i^4=15
||i=29||i>>1=11?101
:i=7||i=8?103+i:i
|20=20||i=9?116:i
|4=21?128-i:(i+i
//27^3)&15=15?126-i
:i=18||i=25?72:i^49
|8=63?65:i=17||i=10
?i+94:i=26||i=28?87
+5*((i&4)+(i&2)):32)
Msgbox %o%


Based on JAPH.


So lets see your syntax hacking skills!

_________________
aboutscriptappsscripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run


Report this post
Top
 Profile  
Reply with quote  
 Post subject: somebody had to do it.
PostPosted: July 31st, 2011, 3:55 pm 
Offline

Joined: July 31st, 2008, 10:27 pm
Posts: 336
Code:
MsgBox, Just Another AutoHotkey Hacker


:lol:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 31st, 2011, 5:57 pm 
Offline
User avatar

Joined: September 5th, 2009, 2:06 pm
Posts: 1718
Location: Somewhere near you
Code:
Error at line 16.

Line Text: o.=Chr(i|9=31&&i ^9<31?144-i:i=2||i=0xF
Error: Missing ")"

Is it for AHK_L?

_________________
Image
The quick onyx goblin jumps over the lazy dwarf


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 31st, 2011, 6:38 pm 
Offline
User avatar

Joined: November 2nd, 2008, 4:23 pm
Posts: 2906
Location: 127.0.0.1
I guess so... I just assumed basic could handle line breaks in expressions.

_________________
aboutscriptappsscripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 1st, 2011, 1:22 am 
Offline

Joined: February 20th, 2011, 9:42 pm
Posts: 433
Location: Cache Creek B.C.
EDIT: (found a cool way)
Is this what you mean? (I'm on AHK_L)
I used your code to make sure that the actual text "Just another autohotkey hacker"
appears nowhere in the script, yet the resulting created script is both named that text,
and when run, shows that text in a msgbox.
Code:
; Creates new script in script dir titled with the text to be shared,
; and the newly created script also makes a MsgBox with the text to be shared

var =
(
while (i?i++:i:=1)<30
o.=Chr(i|9=31&&i
^9<31?144-i:i=2||i=0xF
?0x75:(i+1)//2=2?i
|112:i=1||i=19?73
+2*i-!(i-1):i^4=15
||i=29||i>>1=11?101
:i=7||i=8?103+i:i
|20=20||i=9?116:i
|4=21?128-i:(i+i
//27^3)&15=15?126-i
:i=18||i=25?72:i^49
|8=63?65:i=17||i=10
?i+94:i=26||i=28?87
+5*((i&4)+(i&2)):32)
Msgbox %o%
)

while (i?i++:i:=1)<30
SavedText.=Chr(i|9=31&&i
^9<31?144-i:i=2||i=0xF
?0x75:(i+1)//2=2?i
|112:i=1||i=19?73
+2*i-!(i-1):i^4=15
||i=29||i>>1=11?101
:i=7||i=8?103+i:i
|20=20||i=9?116:i
|4=21?128-i:(i+i
//27^3)&15=15?126-i
:i=18||i=25?72:i^49
|8=63?65:i=17||i=10
?i+94:i=26||i=28?87
+5*((i&4)+(i&2)):32)

o = `%o`%
var := var A_Space o
ShareText = %A_ScriptDir%\%SavedText%.ahk
If FileExist(ShareText)
   FileDelete, %ShareText%
MsgBox, This script is about to make a new script here:`n`n%ShareText%`n`nThe new script will then be run.
FileAppend, MsgBox`, This is the new script`, `"`%A_ScriptName`%`"`, about to share the text`.`n%var%`nExitApp, %ShareText%
Run, %ShareText%
ExitApp


can I have a cookie now? :)

_________________
Some of my scripts :).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 1st, 2011, 3:30 am 
Offline

Joined: December 26th, 2010, 7:40 pm
Posts: 4172
Location: Awesometown, USA
Code:
$:="Je",j:=Asc($)-74,s:=Floor(sin(0.615307925)**(-1/tan(1.01722197))-1+(tan(1.21828291)**4*Atan(1)/sin(0.615307925)-tan(1.21828291)**-(4*atan(1))/sin(0.615307925))/(tan(1.21828291)**4*Atan(1)/sin(0.615307925)+tan(1.21828291)**-(4*Atan(1)/sin(0.615307925))))+1,$.="kures ytA  uHAtanocoHktoehtr"
While ++j && StrLen(o) < 30
   o .= SubStr($, -(j=11? --s : s)+(j=11? j := 1 : j)*3, 1)
Run % SubStr($, 622592 >> 15, 1) . SubStr($, (4095 ^ 4090) << 2, 1) . SubStr($, 10, 1) . SubStr($, s:=2, 1) . Chr(s:=110+s) . SubStr($, 11, Floor(sin(0.615307925)**(-1/tan(1.01722197)))) . Chr(s-((true << (true + true))*3)),,,@
WinWait ahk_pid %@%
WinSetTitle % o
Bonus points! No MsgBox at all :D
(believe it or not, this is 6 lines. 3 of those lines are the displaying of the string, so this could be done on 4 with a MsgBox, or 3 with a procedural MsgBox which displays 30 times: "J... Ju... Jus...")
Special thanks to Chalamius who helped me generate an integer (which one? won't tell.) with > 100 characters of code :P

_________________
Autofire, AutoClick, Toggle, SpamWindow Control Tools
Recommended: AutoHotkey_L


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 1st, 2011, 4:15 am 
Offline

Joined: February 20th, 2011, 9:42 pm
Posts: 433
Location: Cache Creek B.C.
hey! :D You used Ternary, no fair! jk

_________________
Some of my scripts :).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 1st, 2011, 4:38 am 
Offline
User avatar

Joined: November 2nd, 2008, 4:23 pm
Posts: 2906
Location: 127.0.0.1
aaronbewza wrote:
can I have a cookie now? :)

I got a little hungry....
Image


Here's another. Please, please, please don't comment on the lowercase 'h'. It's pretty much unavoidable in this case (without adding a second RegExReplace.
Code:
__:= "jaahsotcunuattok eor hhe rt   y   k   e "
_ := RegExReplace(__,".*?(.)\1.*?(.)\2(.*? ){2}.(..).*", "$2$4")
loop 4 ;
   %_%.=Trim(RegExReplace(__,"^.{" A_Index-1 "}(.).{3}(.).{3}(.).{3}(.).{3}(.)?.{3}(.)?.{3}(.)?.{3}(.)?.{3}(.)?.{3}(.)?.*?$"
   ,"$U1$3$2$4$6$5$7$9${10}$8" )) " "
   

Msgbox % Just run the script, okay? Good :-0
It requires AutoHotkey_L for the trim function.

These scripts don't work well with basic... I think part of it is the allowance of variable names. You can name a variable ridiculous names which in turn require extra spaces. ?@$? is a valid name.

nimda, that looks pretty cool. I'll have to pick it apart :)

_________________
aboutscriptappsscripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 1st, 2011, 5:14 am 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
Here's a Com based example using AutoHotkey_L:
Code:
u=http://www.autohotkey.com/forum/viewtopic.php?t=74785
r:=ComObjCreate("WinHttp.WinHttpRequest.5.1"),r.Open("GET",u),r.Send
d:=ComObjCreate("htmlfile"),d.write(r.responseText)
RegExMatch(d.body.innerText, """(.*?)""",msg)
c:=ComObjCreate("WScript.Shell").Exec("cmd.exe")
c.StdIn.WriteLine("echo " msg1 ">con")
sleep, 100
while, WinExist("ahk_pid" c.ProcessID)
   sleep, 10

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 1st, 2011, 7:57 am 
Offline
User avatar

Joined: August 23rd, 2010, 6:22 pm
Posts: 781
Location: Ontario, Canada
This one's a gui :) (3 lines):

Code:
i:=!!A_IsUnicode,u:=StrGet(NumPut(0x72745055,u:="abcd")-4,4,"CP0"),s:=Chr(65+i*22),p:=StrGet(NumPut(0x65706970,p:="efgh")-4,4,"CP0"),n:="P"SubStr(p,2),p:="\\.\"p "\woooo",n:=StrGet(NumPut(0x656D614E,t:="ijkl")-4,4,"CP0")"d" n,d:=StrGet(NumPut(0x6C6C61436C6C44,d:="ummmmmm",0,"Int64")-8,7,"CP0"),g:=StrGet(NumPut(0x746E4955,g:="mnop")-4,4,"CP0"),r:=StrGet(NumPut(0x727453,r:="qrst")-4,3,"CP0"),t:=StrGet(NumPut(0x61657243,t:="qrst")-4,4,"CP0")"te",f:=%d%(t n s,r,p,g,2,g,0,g,255,g,0,g,0,g,0,g,0),o:=%d%(t n s,r,p,g,2,g,0,g,255,g,0,g,0,g,0,g,0),t:=StrGet(NumPut(0x7461506B68415F41,t:="sometext",0,"Int64")-8,8,"CP0")"h",h:="C"StrGet(NumPut(0x646E614865736F6C,h:="wordword",0,"Int64")-8,8,"CP0")"le",w:=StrGet(NumPut(0x6C69466574697257,w:="otherone",0,"Int64")-8,8,"CP0")"e",c:="Gui,Font,s32 Bold,Arial`nGui,Add,Text,x0 y0 w700 h60 Center,Just Another AutoHotkey Hacker`nGui,Font,s18 Norm`nGui,Add,Text,x570 y60 w130 h30 Center, -Uberi`nGui,Show,w700 h90`nReturn`nGuiClose:`nExitApp"
Run, % """" %t% """ /CP"0xFDE9-63801*i " """p """"
r.="L",t:="Co"StrGet(NumPut(0x63656E6E,t:="qrst")-4,4,"CP0")"t" n,%d%(t,u,f,u,0),%d%(h,u,f),%d%(t,u,o,u,0),%d%(w,u,o,u,&c,g,%r%en(c)<<i,u,0,u,0),%d%(h,u,o)


Description (no cheating :D):

Quote:
  1. The script sets up variables using the Numput and StrGet method
  2. Two named pipe handles are set up, one to shunt control over to the other
  3. AutoHotkey is executed on these pipes
  4. The first pipe handle is disposable, and is closed while reading
  5. The second contains the actual code of the script, which is executed by AHK as if it was a file


Highlight the text above to see it.

_________________
AutoHotkey.net | GitHub

My default license.


Last edited by Uberi on August 1st, 2011, 9:00 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject: AHK_L Compatible
PostPosted: August 1st, 2011, 8:45 am 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Code:
DllCall( "MessageBoxA", UInt,VarSetCapacity($,32,32)-32, UInt, NumPut( 29285
 , NumPut( 1801675080, NumPut( 544826731,  NumPut( 1953450095, NumPut( 1953841440
 , NumPut( 1919248500, NumPut( 1869496608, NumPut( 1953723722,$ ) ) ) ) ) ) ) )-32
 , Str,SubStr($,13,11), UInt,0x30 )


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 1st, 2011, 3:34 pm 
Offline

Joined: February 20th, 2011, 9:42 pm
Posts: 433
Location: Cache Creek B.C.
Adapted from a function by rseding91:
Code:
If FileExist(A_Temp "\text.txt")
FileDelete, %A_Temp%\text.txt
text(A_Temp "\text.txt")
text(Filename) {
Static Chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
VarSetCapacity(Temp_Data,40)
Temp_Data .= "SnVzdCBBbm90aGVyIEF1dG9Ib3RrZXkgSGFja2Vy"
StringReplace Temp_Data, Temp_Data, =,, All
VarSetCapacity(Out_Data, 3*StrLen(Temp_Data)//4, 0)
pos := 0, Address := &Out_Data
Loop Parse, Temp_Data
{
m := A_Index&3, d := InStr(Chars,A_LoopField,1) - 1, b := m ? (m=1 ? d<<18 : b+(d<<24-6*m)) : b+d
IfEqual,m,0
Numput(b>>16,Address+0,Pos++,"UChar"), Numput(255 & b>>8,Address+0,Pos++,"UChar"), Numput(255 & b,Address+0,Pos++,"UChar")
}
c1 := b>>16, c2 := 255 & b>>8, c3 := 0
Loop % !!m+(m&1)
NumPut(c%A_Index%,Address+0,Pos++,"UChar")   
h := DllCall("CreateFile","str",Filename,"Uint",0x40000000,"Uint",0,"UInt",0,"UInt",4,"Uint",0,"UInt",0)
DllCall("SetFilePointerEx","Uint",h,"Int64",0,"UInt *",p,"Int",0)
DllCall("WriteFile","UInt",h,"UInt",&Out_Data,"UInt",30,"UInt",0,"UInt",0)
DllCall("CloseHandle", "Uint", h)
}
Run, %A_Temp%\text.txt
ExitApp

_________________
Some of my scripts :).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 1st, 2011, 3:39 pm 
Offline

Joined: July 6th, 2011, 5:37 pm
Posts: 214
Location: Looking over my domain
Oh wow Skan would you be interested in walking us munchkins thru that I honestly have no idea how to follow that code or how you arrived at it. That is to say, I understand how to use messageboxa but the rest is just seemingly random numbers to me
I just dont understand how these numputs build this text.
Code:
NumPut( 29285
 , NumPut( 1801675080, NumPut( 544826731,  NumPut( 1953450095, NumPut( 1953841440
 , NumPut( 1919248500, NumPut( 1869496608, NumPut( 1953723722,$ ) ) ) ) ) ) ) )-32
and yet they do


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 1st, 2011, 4:00 pm 
Offline

Joined: May 12th, 2009, 2:37 pm
Posts: 640
Location: Gloucester UK
This thread hurts my brain

_________________
The sooner you fall behind, the more time you have to catch up.


Last edited by wooly_sammoth on August 1st, 2011, 4:09 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 1st, 2011, 4:06 pm 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Zod wrote:
I just dont understand how these numputs build this text.


Numbers were retrieved with NumGet in Ansi version and hence MessageBoxA() is used for Unicode version compatibility.

Code:
s=Just Another AutoHotkey Hacker
O := &S
Loop 8
 E .= ( O := NumGet( S,4*(A_Index-1) ) ) "`n"

MsgBox, % Clipboard := E


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], bowen666 and 18 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