Guest Posted March 30, 2021 Share Posted March 30, 2021 Hello, as the title says, I can't find a way to make AHK scripts working with an emu booted with admin rights. Any tips? I need this because with some TeknoParrot games I need admin rights for online ( ID0 and Mario Kart ). Thanks Quote Link to comment Share on other sites More sharing options...
Your Friendly A.I Overlord Posted March 30, 2021 Share Posted March 30, 2021 (edited) 1 hour ago, nohero said: Any tips? Yes. This is because the script also needs Admin Rights to close a program with Admin Rights. Which, when executed from LaunchBox, it doesn't have. The solution is to create a script or batch file with Admin Rights that closes TeknoParrot. For example: $Esc:: { Run, D:\Close_TeknoParrot.exe } But it also depends on the script you are using. A lot of TeknoParrot games close with just an Escape key press. In that case, if the script sends an "Esc", no problem. But if your script uses something like "WinClose" or "Process, Close", that will probably not work. *Edit* To give you an example. I also run Mario Kart from an elevated TeknoParrot. But the script I use works for me without being elevated itself. $ESC:: { WinClose, ahk_exe MKDX-Unlocked-Profile-v1.0.exe Send {ESC} Sleep 200 Send {ESC} } Edited March 30, 2021 by Koroth Quote Link to comment Share on other sites More sharing options...
Guest Posted March 30, 2021 Share Posted March 30, 2021 (edited) Thanks for replying but the problem I have is not closing the game or closing the Harm's tool. I want to map F2 ( Banapassport key ) to my controller right thumb stick and if TP is booted with admin rights the ahk script it doesn't work. I use this script : Joy10:: If GetKeyState("Joy10") { SetKeyDelay, -1, 110 Send {F2} } Return It works good without admin rights. By the way, I tried your script for the Harm's tool and it doesn't work here booting TP with admin rights, the game closes but the tools stay open. Edited March 30, 2021 by nohero Quote Link to comment Share on other sites More sharing options...
Your Friendly A.I Overlord Posted March 30, 2021 Share Posted March 30, 2021 2 hours ago, nohero said: Thanks for replying but the problem I have is not closing the game or closing the Harm's tool. Sorry, I misunderstood. I thought you where having problems closing TeknoParrot when running with Admin Rights. 2 hours ago, nohero said: I use this script : Joy10:: If GetKeyState("Joy10") { SetKeyDelay, -1, 110 Send {F2} } Return It works good without admin rights. I never have much luck mapping buttons with AutoHotKey. I rather use a dedicated keymapper program for that. Like JoyToKey. 2 hours ago, nohero said: By the way, I tried your script for the Harm's tool and it doesn't work here booting TP with admin rights, the game closes but the tools stay open. It is meant to close Mario Kart DX and the MKDX Unlocked Profile program. I don't know what Harm's tool is. Quote Link to comment Share on other sites More sharing options...
Guest Posted March 30, 2021 Share Posted March 30, 2021 (edited) Harm is the nick of the guy who made that unlocker tool. Here that script doesn't close the unlocker tool if TP Is booted with admin rights. Edited March 30, 2021 by nohero Quote Link to comment Share on other sites More sharing options...
Your Friendly A.I Overlord Posted March 30, 2021 Share Posted March 30, 2021 (edited) 18 minutes ago, nohero said: Here that script doesn't close the unlocker tool if TP Is booted with.admin rights. You need the name of the executable of the program. Mine is named: MKDX-Unlocked-Profile-v1.0.exe. If yours is named differently, just replace with the name of your executable. TeknoParrot may run with Admin Rights, but I am guessing the unlocker tool does not. So it shouldn't be a problem to close. Edited March 30, 2021 by Koroth Quote Link to comment Share on other sites More sharing options...
Guest Posted March 30, 2021 Share Posted March 30, 2021 Mine is named the same, MKDX-Unlocked-Profile-v1.0.exe. However it's not a problem since I'm using a BAT file for closing the unlocker tool, I tried your script just for curiosity but here doesn't work. I ended up doing another trick so the game doesn't ask for admin rights and I can boot TP without and playing vs LAN with no problem. CHEERs Quote Link to comment Share on other sites More sharing options...
Kiinkyfoxx Posted March 30, 2021 Share Posted March 30, 2021 This might be a little bit late now, but if you are putting the ahk in the Running AutoHotkey tab or the Exit Tab on the edit emulator page then by adding the following to the top and your require script underneath it will elevate the internal AHK to admin. full_command_line := DllCall("GetCommandLine", "str") if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)")) { try { if A_IsCompiled Run *RunAs "%A_ScriptFullPath%" /restart else Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%" } ExitApp } So for the above example it would be full_command_line := DllCall("GetCommandLine", "str") if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)")) { try { if A_IsCompiled Run *RunAs "%A_ScriptFullPath%" /restart else Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%" } ExitApp } $ESC:: { WinClose, ahk_exe MKDX-Unlocked-Profile-v1.0.exe Send {ESC} Sleep 200 Send {ESC} } Cheers 1 Quote Link to comment Share on other sites More sharing options...
Your Friendly A.I Overlord Posted March 30, 2021 Share Posted March 30, 2021 @Kiinkyfoxx Thank you dear sir! This comes in very handy. Never knew this. Quote Link to comment Share on other sites More sharing options...
Guest Posted March 30, 2021 Share Posted March 30, 2021 @Kiinkyfoxx your script did the trick ? Thank you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.