Adventure Goto tool (SubscriptAdventure version by Trubbleguy)

Open source general-purpose IDE, lightweight text editor. Previously known as AutoGUI.
User avatar
Trubbleguy
Posts: 18
Joined: 11 Jul 2014, 03:00

Adventure Goto tool (SubscriptAdventure version by Trubbleguy)

10 May 2022, 22:19

*UPDATED* 22 May 2022
Change:
1. Removed Return where there shouldn't have been one, Displays correctly now

*UPDATED* 17 May 2022
Changes:
1.fixed a bug with onchange recognising this board due to its name and sending CTRL+S. (Now looks for "Adventure v3")
2.Brought SubcriptAdventure to top if Adventure was Visible/Active .
3.When Adventure closes, so does this app.

I have trimmed out my Subscript Utility to work nicely with Adventure, if i had the time i would code it into Adventure itself, but works fine as standalone.
No limit to tags used, and can also add a ";@@@@@@@@@@" Line across your code to break it up into sections, List all subroutines or Tags.
Simply click to jump there, no more scrolling, works with multiple ahk's loaded nicely. Various Loop variables hotkeyed as well like A_Index, %A_Space% etc.

Code: Select all


;This Version works with Adventure Autohotkey Editor
; Includes Anchor.ahk by Titan

;use ";tag" as the key to jumping to a sub ALT+T will insert one wherever you need it 
;whatever is on the next line after ;tag is displayed in the subscript window 
;you can now switch between tag or subs by a mouseclick

; language:       english 
; platform:       win9x/nt 
; author:         Trubbleguy <[email protected]> 
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 

#SingleInstance force
#WinActivateForce
#Persistent
#NoEnv

;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 

shortcuts= ; shortcuts for ALT+L
(
A_Space
A_Index
A_LoopField
A_Tab
A_LoopFileFullPath
Msgbox,0,H,M,t
:= SubStr(String `, StartPos `, Length)
clear("")
notify( , ,5)
)

;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 

Main:
fontsize=8
fontname=Arial Narrow ;set this to your preferences
AutoTrim, Off
Normal:=A_BatchLines
OnExit, quit
SendMode Input

programname = subscript for Adventure ; debug: to do
programversion = v4.001b ; debug: to do
programfullname = %programname% %programversion%
programauthor = trubbleguy ; debug: to do
inifilename=
Guinum=1
Gosub getwinparams
SetTimer, onchange,500
SetTitleMatchMode,1
_ini=%a_scriptdir%\SubscriptAdventure.ini
ifwinexist,Adventure v3
{
WinGetPos,xx1,yy1,ww1,hh1,Adventure v3
xx1:=xx1-170		;get Cedt x and subtract 170
hh1:=hh1-23			;get Cedt H and sub 23 to level up height on gui's
}
else
{
iniread,xx1,%_ini%,size,xx1,%A_Space%	;try read the last locations from ini
iniread,yy1,%_ini%,size,yy1,%A_Space%
iniread,ww1,%_ini%,size,ww1,%A_Space%
iniread,hh1,%_ini%,size,hh1,%A_Space%
}
StringCaseSense,off
SysGet, mwa, monitorworkarea,
_y := A_ScreenHeight-_winheightwaste
_l := (_y-_winheightwaste)/_rowheight
Gosub traymenu
_w=160
_w1:=(_w-5)
Gui, Margin,2,2
Gui +LastFound +ToolWindow +Border +Resize
Gui, font, s%fontsize% W150, %fontname%
if not xx1
 Gui, add,ListView,vlist1 hwndtip1_hWnd BackgRoundFFFFF9 -Hdr grid x0 y0 w160 h%hh1% gOK AltSubmit ,Subs
else
Gui, add,ListView,vlist1 hwndtip1_hWnd BackgRoundFFFFF9 -Hdr grid x0 y0 w160 h%hh1% gOK AltSubmit ,Subs
tip= ;Shortcut hotkeys while programming
(
Ctrl+Alt+esc = exitapp
Alt+S = Toggle Subs/Tags

Alt+Shift+Space = `%A_Space`%

Alt+Shift+L = `%A_LoopField`%
Ctrl+Shift+L =  A_LoopField

Alt+Shift+I = `%A_Index`%
Ctrl+Shift+I =  A_Index

Alt+Shift+Tab = `%A_Tab`%
Ctrl+Shift+Tab =  A_Tab

Alt+Shift+MINUS = %A_Space%" - "%A_Space%
)

