But how do I make a button just open it straight away?
Here is the script for the keypress detection:
Scriptname _wzWaitScript01 extends QuestGlobalVariable Property KeyPressTime autobool bIsHotkeyPressedint Property iHotKey = 20 autoint waitOIDEvent OnInit() RegisterForSingleUpdate(KeyPressTime.GetValue())EndEventEvent OnUpdate()if bIsHotkeyPressed != input.IsKeyPressed(iHotKey) bIsHotkeyPressed = !bIsHotkeyPressed if bIsHotkeyPressed debug.Notification("Key Pressed") endif endifRegisterForSingleUpdate(KeyPressTime.GetValue())endEvent
Here is the script for the MCM menu:
Scriptname _wzMCMwait extends SKI_ConfigBase GlobalVariable Property KeyDurVal autoint KeyDurOID;Menu FormattingEvent OnPageReset(string page) AddHeaderOption("General Settings") KeyDurOID = AddSliderOption("Keypress Delay", KeyDurVal.GetValue())endEvent;KeyPressDelay Slider settingsEvent OnOptionSliderOpen(Int option) if (option == KeyDurOID) SetSliderDialogStartvalue(KeyDurVal.GetValue()) SetSliderDialogDefaultValue(0.25) SetSliderDialogRange(0.05, 2.0) SetSliderDialogInterval(0.05) endifendEvent;What happens after KeyPressDelay slider has been acceptedEvent OnOptionSliderAccept(Int option, float value) if (option == KeyDurOID) KeyDurVal.SetValue(value) SetSliderOptionValue(KeyDurOID, KeyDurVal.GetValue()) debug.Notification(KeyDurVal.GetValue()) endIfendEvent;Information TooltipsEvent OnOptionHighLight(int option) If (option == KeyDurOID) SetInfoText("Changes how responsive the key will be. WARNING: Less time = more performance hit but more responsive") endIfendEvent