Jump to content

Detecting/Simulating mapped keys/key presses + Open Map, Save, Exit, etc. via script.


irswat

Recommended Posts

	while (FindCommandCounter<=7)
		currentCMD=CommandList[FindCommandCounter]
		CMDFoundi=SVE_DumpArray.Find(currentCMD)
		
		if (CMDFoundi>=0)
			CurrentCMD=SVE_DumpArray[CMDFoundi]
			debug.notification("Command found: " + SVE_DumpArray[CMDFoundi] + " in index " + CMDFoundi)
			FindCommandCounter+=1
		else
			FindCommandCounter+=1
		endif
		
		if CurrentCMD=="Thuum"
			;Thuum formlist
		elseif CurrentCMD=="Equip"
			;armor/weapon formlist
		elseif CurrentCMD=="Unequip"
		elseif CurrentCMD=="Use"
			;potion formlist
		elseif CurrentCMD=="Cast"
			;spell formlist
		elseif CurrentCMD=="Map"
			int MapKey = Input.GetMappedKey("Quick Map",0x00)
			Input.HoldKey(MapKey)
		elseif CurrentCMD=="Save"
			int SaveKey = Input.GetMappedKey("Quicksave",0x00)
			Input.TapKey(SaveKey)
			debug.notification("save")
		elseif CurrentCMD=="Exit"
			;int ExitKey = Input.GetMappedKey("Exit",0x00)
			;Input.TapKey(ExitKey)
		endif
		
	endWhile

script reads a text file into a string array, then searches string array for one of the 7 commands found above. The text file contains 3 commands currently, map, save, and exit.

 

Map is detected, but does not open the map. I'm not sure why. I also tried holdkey. Nothing.

 

Save is detected and quicksaves, so this works as intended.

 

Is there a command I can issue via papyrus to exit the game?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...