ToolTip(1,tip,"","A" . tip1_hWnd . " P " . GuiHwnd)
Gui, 22:add,ListView,vlist2 BackgRoundFFFFF9 -Hdr grid w160 h300 w300 AltSubmit ,Picklist|Name
Gui, 22:Add,Button, w0 h0 x0 y0 gOK2 Hidden Default, OK

DllCall("QueryPerformanceFrequency", "Int64P", freq)
Gui, show,x%xx1% y%yy1% w176 h%hh1% AutoSize,Goto Sub:

ifwinexist,Adventure v3
    {
    WinGetActiveTitle,_title
    Gosub getprog1
    WinActivate,%_title%
    }


;StartSub About ##################################################
ifnotexist,%a_scriptdir%\SubscriptAdventure.ahk
{
about:
	MsgBox, 64, %programfullname%,
		( ltrim
			%programfullname%
			%a_space%by %programauthor%

			Jump to Subs Utility

			http://trubbleguy.com

			use [ctrl]+[alt]+[esc] to terminate the program.
		),8
}
WinActivate,Adventure v3
Return

;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 

;StartSub Getprog ##################################################
;tag
getprog:
	winactivate newtitle
	_oldtitle:=_title
	WinGetActiveTitle,_title
getprog1:
	hit=
		If _title not Contains Adventure v3
		{
		_title:=_oldtitle
			Return
		}
Winset,AlwaysonTop,,Goto Sub:
Winset,AlwaysonTop,,Goto Sub:

If _title Contains Adventure v3
{
Filename := SubStr(_title, 20)
Filename:=Filename
WinActivate, %_title%
Send ^s
sleep 300
}
read:
ifnotexist,%Filename% 
Return
FileRead, filevar, %Filename%
read1:
	t=0
	LV_Delete()
	Loop , Parse, filevar ,`n,`r
		{
		hunt=
		If not A_LoopField
			Continue
			if not t
			{
			StringLeft,hunt,A_LoopField ,4
			If hunt Contains`;tag
				{
					t=1
					Continue
				}
			}
			StringUpper,namee,A_LoopField
			If t  ;show tags
				{
					LV_Add(" ",namee)
					hit++
					t=
					Continue
				}
				
			if allsubs
				if A_LoopField contains::
					Continue
					
			if allsubs
				{
				StringRight,hunt,A_LoopField ,1
				if hunt=:
				goto yup
				}
        yup:
			if allsubs
			If hunt =:
			{
			hit++	
			If A_LoopField Contains%A_Space%,`;,`,
			continue
;			StringReplace,namee,namee,`;,,
			StringReplace,namee,namee,%A_Tab%,,all
			LV_Add(" ",namee)
			Continue
			}
			
		}
		
	if not hit
	{
	allsubs=
	hit=1
	goto read
	}

	LV_ModifyCol(1,"Sort")
	LV_Add(" ","####################")
	LV_Add(" ","ALT+T  Tag")
if not allsubs
		LV_Add(" ","Show All Subs (!^s)")
		else
		LV_Add(" ","Show Tags only (!^s)")
	LV_Add(" ","Reload TAGS")
	LV_Add(" ","####################")
	WinActivate, %_title%
;	Clipboard =
;	Clipboard := clipbak
Return

;Getwinparams
;StartSub Getwinparams ##################################################
;tag
getwinparams:
detecthiddenwindows,on
	Gui, 16:+LastFound +ToolWindow +Border +Resize
	Gui, 16:font, s%fontsize%, Lucida Console
	Gui, 16:Add, ListView,r1,16
	Gui, 16:Add, Button, w1 h1 Hidden Default, OK
	Gui,16:show,hide,one
	Sleep 100
	WinGetPos,GX,GY,GW,GH,one
	Gui, 17:+LastFound +ToolWindow +Border +Resize
	Gui, 17:font, s%fontsize%, Lucida Console
	Gui, 17:Add, ListView,r2,17
	Gui, 17:Add, Button, w1 h1 Hidden Default, OK
	Gui,17:show,hide,two
	Sleep 100
	WinGetPos,GX,GY,GW,2GH,two
	_rowheight:=(2GH-GH)
	_winheightwaste:=(GH-_rowheight)
	Gui,16:Destroy
	Gui,17:Destroy
