Heres my scripts for Terrarria.
Autohotkey uses text files saved as .ahk to run scripts. Fairly simple and you can do a lot with it.
My first Script for Terraria, until I make something more complex: Left finger saver. Code is between, not including, ><. Will make downloadable files in future, for now, copy paste into notepad and name it what you want and save as .ahk and run the script.
Remap CTRL to leftmouseclick for finger saving.
Remap CTRL to constant clicking, use shift to break the function. Note, careful, this will continue pressing click outside of program (removed a checker because it was slowing down, will need to look into it further)
Gravedigger: dig directly at your feet (this is using the standard resolution I got, will need to create a function to get screensize later and modify it automatically. Till then, modify manually to suit your screen resolution: if you need to move UP on the screen, decrease the second number on mouseclick. First variable is x, which works normally.
Start Gravedigger by pressing control+x, stop by holding down Z (has to wait to get past sleep).
Autotunnel Left/right: Once again, these are quick values based on my game, modify the click location as necessary.
Use: Ctrl+ F to start mining left, Ctrl+ G to start mining right. Character will mine 3 tiles and then move forward (untested on harder materials atm). Break function by holding down R for let, or T for right.
>
WinWait, Terraria: Shut Up and Dig Gaiden!,
^F::
Loop
{
GetKeyState, breakfunction, r
if breakfunction = D
break
else
{
MouseClick, left, 387, 302
Click down
Sleep, 1000
Click up
MouseClick, left, 387, 317
Click down
Sleep, 1000
Click up
MouseClick, left, 387, 339
Click down
Sleep, 1000
click up
GetKeyState, breakfunction, r
if breakfunction = D
break
else
{
Send, {a down}
Sleep 300
Send, {a up}
}
}
}
return
^G::
Loop
{
GetKeyState, breakfunction, t
if breakfunction = D
break
else
{
MouseClick, left, 420, 302
Click down
Sleep, 1000
Click up
MouseClick, left, 420, 317
Click down
Sleep, 1000
Click up
MouseClick, left, 420, 339
Click down
Sleep, 1000
click up
GetKeyState, breakfunction, t
if breakfunction = D
break
else
{
Send, {d down}
Sleep 300
Send, {d up}
}
}
}
return
<
In process of improving/getting an alternate for tunneler: Safety tunneling with lighting. See vid here, still working on it.
Have it somewhat done, still getting stuff converted to proper functions and need to work on things still, like automatically getting your resolution and setting proper click spots for that. Get the current version here:
lapTerraria: keys to move the mouse around, click areas around you: automatically forms to your screen resolution, can reset the mouse cursor to the center or move it back to where you had it with a simple keypress. Also has numpad functionality.
pause::Suspend
/*
press control+c to start and stop script key access
keys as follows
Center Mouseposition q, g, numpad5
Mouse-to-lastposition Ctrl+q, h, Ctrl+numpad5
Mouse Left-Up: r, numpad7
Mouse Up: t, y, up, numpad8
Mouse Right-Up: u, numpad9
Mouse Left: f, left, numpad4
Mouse Right: j, right, numpad6
Mouse Left-Down: v, numpad1
Mouse Down: b, n, down, numpad2
Mouse Right-Down: m, numpad3
Hold-to-leftclick spacebar
hold-to-rightclick e
clickbuttons: these move the mouse to an area and click once automatically for you: use them by
pressing CTRL+ above mouse movement keys: due to limitations, down and up only click in one spot,
use ctrl+t/y or ctrl+b/n to click above left/right or below left/right
*/
stopfunc = 0
mouselastx = 0
mouselasty = 0
spacequit = 0
^c::
if (stopfunc==0)
{
stopfunc = 1
return
}
stopfunc = 0
return
^r::
^NumpadHome::
^Numpad7::
WinWaitActive, Terraria, , 2
if ErrorLevel
{
return
}
if (stopfunc==0)
{
return
}
WinGetActiveStats, Terraria, width, height, X, Y
posx := width/2-20
posy := height/2-15
MouseClick, left, posx, posy
Click down
sleep, 100
Click up
return
^t::
WinWaitActive, Terraria, , 2
if ErrorLevel
{
return
}
if (stopfunc==0)
{
return
}
WinGetActiveStats, Terraria, width, height, X, Y
posx := width/2-7
posy := height/2-32
MouseClick, left, posx, posy
Click down
sleep, 100
Click up
return
^y::
^up::
^NumpadUp::
^Numpad8::
WinWaitActive, Terraria, , 2
if ErrorLevel
{
return
}
if (stopfunc==0)
{
return
}
WinGetActiveStats, Terraria, width, height, X, Y
posx := width/2+7
posy := height/2-32
MouseClick, left, posx, posy
Click down
sleep, 100
Click up
return
^u::
^NumpadPgUp::
^Numpad9::
WinWaitActive, Terraria, , 2
if ErrorLevel
{
return
}
if (stopfunc==0)
{
return
}
WinGetActiveStats, Terraria, width, height, X, Y
posx := width/2+20
posy := height/2-15
MouseClick, left, posx, posy
Click down
sleep, 100
Click up
return
^f::
^left::
^NumpadLeft::
^Numpad4::
WinWaitActive, Terraria, , 2
if ErrorLevel
{
return
}
if (stopfunc==0)
{
return
}
WinGetActiveStats, Terraria, width, height, X, Y
posx := width/2-20
posy := height/2
MouseClick, left, posx, posy
Click down
sleep, 100
Click up
return
^j::
^right::
^NumpadRight::
^Numpad6::
WinWaitActive, Terraria, , 2
if ErrorLevel
{
return
}
if (stopfunc==0)
{
return
}
WinGetActiveStats, Terraria, width, height, X, Y
posx := width/2+20
posy := height/2
MouseClick, left, posx, posy
Click down
sleep, 100
Click up
return
^v::
^NumpadEnd::
^Numpad1::
WinWaitActive, Terraria, , 2
if ErrorLevel
{
return
}
if (stopfunc==0)
{
return
}
WinGetActiveStats, Terraria, width, height, X, Y
posx := width/2-20
posy := height/2+15
MouseClick, left, posx, posy
Click down
sleep, 100
Click up
return
^b::
WinWaitActive, Terraria, , 2
if ErrorLevel
{
return
}
if (stopfunc==0)
{
return
}
WinGetActiveStats, Terraria, width, height, X, Y
posx := width/2-7
posy := height/2+32
MouseClick, left, posx, posy
Click down
sleep, 100
Click up
return
^n::
^Down::
^NumpadDown::
^Numpad2::
WinWaitActive, Terraria, , 2
if ErrorLevel
{
return
}
if (stopfunc==0)
{
return
}
WinGetActiveStats, Terraria, width, height, X, Y
posx := width/2+7
posy := height/2+32
MouseClick, left, posx, posy
Click down
sleep, 100
Click up
return
^m::
^NumpadPgDn::
^Numpad3::
WinWaitActive, Terraria, , 2
if ErrorLevel
{
return
}
if (stopfunc==0)
{
return
}
WinGetActiveStats, Terraria, width, height, X, Y
posx := width/2+20
posy := height/2+15
MouseClick, left, posx, posy
Click down
sleep, 100
Click up
return
g::
q::
NumpadClear::
Numpad5::
WinWaitActive, Terraria, , 2
if ErrorLevel
{
return
}
if (stopfunc==0)
{
return
}
WinGetActiveStats, Terraria, width, height, X, Y
MouseGetPos, setx, sety
mouselastx := setx
mouselasty := sety
MouseMove, width/2, height/2
return
h::
^q::
^NumpadClear::
^Numpad5::
WinWaitActive, Terraria, , 2
if ErrorLevel
{
return
}
if (stopfunc==0)
{
return
}
MouseMove, mouselastx, mouselasty
return
r::
NumpadHome::
Numpad7::
WinWaitActive, Terraria, , 2
if ErrorLevel
{
return
}
if (stopfunc==0)
{
return
}
MouseGetPos, currx, curry
MouseMove, currx-15, curry-15
return
t::
y::
up::
NumpadUp::
Numpad8::
WinWaitActive, Terraria, , 2
if ErrorLevel
{
return
}
if (stopfunc==0)
{
return
}
MouseGetPos, currx, curry
MouseMove, currx, curry-15
return
u::
NumpadPgUp::
Numpad9::
WinWaitActive, Terraria, , 2
if ErrorLevel
{
return
}
if (stopfunc==0)
{
return
}
MouseGetPos, currx, curry
MouseMove, currx+15, curry-15
return
f::
left::
NumpadLeft::
Numpad4::
WinWaitActive, Terraria, , 2
if ErrorLevel
{
return
}
if (stopfunc==0)
{
return
}
MouseGetPos, currx, curry
MouseMove, currx-15, curry
return
j::
right::
NumpadRight::
Numpad6::
WinWaitActive, Terraria, , 2
if ErrorLevel
{
return
}
if (stopfunc==0)
{
return
}
MouseGetPos, currx, curry
MouseMove, currx+15, curry
return
v::
NumpadEnd::
Numpad1::
WinWaitActive, Terraria, , 2
if ErrorLevel
{
return
}
if (stopfunc==0)
{
return
}
MouseGetPos, currx, curry
MouseMove, currx-15, curry+15
return
b::
n::
down::
NumpadDown::
Numpad2::
WinWaitActive, Terraria, , 2
if ErrorLevel
{
return
}
if (stopfunc==0)
{
return
}
MouseGetPos, currx, curry
MouseMove, currx, curry+15
return
m::
NumpadPgDn::
Numpad3::
WinWaitActive, Terraria, , 2
if ErrorLevel
{
return
}
if (stopfunc==0)
{
return
}
MouseGetPos, currx, curry
MouseMove, currx+15, curry+15
return
space::
WinWaitActive, Terraria, , 2
if ErrorLevel
{
return
}
if (stopfunc==0)
{
return
}
while GetKeyState("space")
{
Click down
sleep 100
Click up
sleep 100
}
return
e::
WinWaitActive, Terraria, , 2
if ErrorLevel
{
return
}
if (stopfunc==0)
{
return
}
while GetKeyState("e")
{
Click down right
sleep 100
Click up right
sleep 100
}
return