Jump to content

A question about Autohotkey


Sy_Accursed

Recommended Posts

Trying to prank someone and I know you can re-map the keyboard with autohotkey then make the script an exe so u can dump it into a folder on their computer and set it running for a quick prank.

 

What I'd like some advice on: Is there a way to, opposed to remapping the keyboard as in a = h etc. to make it so key presses output certain things based on order. Eg Make it so first key press outputs "I " second "am " third "an " etc. up to say 10 outputs then loop back to start?

Plv6Dz6.jpg

Operation Gold Sparkles :: Chompy Kills ::  Full Profound :: Champions :: Barbarian Notes :: Champions Tackle Box :: MA Rewards

Dragonkin Journals :: Ports Stories :: Elder Chronicles :: Boss Slayer :: Penance King :: Kal'gerion Titles :: Gold Statue

Link to comment
Share on other sites

messages = ["I","am","a"]
i = 0
a::
sendinput, % messages[%i%]
if (i < 10){ ; I forget the syntax for the max length of an array. If you can figure it out, use that instead of 10. It should be messages.maxlen or something.
i++
}
else{
i = 0
}

Link to comment
Share on other sites

Would I be right in assuming that code would only work for pressing the a key and tht for it to trigger on any key I'd need to tweak to (Totally copied this from the input command examples on making any key trigger something)

 

messages = ["I","am","a"]
i = 0
Input, SingleKey, L1, {LControl}{RControl}{LAlt}{RAlt}{LShift}{RShift}{LWin}{RWin}{AppsKey}{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{Left}{Right}{Up}{Down}{Home}{End}{PgUp}{PgDn}{Del}{Ins}{BS}{Capslock}{Numlock}{PrintScreen}{Pause}
sendinput, % messages[%i%]
if (i < 10){
i++
}
else{
i = 0
}

 

Or would it be slightly more messy, but less hassle just to build it like:

messages = ["I","am","a"]
i = 0
a::
sendinput, % messages[%i%]
if (i < 10){
i++
}
else{
i = 0
}


b::
sendinput, % messages[%i%]
if (i < 10){
i++
}
else{
i = 0
}

 

And so on and so forth.

Plv6Dz6.jpg

Operation Gold Sparkles :: Chompy Kills ::  Full Profound :: Champions :: Barbarian Notes :: Champions Tackle Box :: MA Rewards

Dragonkin Journals :: Ports Stories :: Elder Chronicles :: Boss Slayer :: Penance King :: Kal'gerion Titles :: Gold Statue

Link to comment
Share on other sites

Just for completeness I thought I'd drop in I did get it working in the end in the following form:


#NoTrayIcon
typea = Why{space}don't{space}you{space}fix{space}me{space}Tom?{space}
typeb = Tom{space}can't{space}type.{space}
typec = Tom{space}should{space}do{space}some{space}work.{space}
typed = Nope,{space}Tom{space}this{space}is{space}not{space}right.{space}
typee = Tom{space}Moran{space}broke{space}me.{space}
typenum = Why{space}are{space}you{space}failing?{space}
typespace = This{space}is{space}an{space}empty{space}space,{space}like{space}Tom's{space}brain.{space}
typetab = Tabulating{space}your{space}typing:{space}Failed.{space}
typeenter = Enter{space}the{space}madness.{space}
typeesc = There{space}is{space}no{space}escape{space}Thomas.{space}
typebk = There's{space}no{space}way{space}back.{space}
typearrow = All{space}directions{space}lead{space}to{space}madness.{space}
typecaps = WE{space}MUST{space}NOT{space}SHOUT.{space}
typefunc = Detected{space}Thomas{space}Moran.{space}Function{space}Denied.{space}
typewin = Windows{space}has{space}no{space}power{space}here.{space}
typesyma = You{space}have{space}no{space}control{space}Tom.{space}
typesymb = Hurry{space}up{space}and{space}fix{space}me{space}Thomas.{space}
typealt = No{space}alternates{space}allowed{space}Thomas.{space}
typeshift = You{space}cannot{space}shift{space}the{space}problem{space}Tom.{space}

$a::Send,%typea%
$b::Send,%typeb%
$c::Send,%typec%
$d::Send,%typed%
$e::Send,%typee%
$f::Send,%typea%
$g::Send,%typeb%
$h::Send,%typec%
$i::Send,%typed%
$j::Send,%typee%
$k::Send,%typea%
$l::Send,%typea%
$m::Send,%typeb%
$n::Send,%typec%
$o::Send,%typed%
$p::Send,%typee%
$q::Send,%typea%
$r::Send,%typeb%
$s::Send,%typec%
$t::Send,%typed%
$u::Send,%typee%
$v::Send,%typea%
$w::Send,%typeb%
$x::Send,%typec%
$y::Send,%typed%
$z::Send,%typee%
$1::Send,%typenum%
$2::Send,%typenum%
$3::Send,%typenum%
$4::Send,%typenum%
$5::Send,%typenum%
$6::Send,%typenum%
$7::Send,%typenum%
$8::Send,%typenum%
$9::Send,%typenum%
$0::Send,%typenum%
$Space::Send,%typespace%
$Tab::Send,%typetab%
$Enter::Send,%typeenter%
$Esc::Send,%typeesc%
$Backspace::Send,%typebk%
$Del::Send,%typebk%
$Up::Send,%typearrow%
$Down::Send,%typearrow%
$Left::Send,%typearrow%
$Right::Send,%typearrow%
$CapsLock::Send,%typecaps%
$F1::Send,%typefunc%
$F2::Send,%typefunc%
$F3::Send,%typefunc%
$F4::Send,%typefunc%
$F5::Send,%typefunc%
$F6::Send,%typefunc%
$F7::Send,%typefunc%
$F8::Send,%typefunc%
$F9::Send,%typefunc%
$F10::Send,%typefunc%
$F11::Send,%typefunc%
$F12::Send,%typefunc%
$LWin::Send,%typewin%
$RWin::Send,%typewin%
$~Alt::Send,%typealt%
$~Shift::Send,%typeshift%
$/::Send,%typesyma%
$\::Send,%typesymb%
$.::Send,%typesyma%
$,::Send,%typesymb%
$#::Send,%typesyma%
$'::Send,%typesymb%
$;::Send,%typesyma%
$]::Send,%typesymb%
$[::Send,%typesyma%
$=::Send,%typesymb%
$-::Send,%typesyma%
$`::Send,%typesymb%

Initially tried without the variable for text, but it went weird and just kept typing indefinitely no matter what I did, also had to put in the $ for nohook otherwise it set off hotkeys for what the variable typed.

Had to take out ctrl as plain ctrl (depress) was pointless as it didn't trigger after using ctrl a or w/e and ~ctrl (press) resulted in endless typing.

Also left out a few mappable keys like home insert numlock scroll lock numpad etc as prank is aimed at a laptop so they don't exist.

Plv6Dz6.jpg

Operation Gold Sparkles :: Chompy Kills ::  Full Profound :: Champions :: Barbarian Notes :: Champions Tackle Box :: MA Rewards

Dragonkin Journals :: Ports Stories :: Elder Chronicles :: Boss Slayer :: Penance King :: Kal'gerion Titles :: Gold Statue

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.