View Full Version : How to do a StormFront SHIFT with Lich?
Luxelle
04-28-2015, 09:40 PM
I've looked all through the lich command list and don't see an equivalent for the SHIFT that exists in StormFront.
So how do I accomplish this in lich? It's for a multiple word input:
.cmd Word1 Rest of the line to follow
SETVARIABLE one %1
shift
put %one% %0
DELETEVARIABLE one
I'm converting some things to ;scripts so that they don't auto abort each other. :)
Thank you for any enlightenment.
~L.
DaCapn
04-29-2015, 01:19 AM
I don't know what 'shift' does exactly but based upon what I assume, it's essentially unnecessary as the arguments passed to a script can be accessed using `variable` or `script.vars` and their contents are of the array type. This is listed on the lich scripting reference wiki article.
Basically take any script that you can use with arguments, open it up, and look how it handles those arguments ("help" is the most obvious one as you can very easily search for that phrase). This is the basic technique for learning how to do anything at all when lacking documentation.
Tillmen
04-29-2015, 01:23 AM
Well... on one hand... the equivalent for "shift" is indeed "shift". You do have to tell it what to shift though, because it's a method that can be applied to any array, so it would be "script.vars.shift".
On the other hand, if you're rewriting the script for Lich, you should probably throw out the entire structure of the script, including the need for any shifting. The limits of Stormfront scripting create a horrible but necessary script structure.
If you just want to be able to run these scripts at the same time and you don't wish to learn Ruby, you can accomplish that by putting the unedited Stormfront scripts in your Lich script directory with a .cmd file extension and pretend they're Lich scripts.
A good compromise might be to use the wiz_to_lich script on the repository. It attempts to convert a Wizard/Stormfront script into a Lich script and saves it. The output generally isn't pretty, and doesn't show you how a Lich script should be written. It does produce a (probably) working Lich script that you can then edit and improve with fancy Lich stuff though.
Or, if the script isn't too horribly long, you can post it here and I'll see if I can rewrite it for Lich, which should give you a better idea of how to do your other scripts.
Luxelle
04-29-2015, 05:01 AM
Options! You rock Tillmen!
I'll think about it ... tomorrow.
Thanks so much.
~L.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.