Creating an ON/OFF switch for Khas's Lantern?

I'm currently using Khas Lighting Effects and would like to know if there's anyways I can assign a hotkey to turn the lantern on and off. I currently have it so that I have two separate lanterns and will have to go into my inventory to switch between [Lantern On] and [Lantern Off] but I'm looking for a more streamlined way to do this. Any help is appreciated!
link to script please.
Here's the download link for the script or rather, demo which it's included in:http://www.mediafire.com/download/diy3ba8uwxi3v6i/%5BACE%5D%5BEN%5D+Awesome+Light+Effects+1.0.rar


And here's the script itself


Hopefully I can get help soon, thanks!
No, I asked for a LINK to the script. For a number of reasons, which I will not list (otherwise I'd have listed them three times today now), we do not want people to post other people's scripts here. Show us the original page where the script is introduced. Where the scripter talks about the script, provides screenshots, answers questions.
http://forums.rpgmakerweb.com/index.php?/topic/4917-khas-awesome-light-effects/

I hope this will suffice, sorry for my mistake
Khas' script has no built-in switch function so you can't just determine a switch and have it ON and OFF. However, you can always do it on your own using a conditional branch. It will be a bit tricky, but on a parallel process event, use a conditional branch with "If Button X was pressed," and I think you can find something around it.
I like the idea of having a conditional branch, but I have no idea how to make the character equip the lantern, I was only able to go as far as putting the lantern in the inventory
Ahh you'll have to create an item in the armor tab in the database if you want to equip it, and make it an "Accessory," I suppose. But you can't equip something from the items database only.
Well I currently have it set as a consumable item and when I consume [Lantern On] it removes [Lantern On] and adds a [Lantern Off] to my inventory. By consuming either item it can tell the common event whether or not there is light eminating from my character. I've been fiddling around with conditional branches but I'm stuck. Any idea on how I can make it so that pressing a button would auto consume an item? Or maybe another script which will give me the ability to assign hotkeys to an item/items to turn them on/off
I quickly looked it up, and I found this script which will be useful in your case I believe:

http://www.rpgmakervxace.net/topic/6429-skillitem-hotkeys/
I'll try this out first thing in the morning as I've been messing around trying with conditional branches for hours and it's 2 am now zzz. Thanks for all your help!
Actually I wanted to install the script before I went to bed but upon running I got a system stack error, stack level too deep. Any idea what this is supposed to mean?
Jeremichii, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


Just use the edit button to add the extra info rather than double posting.


The most common cause for that error is that you have the same script installed twice. Or two scripts redefine a method using the same alias. But more likely that you have a script in there twice.


Make sure ALL your script slots are named, if they have code in them. That'll go a little towards helping you avoid this issue.
Is there any reason to force the player into the inventory screen every single time they want to toggle the lantern?


To do what you want, you just need to use basic eventing.


Make a parallel common event, set a switch for it.


You will activate that switch when the player gets the lantern, so the event will run all the time after, but not before.


In the common event itself, you make a conditional branch which checks if a button was pressed. No need for an 'else' branch, so turn that off.


Inside this check, add another condition check which checks if a switch is turned on or not. You need the 'else' part here.


If it is turned ON, add the script command to turn the lantern OFF inside the check, and at the end, turn the switch OFF (the switch for the required condition check).


Hop onto the 'else' part, and add the script command to turn the lantern ON here, and at the end, turn the switch ON.


You are done, the player can now toggle the lantern with a press of a button anytime, but only after he/she gets the lantern.

Original thread: https://forums.rpgmakerweb.com/threads/creating-an-on-off-switch-for-khass-lantern.42570/