Jump to content

Help with hotkey to use soul gem


FESilencer

Recommended Posts

Hi, I've been trying to figure out a way to equip/use Azura's Star with a hotkey.

I have done a similar script with the repair hammer that works, but this doesn't even though I think it should.

If I use the normal EquipItem and not Silent or NS I get the message that you can't equip a soul gem that's empty, but it has a greater soul in it. So the code works, it's just that EquipItem doesn't seem to work that way, so is there another way to do what I want?

 

Here's my code:

ScriptName aaAzuraStarHotkey

Float fQuestDelayTime

Short CurKey
Short CurKey2
Short HotKey

Begin GameMode
	If (GetGameRestarted)
		Set fQuestDelayTime to 0.0334
		Set HotKey to 11
		
		PrintToConsole "Hotkey initialized: Azura's Star ( 0 )."
	Endif

	If ( CurKey && isKeyPressed3 CurKey )
		Return
	Else
		Set CurKey to 0
	EndIf
	
	If ( isKeyPressed3 HotKey  && MenuMode != 1035 )

		If ( Player.GetItemCount AzurasStar > 0 )
			Player.EquipItem AzurasStar
		Else
			Message "You don't have Azura's Star."
		Endif

		Set CurKey to HotKey	
	EndIf
End

Begin MenuMode 1049
	If ( CurKey2 && isKeyPressed3 CurKey2 )
		Return
	Else
		Set CurKey2 to 0
	EndIf

	If ( isKeyPressed3 HotKey )
		Player.UnEquipItemSilent AzurasStar
		Set CurKey2 to HotKey
		ClickMenuButton "recharge_button_exit" 1049
	EndIf
End

	

Any help would be appreciated, thanks!

Edited by FESilencer
Link to comment
Share on other sites

Why do you use a script? The vanilla shortcuts do the same.

 

Just thought I'd give it a try. I needed to make space for other stuff in the normal hotkeys so I made the repair one and then I tried this, so now I want it to work because I'm invested in it and curious to see what's wrong.

Edited by FESilencer
Link to comment
Share on other sites

Some mods expand the number of shortcuts/hotkeys you can use.

 

I know. I wanted to do this myself to learn.

 

 

 

However, I solved it (for anyone interested or have a similar problem):

ScriptName aaAzuraStarHotkey

Float fQuestDelayTime

Short CurKey
Short CurKey2
Short HotKey
Array_var Items
Ref Star

Begin GameMode

	If (GetGameRestarted)
		Set fQuestDelayTime to 0.0334
		Set HotKey to 12
		
		PrintToConsole "Hotkey initialized: Azura's Star ( + )."
	Endif
	
	If ( CurKey && isKeyPressed2 CurKey )
		Return
	Else
		Set CurKey to 0
	EndIf
	
	If ( isKeyPressed2 HotKey && MenuMode != 1049 )
		Set curKey to HotKey
		
		If ( Player.GetItemCount AzurasStar > 0 )
			let Items := PlayerRef.GetInvRefsForItem AzurasStar
			let Star := Items[0]
			Star.EquipMe
		Else
			Message "You don't have Azura's Star."
		EndIf
	EndIf
	
End

Begin MenuMode 1049	

	If ( CurKey2 && isKeyPressed2 CurKey2 )
		Return
	Else
		Set CurKey2 to 0
	EndIf
	
	If ( isKeyPressed2 HotKey )
		Set CurKey2 to HotKey
		ClickMenuButton "recharge_background\recharge_button_exit" 1049
	EndIf
	
End
Edited by FESilencer
Link to comment
Share on other sites

  • Recently Browsing   0 members

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