Return


;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
GuiClose:
ExitApp
Return

;StartSub Hotkeys ##################################################
hotkeys:
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
!^l::
	send {home}{home}+{tab}
	oldclip=:clipboard
	clipboard= `;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ `n
	sendinput,^v
	sleep 333
	Gosub getprog1
Return
;########################################################################################## 
;tag
Alttag:
	oldclip=:clipboard
	send {home}{home}+{tab}
	clipboard= `;########################################################################################## `n`;tag`n
	sendinput,^v
	sleep 333
	Gosub getprog1
Return

;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
!t::gosub alttag ;Alt+t puts the line directly above the ;Tag and refreshes subscript to add the subroutine its in front off
!f12::gosub getprog
!^esc::exitapp
;Various handy hotkeys for coding loops
!+Space::Send `%A_Space`%
!+l::Send `%A_LoopField`%
!+i::Send `%A_Index`%
!+Tab::Send `%A_Tab`%
^+l::Send A_LoopField
^+i::Send A_Index
^+Tab::Send A_Tab
!l::gosub go2 ; ALT+L hotkeys with %var%
^l::gosub go3 ; CTRL+L hotkeys with var
::Msgbox::MsgBox, 0,,,5^{Left}^{Left}{Left}
Return

#ifwinactive Select
esc::
Gui, 22:Submit
Gui, 1:+Disabled
Return
#ifwinactive 

;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
go2: ;Gui for ALT+L
Gui, 1:+Disabled
Gui, 22:+OwnDialogs
gui, 22:Show,,Select
Gui, 22:default
controlfocus,Syslistview321
LV_Delete()
LV_Add("",A_Index,"Cancel")
loop,parse,shortcuts,`n
If A_LoopField not contains msgbox
If A_LoopField contains A_
LV_Add("",A_Index,"`%" A_LoopField "`%")
else
LV_Add("",A_Index,A_LoopField)
Lv_ModifyCol()
controlfocus,Syslistview321,Select
Lv_Modify(1,"focus select")

return

;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
go3: ;GUI for CTRL+L

Gui, 1:+Disabled
Gui, 22:+OwnDialogs
gui, 22:Show,,Select
Gui, 22:default
LV_Delete()
LV_Add("",A_Index,"Cancel")
loop,parse,shortcuts,`n
LV_Add("",A_Index,A_LoopField)

Lv_ModifyCol()
controlfocus,Syslistview321,Select
Lv_Modify(1,"focus select")
return


