Page 1 of 1

Less Clicking Is It Possible?

Posted: Sun Feb 28, 2016 12:00 am
by *Trix
Upon logging in there are a few things I usually do.

1. Select walking
2. Change to strategy mode
3. Start PC-tools
4. Change closeness
5. Click on the player chat

Can all of this be changed in the INI-file or some other way?


Less Clicking Is It Possible?

Posted: Wed Mar 02, 2016 12:00 am
by *Bogus
Ini? I don't think so.

You might want to look up AHK. It could be configured to do all that upon say, a single keypress. Maybe even without one.

Less Clicking Is It Possible?

Posted: Wed Mar 02, 2016 12:00 am
by *Trix
How? :confused:

Please do tell and show. I have not been editing any AHK files.

Less Clicking Is It Possible?

Posted: Thu Mar 03, 2016 12:00 am
by *Bogus
Rough and dirty version (even though it's fairly big). It should work (works for me anyway :)).

Ironically, I used ini files to keep the positions of buttons. I assumed that "start walking" meant using the search mode.

You want to 'learn' the position of buttons first, then 'apply'. Tested in windowed mode only, if switching to fullscreen takes too long, you should adjust Sleep accordingly.

You can edit the ini file to adjust the macro.

Code: Select all

Initialize()  MainLoop: SetTimer, MsgChange, 10 MsgBox, 3, nwn2ahk macro, Apply the macro, Learn the positions, Exit the script IfMsgBox, Yes { 	DoAll() } IfMsgBox, No { 	AskAll() 	Gosub, Mainloop } return  MsgChange: IfWinNotExist, nwn2ahk macro 	return SetTimer, MsgChange, off ControlSetText Button1, &Apply ControlSetText Button2, &Learn ControlSetText Button3, &Exit return  Initialize(inifilename := "nwn2ahk.ini") { 	IniRead, actionno, %inifilename%, config, actionno, 0 	If %actionno% = 0   CreateIni() }    DoAll(inifilename := "nwn2ahk.ini") { 	IniRead, exename, %inifilename%, config, exename 	WinActivate ahk_exe %exename% 	Sleep 100 	IniRead, actionno, %inifilename%, config, actionno, 0 	no := 0 	Loop %actionno% 	{   no := no + 1   IniRead, type, %inifilename%, %no%, type   If type = askmove   	DoMove(inifilename, no)   If type = lclick   	DoLclick(inifilename, no)   If type = rhold   	DoRhold(inifilename, no)   If type = key   	DoKey(inifilename, no) 	} }  DoMove(inifilename, no) { 	IniRead, data1, %inifilename%, %no%, data1 	IniRead, data2, %inifilename%, %no%, data2 	MouseMove, %data1%, %data2% } DoLclick(inifilename, no) { 	Click } DoRhold(inifilename, no) { 	IniRead, data1, %inifilename%, %no%, data1 	Click down right 	Sleep %data1% 	Click up right } DoKey(inifilename, no) {	 	IniRead, data1, %inifilename%, %no%, data1 	 	Send {%data1%} }  AskAll(inifilename := "nwn2ahk.ini") { 	IniRead, actionno, %inifilename%, config, actionno, 0 	no := 0 	Loop %actionno% 	{   no := no + 1   IniRead, type, %inifilename%, %no%, type   If type = askmove   	AskMove(inifilename, no) 	} }  AskMove(inifilename, no) { 	IniRead, info, %inifilename%, %no%, info 	MsgBox % "Action (" no ") - Click ok then point the cursor to the > " info " < and click again." 	IniRead exename, %inifilename%, config, exename 	WinActivate ahk_exe %exename% 	KeyWait LButton, D 	MouseGetPos data1, data2 	IniWrite, %data1%, %inifilename%, %no%, data1 	IniWrite, %data2%, %inifilename%, %no%, data2 }  CreateIni(inifilename := "nwn2ahk.ini") {     IniWrite, 10, %inifilename%, config, actionno 	IniWrite, F12, %inifilename%, config, keypress 	IniWrite, +F12, %inifilename%, config, keylearn 	IniWrite, nwn2main.exe, %inifilename%, config, exename 	CreateAction(inifilename, 1, "askmove", 0, 0, "search button position") 	CreateAction(inifilename, 2, "lclick") 	CreateAction(inifilename, 3, "askmove", 0, 0, "pc position") 	CreateAction(inifilename, 4, "rhold", 200) 	CreateAction(inifilename, 5, "askmove", 0, 0, "pc tools button position") 	CreateAction(inifilename, 6, "lclick") 	CreateAction(inifilename, 7, "askmove", 0, 0, "strategy mode button position") 	CreateAction(inifilename, 8, "lclick") 	CreateAction(inifilename, 9, "key", "End") 	CreateAction(inifilename, 10, "askmove", 0, 0, "player chat position") }  CreateAction(inifilename, no, type, data1 := "", data2 := "", info := "") { 	IniWrite, %type%, %inifilename%, %no%, type 	IniWrite, %data1%, %inifilename%, %no%, data1 	IniWrite, %data2%, %inifilename%, %no%, data2 	IniWrite, %info%, %inifilename%, %no%, info }
edit: tabs were eaten... still are & added strategy mode selection & thrice I edit and done