Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ; #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- FormatTime, CDD1,, dd
- FormatTime, CDD2,, MMMM
- FormatTime, CDD3,, yyyy
- FormatTime, CTT1,, hh
- FormatTime, CTT2,, mm
- FormatTime, CTT3,, tt
- FormatTime, CTT4,, ss
- catc:=1
- global catc
- global h
- global v
- global h0
- global v0
- global h1
- global v1
- global h2
- global v2
- global sch
- global scw
- ;These are the raw hotkeys as read from the configuration file (will read w or f or t or f11 or PgDn)
- FileReadLine, www, STCHconfig.txt, 30
- global www
- FileReadLine, eee, STCHconfig.txt, 36
- global eee
- FileReadLine, rrr, STCHconfig.txt, 42
- global rrr
- FileReadLine, ttt, STCHconfig.txt, 48
- global ttt
- FileReadLine, yyy, STCHconfig.txt, 54
- global yyy
- FileReadLine, sss, STCHconfig.txt, 60
- global sss
- FileReadLine, ggg, STCHconfig.txt, 66
- global ggg
- FileReadLine, ddd, STCHconfig.txt, 72
- global ddd
- FileReadLine, fff, STCHconfig.txt, 78
- global fff
- FileReadLine, cloclo, STCHconfig.txt, 90
- global cloclo
- FileReadLine, cencen, STCHconfig.txt, 97
- global cencen
- FileReadLine, cencen, STCHconfig.txt, 97
- global cencen
- FileReadLine, widwid, STCHconfig.txt, 16
- global widwid
- FileReadLine, heihei, STCHconfig.txt, 21
- global heihei
- FileReadLine, waiwai, STCHconfig.txt, 84
- global waiwai
- FileReadLine, suprsupr, STCHconfig.txt, 104
- global suprsupr
- ;shorter wait
- ; /4 is fastest allowed with defaults /5 is too fast
- shwshw:=waiwai/4
- global shwshw
- h :=1
- v :=1
- ;this is center of screen in theory
- global v1:=-heihei/2
- global h1:=widwid/2
- global feed
- ;bottom left
- global h0:=-15000
- global v0:=15000
- global hshv:=shwshw/2
- global calibr:=10
- global h00:=15000
- global v00:=-15000
- ;
- ;there is no absolute for submarine titans for mouse control, only relative
- ;credit to evilC (wolf II too) for the functional version
- pwin:
- PrimaryWindow()
- PrimaryWindow(){
- global
- Gui, GuiName:New
- Gui, Add, Text,, The on-screen buttons do nothing, they only reflect what is in the configuration file
- Gui, Add, Text,, Close program from bottom right corner in tray or press %cloclo%
- ;
- ;`n`n`nOriginal ;hotkeys work alongside those below (1=yes 0=no)
- ;Gui, Add, Button, x24 y94 w400 h30, %suprsupr%
- Gui, Add, Button, x264 y24 w40 h30, %cloclo%
- Gui, Add, Button, x10 y200 w400 h30, Resolution from configuration file is %widwid% X %heihei%
- Gui, Add, Button, x112 y240 w200 h30, Current base delay is %waiwai% miliseconds (1sec = 1000ms)
- Gui, Add, Button, x32 y280 w360 h50, "Return cursor mode" is %cencen% `n(0=none 1=battlefield center 2=monitor center)
- Gui, Add, Button, x20 y400 w70 h30, %www%
- Gui, Add, Button, x100 y400 w70 h30, %eee%
- Gui, Add, Button, x180 y400 w70 h30, %rrr%
- Gui, Add, Button, x260 y400 w70 h30, %ttt%
- Gui, Add, Button, x340 y400 w70 h30, %yyy%
- Gui, Add, Button, x60 y500 w70 h40, %sss% `n (< arrow)
- Gui, Add, Button, x30 y450 w70 h40, %ddd%
- Gui, Add, Button, x330 y450 w70 h40, %fff%
- Gui, Add, Button, x300 y500 w70 h40, %ggg% `n(> arrow)
- Gui, Add, Button, x100 y470 w30 h20,
- Gui, Add, Button, x150 y470 w30 h20,
- Gui, Add, Button, x200 y470 w30 h20,
- Gui, Add, Button, x250 y470 w30 h20,
- Gui, Add, Button, x300 y470 w30 h20,
- Gui, Add, Button, x190 y520 w50 h20,
- Gui, Add, Text,,
- Gui, Show,, ST CH (Building hotkey helper) - r/SubmarineTitans
- Sleep 1
- }
- ;here is where to dump the HOTKEYS
- hotkey, % cloclo, theezexit
- hotkey, % ggg, ggggg
- hotkey, % sss, sssss
- hotkey, % ddd, ddddd
- hotkey, % fff, fffff
- hotkey, % www, wwwww
- hotkey, % eee, eeeee
- hotkey, % rrr, rrrrr
- hotkey, % ttt, ttttt
- hotkey, % yyy, yyyyy
- ;HOTKEYS ABOVE HERE
- Menu, Tray, Tip , Submarine Titans Custom Hotkeys (Building hotkey helper) - r/SubmarineTitans subreddit
- return
- ;beyond that return things only execute on demand
- theezexit:
- {
- ExitApp
- }
- return
- Thefunc(cordx,cordy,ctct){
- ;top right corner to compensate
- DllCall("mouse_event",uint,1,int, h00 ,int, v00,uint,0,int,0)
- ;bot left corner
- Sleep %shwshw%
- DllCall("mouse_event",uint,1,int, h0 ,int, v0,uint,0,int,0)
- Sleep %shwshw%
- ;vertically no distorsion
- ;this is the vertical compensation so it doesnt scroll too much
- vvnd:=-calibr
- Sleep %hshv%
- ;line bellow ends up bottom center
- DllCall("mouse_event",uint,1,int, h1 ,int, vvnd,uint,0,int,0)
- icx:=-cordx
- icy:=-cordy+calibr
- Sleep %shwshw%
- DllCall("mouse_event",uint,1,int, icx ,int, icy,uint,0,int,0)
- Sleep %shwshw%
- Click, down
- Sleep %shwshw%
- Click, up
- }
- return
- ;this one does the actual return to center, the above one does not require it
- Thefuncoo(cordx,cordy,ctct){
- ;top right corner to compensate
- DllCall("mouse_event",uint,1,int, h00 ,int, v00,uint,0,int,0)
- ;bot left corner
- Sleep %shwshw%
- DllCall("mouse_event",uint,1,int, h0 ,int, v0,uint,0,int,0)
- Sleep %shwshw%
- ;vertically no distorsion
- ;this is the vertical compensation so it doesnt scroll too much
- vvnd:=-calibr
- Sleep %hshv%
- ;line bellow ends up bottom center
- DllCall("mouse_event",uint,1,int, h1 ,int, vvnd,uint,0,int,0)
- icx:=-cordx
- icy:=-cordy+calibr
- Sleep %shwshw%
- DllCall("mouse_event",uint,1,int, icx ,int, icy,uint,0,int,0)
- Sleep %shwshw%
- Click, down
- Sleep %shwshw%
- Click, up
- Sleep %shwshw%
- if ctct=1
- {
- battleup:=-icx
- battlecenter:=-78-icy+v1
- DllCall("mouse_event",uint,1,int, battleup ,int, battlecenter,uint,0,int,0)
- Sleep %shwshw%
- return
- }
- ;i mixed up up and center oh well at least it works
- if ctct=2
- {
- upup:=-icx
- centerrr:=-icy+v1
- DllCall("mouse_event",uint,1,int, upup ,int, centerrr,uint,0,int,0)
- Sleep %shwshw%
- return
- }
- }
- return
- replhot(key) {
- Return, "{" key "}"
- }
- return
- ;testing for now
- ggggg:
- {
- Thefunc(196,45,cencen)
- }
- return
- sssss:
- {
- Thefunc(282,45,cencen)
- }
- return
- ddddd:
- {
- catc:=catc-1
- if catc=0
- catc:=5
- if catc=1
- Thefunc(313,70,cencen)
- if catc=2
- Thefunc(268,70,cencen)
- if catc=3
- Thefunc(226,70,cencen)
- if catc=4
- Thefunc(181,70,cencen)
- if catc=5
- Thefunc(162,70,cencen)
- }
- return
- fffff:
- {
- catc:=catc+1
- if catc=6
- catc:=1
- if catc=1
- Thefunc(313,70,cencen)
- if catc=2
- Thefunc(268,70,cencen)
- if catc=3
- Thefunc(226,70,cencen)
- if catc=4
- Thefunc(181,70,cencen)
- if catc=5
- Thefunc(162,70,cencen)
- }
- return
- wwwww:
- {
- Thefuncoo(320,105,cencen)
- }
- return
- eeeee:
- {
- Thefuncoo(270,105,cencen)
- }
- return
- rrrrr:
- {
- Thefuncoo(222,105,cencen)
- }
- return
- ttttt:
- {
- Thefuncoo(174,105,cencen)
- }
- return
- yyyyy:
- {
- Thefuncoo(125,105,cencen)
- }
- return
- ;hotkey, % ggg, ggggg, Off
- ;if suprsupr=1
- ;{
- ;curkey:=replhot(ggg)
- ;SendInput %curkey%
- ;Sleep %shwshw%
- ;}
- ;hotkey, % ggg, ggggg, On
- ;hotkey, % sss, sssss, Off
- ;curkey:=replhot(sss)
- ;if suprsupr=1
- ;{
- ;Sleep %shwshw%
- ;SendInput %curkey%
- ;}
- ;hotkey, % sss, sssss, On
- ;return
Add Comment
Please, Sign In to add comment