;########################################################################################## 
;tag
OK:
	If A_GuiEvent=Normal
		{
			ControlFocus , SysListView321, Goto Sub:
			LV_GetText(rowtext,A_EventInfo)
			If rowtext=####################
			Return
			If rowtext contains Show All Subs (!^s),Show Tags Only (!^s)
				{
				!^s::	
					if allsubs
						allsubs=
						else
						allsubs=1
					WinActivate, %_title%
					Gosub getprog1
					Return
				}
			If rowtext=Reload TAGS
				{
					WinActivate, %_title%
					Gosub getprog1
					Return
				}
			If rowtext=ALT+T  Tag
				{
					WinActivate,%_title%
					send {home}{home}+{tab}
					sendRaw ``n;tag`n
					Return
				}
			WinActivate,%_title%
			SendInput ^f
			Sleep 100
			SendInput {Raw}%rowtext%
			Sleep 100
			SendInput {Enter}
			Sleep 100
			Winclose,Find
			Send {home}{home}+{tab}{down}{up}
			Send {Shift up}{Ctrl Up}{Alt Up}{Click up} ;ensure all keys back to neutral standing after job
			WinActivate,%_title%
		}
	;Listvars
Return

;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
;tag
OK2:

	If A_GuiEvent=Normal
		{
			ControlFocus , SysListView321,Select
			FocusedRowNumber := LV_GetNext(0, "F")  ; Find the Focused row.
			LV_GetText(rowtext,FocusedRowNumber,2)
;			msgbox % rowtext
			Gui, 22:Submit
			Gui, 1:-Disabled
			if rowtext not containscancel,msgbox
				{
				WinActivate, %_title%
				send % rowtext
				}
			if rowtext contains msgbox
				InputBox,lletter,Msgbox loop,Type the variable to display in messagebox1nEg.epc translates to epc1`, epc2 etc.....,,,,,,,,p
				if lletter
					{
					WinActivate, %_title%
					send {home}{home}+{tab}msgbox,
					{
					loop 10
					send %lletter%%A_Index%= `%%lletter%%A_Index%`%``n
					}
				send `n
				}
			Return
		}
 
Return
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
;tag    ;Detects window focus change if working on multiple AHK files
onchange: 
IfWinNotExist,Adventure v3
ExitApp
	wingetActiveTitle,whatwindow
	WinGetPos,xx1,yy1,ww1,hh1,%whatwindow%
 	if xx1<>%oldxx1%
	{
		oldxx1:=xx1
		oldyy1:=yy1
		oldww1:=ww1
		oldhh1:=hh1
		xx1:=xx1-170
		winmove, Goto Sub:,,xx1,yy1,170,hh1
	}
	if yy1<>%oldyy1%
	{
		oldxx1:=xx1
		oldyy1:=yy1
		oldww1:=ww1
		oldhh1:=hh1
		xx1:=xx1-170
		winmove, Goto Sub:,,xx1,yy1,170,hh1
	}
	if ww1<>%oldww1%
	{
		oldxx1:=xx1
		oldyy1:=yy1
		oldww1:=ww1
		oldhh1:=hh1
		xx1:=xx1-170
		winmove, Goto Sub:,,xx1,yy1,170,hh1
	}
	if hh1<>%oldhh1%
	{
		oldxx1:=xx1
		oldyy1:=yy1
		oldww1:=ww1
		oldhh1:=hh1
		xx1:=xx1-170
		winmove, Goto Sub:,,xx1,yy1,170,hh1

	}
	If GetKeyState("CapsLock","T")   ; checks for Capslock key down
			SoundBeep, 40,100
    WinGetActiveTitle, newtitle1
	If newtitle1 ContainsGoto Sub:
		Return
	
	WinGetActiveTitle, newtitle
	
	If newtitle not Contains Adventure v3,.ahk
			Return
Winset,AlwaysonTop,,Goto Sub:
Winset,AlwaysonTop,,Goto Sub:
			
	If newtitle = %_title%
	{
		_title:=newtitle
		Return
	}
 	If newtitle != %_title%
			Gosub getprog
Return

;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
;tag
quit:
winactivate,Goto Sub:
WinGetPos,xx1,yy1,ww1,hh1,Goto Sub:
iniwrite,%xx1%,%_ini%,size,xx1
iniwrite,%yy1%,%_ini%,size,yy1
iniwrite,%ww1%,%_ini%,size,ww1
iniwrite,%hh1%,%_ini%,size,hh1
ExitApp
Return
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
setup:
	MsgBox setup routine here (FUTURE EDITION)
Return

;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
;tag
traymenu:
	; set tray tip
	Menu, tray, tip, %programfullname%
	; disable standard menu items
	Menu, tray, add, &about, about
	; separator
	Menu, tray, add
	; show setup message
	Menu, tray, add, &setup, setup
	; separator
	Menu, tray, add
	; terminate script
	Menu, tray, add, &quit, quit
Return
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
GuiSize:
	DllCall("QueryPerformanceCounter", "Int64P", t0)
	Anchor("f1", "")
	GuiWidth := A_GuiWidth
	DllCall("QueryPerformanceCounter", "Int64P", t1)
	Anchor("list1","w h")
Return
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
/*
;########################################################################################## 
;tag
;Anchor
	Function: Anchor
		Defines how controls should be automatically positioned relative to the new dimensions of a window when resized.

	Parameters:
		cl - a control HWND, associated variable name or ClassNN to operate on
		a - (optional) one or more of the anchors: 'x', 'y', 'w' (width) and 'h' (height),
			optionally followed by a relative factor, e.g. "x h0.5"
		r - (optional) true to redraw controls, recommended for GroupBox and Button types
*/
Anchor(i, a = "", r = false) {
	static c, cs = 12, cx = 255, cl = 0, g, gs = 8, gl = 0, gpi, gw, gh, z = 0, k = 0xffff
	If z = 0
		VarSetCapacity(g, gs * 99, 0), VarSetCapacity(c, cs * cx, 0), z := true
	If (!WinExist("ahk_id" . i)) {
		GuiControlGet, t, Hwnd, %i%
		If ErrorLevel = 0
			i := t
		Else ControlGet, i, Hwnd, , %i%
	}
	VarSetCapacity(gi, 68, 0), DllCall("GetWindowInfo", "UInt", gp := DllCall("GetParent", "UInt", i), "UInt", &gi)	, giw := NumGet(gi, 28, "Int") - NumGet(gi, 20, "Int"), gih := NumGet(gi, 32, "Int") - NumGet(gi, 24, "Int")
	If (gp != gpi) {
		gpi := gp
		Loop, %gl%
			If (NumGet(g, cb := gs * (A_Index - 1)) == gp) {
				gw := NumGet(g, cb + 4, "Short"), gh := NumGet(g, cb + 6, "Short"), gf := 1
				Break
			}
		If (!gf)
			NumPut(gp, g, gl), NumPut(gw := giw, g, gl + 4, "Short"), NumPut(gh := gih, g, gl + 6, "Short"), gl += gs
	}
	ControlGetPos, dx, dy, dw, dh, , ahk_id %i%
	Loop, %cl%
		If (NumGet(c, cb := cs * (A_Index - 1)) == i) {
			If a =
			{
				cf = 1
				Break
			}
			giw -= gw, gih -= gh, as := 1, dx := NumGet(c, cb + 4, "Short"), dy := NumGet(c, cb + 6, "Short"), cw := dw, dw := NumGet(c, cb + 8, "Short"), ch := dh, dh := NumGet(c, cb + 10, "Short")
			Loop, Parse, a, xywh
				If A_Index > 1
					av := SubStr(a, as, 1), as += 1 + StrLen(A_LoopField), d%av% += (InStr("yh", av) ? gih : giw) * (A_LoopField + 0 ? A_LoopField : 1)
			DllCall("SetWindowPos", "UInt", i, "Int", 0, "Int", dx, "Int", dy , "Int", InStr(a, "w") ? dw : cw, "Int", InStr(a, "h") ? dh : ch, "Int", 4)
			If r != 0
				DllCall("RedrawWindow", "UInt", i, "UInt", 0, "UInt", 0, "UInt", 0x0101) ; RDW_UPDATENOW | RDW_INVALIDATE
			Return
		}
	If cf != 1
		cb := cl, cl += cs
	bx := NumGet(gi, 48), by := NumGet(gi, 16, "Int") - NumGet(gi, 8, "Int") - gih - NumGet(gi, 52)
	If cf = 1
		dw -= giw - gw, dh -= gih - gh
	NumPut(i, c, cb), NumPut(dx - bx, c, cb + 4, "Short"), NumPut(dy - by, c, cb + 6, "Short"), NumPut(dw, c, cb + 8, "Short"), NumPut(dh, c, cb + 10, "Short")
	Return, true
}
*/
/*
Examples:
> "xy" ; bounds a control to the bottom-left edge of the window
> "w0.5" ; any change in the width of the window will resize the width of the control on a 2:1 ratio
> "h" ; similar to above but directrly proportional to height

	Remarks:
		To assume the current window size for the new bounds of a control (i.e. resetting) simply omit the second and third parameters.
		However if the control had been created with DllCall() and has its own parent window,
			the container AutoHotkey created GUI must be made default with the +LastFound option prior to the call.
		For a complete example see anchor-example.ahk.

	License:
		- Version 4.60a <http://www.autohotkey.net/~Titan/#anchor>
		- Simplified BSD License <http://www.autohotkey.net/~Titan/license.txt>

Anchor(i, a = "", r = false) {
	static c, cs = 12, cx = 255, cl = 0, g, gs = 8, gl = 0, gpi, gw, gh, z = 0, k = 0xffff
	If z = 0
		VarSetCapacity(g, gs * 99, 0), VarSetCapacity(c, cs * cx, 0), z := true
	If (!WinExist("ahk_id" . i)) {
		GuiControlGet, t, Hwnd, %i%
		If ErrorLevel = 0
			i := t
		Else ControlGet, i, Hwnd, , %i%
	}
	VarSetCapacity(gi, 68, 0), DllCall("GetWindowInfo", "UInt", gp := DllCall("GetParent", "UInt", i), "UInt", &gi)
		, giw := NumGet(gi, 28, "Int") - NumGet(gi, 20, "Int"), gih := NumGet(gi, 32, "Int") - NumGet(gi, 24, "Int")
	If (gp != gpi) {
		gpi := gp
		Loop, %gl%
			If (NumGet(g, cb := gs * (A_Index - 1)) == gp) {
				gw := NumGet(g, cb + 4, "Short"), gh := NumGet(g, cb + 6, "Short"), gf := 1
				Break
			}
		If (!gf)
			NumPut(gp, g, gl), NumPut(gw := giw, g, gl + 4, "Short"), NumPut(gh := gih, g, gl + 6, "Short"), gl += gs
	}
	ControlGetPos, dx, dy, dw, dh, , ahk_id %i%
	Loop, %cl%
		If (NumGet(c, cb := cs * (A_Index - 1)) == i) {
			If a =
			{
				cf = 1
				Break
			}
			giw -= gw, gih -= gh, as := 1, dx := NumGet(c, cb + 4, "Short"), dy := NumGet(c, cb + 6, "Short")
				, cw := dw, dw := NumGet(c, cb + 8, "Short"), ch := dh, dh := NumGet(c, cb + 10, "Short")
			Loop, Parse, a, xywh
				If A_Index > 1
					av := SubStr(a, as, 1), as += 1 + StrLen(A_LoopField)
						, d%av% += (InStr("yh", av) ? gih : giw) * (A_LoopField + 0 ? A_LoopField : 1)
			DllCall("SetWindowPos", "UInt", i, "Int", 0, "Int", dx, "Int", dy
				, "Int", InStr(a, "w") ? dw : cw, "Int", InStr(a, "h") ? dh : ch, "Int", 4)
			If r != 0
				DllCall("RedrawWindow", "UInt", i, "UInt", 0, "UInt", 0, "UInt", 0x0101) ; RDW_UPDATENOW | RDW_INVALIDATE
			Return
		}
	If cf != 1
		cb := cl, cl += cs
	bx := NumGet(gi, 48), by := NumGet(gi, 16, "Int") - NumGet(gi, 8, "Int") - gih - NumGet(gi, 52)
	If cf = 1
		dw -= giw - gw, dh -= gih - gh
	NumPut(i, c, cb), NumPut(dx - bx, c, cb + 4, "Short"), NumPut(dy - by, c, cb + 6, "Short")
		, NumPut(dw, c, cb + 8, "Short"), NumPut(dh, c, cb + 10, "Short")
	Return, true
}

Feel free to Modify it to meet your own requirements, my coding requires multiple ahk modules.
lots of modules that i can call from anything i am coding makes it a lot easier.
When i have 12 modules open, this makes it a breeze.
SubscriptAdventure.png
SubscriptAdventure.png (191.63 KiB) Viewed 2357 times
Last edited by Trubbleguy on 21 May 2022, 22:50, edited 2 times in total.
User avatar
Trubbleguy
Posts: 18
Joined: 11 Jul 2014, 03:00

Re: Adventure Goto tool (SubscriptAdventure version by Trubbleguy)

14 May 2022, 23:57

Has anybody tried it yet?, Comments welcome
User avatar
Trubbleguy
Posts: 18
Joined: 11 Jul 2014, 03:00

Re: Adventure Goto tool (SubscriptAdventure version by Trubbleguy)

06 Jun 2022, 03:13

Constructive Criticism Anyone?????
gotti0505
Posts: 1
Joined: 14 Jun 2022, 22:44

Re: Adventure Goto tool (SubscriptAdventure version by Trubbleguy)

14 Jun 2022, 23:00

How should I use it? There is an error in execution

Return to “Adventure IDE”

Who is online

Users browsing this forum: No registered users and 37 guests