View Full Version : Lich Script Idea
pabstblueribbon
04-02-2007, 08:02 AM
Hello, I hope i dont get flamed all to hell for this but. I've looked at the Ruby programming language, and a few of the scripts in the repository and... believe me. Im lost. I'd really like to learn to do this myself but, im just not a programmer by trade. So here is the idea, and hopefully someone can help me or write it as I think it would make a great addition. And if you dont think so, then bugger off!
Looking to have a global trigger system for the lich, which works like the alias system. Simply set it with this:
;trigger set line to match from the game=what you want to output when it happens
Hopefully including the wildcard stuff like alias /? and the extra commands /r.
then a command that lists your active triggers like ;alias
;trigger
So, can anyone help me out? I'd pay in silvers :p for their time. My skill as a programmer are just not up to snuff for somethin like that.
pabstblueribbon
04-02-2007, 12:39 PM
pretty pwease
100% Wool
04-03-2007, 09:12 AM
Weren't you the one that brought up wiztrigger? Why don't you try that out?
Or make small mini scripts with Lich since you can run multiple scripts at once?
pabstblueribbon
04-03-2007, 09:25 AM
hmm guess i could at least figure out how to match patterns and output them.
would be nice to have a system for typing it in the command line though. just thought it'd neat, ah well.
i dun think i mentioned anything about wiztrigger.. whats that anyways?
Slark
04-03-2007, 09:50 AM
So...pretty much what you want is a huge waitfor loop?
pabstblueribbon
04-03-2007, 09:53 AM
eh not sure if waitfor would work.. you cant run multiple SF scripts in lich can ya? hmm. If it used waitfors, it'd hang on the first trigger, wouldnt it and not even try to match any under it, if you were to do it in SF of course... i think..
No what im lookin for is for a lich script that just matches strings you specifies, then outputs what you set it to do when it does match.
pabstblueribbon
04-03-2007, 10:03 AM
Also, the added benefit of having a command line interfact to add triggers would be nice, so you didnt have to add to your .lic file everytime you wanted to match something and then do something. I dunno. Its just an idea. If anyone could do it, I could definitely go over specifics. If you've used zmud, all im trying to do is create a global trigger system, thats configurable at the command line like ;alias
Caede
04-03-2007, 10:15 AM
I'm not 100% familiar with how zMud triggers work, but this should certainly be possible in Lich. I could give you some ideas, but you'd need to spec out the request a bit more. Can you give me a step by step of how exactly you'd want it to work, and include a few little examples of what a trigger would be and what it should do?
Have you looked at JSE? Using it's match system, it seems like you could just make a script to do this pretty easily.
triggers:
match BeHappy $varname$ smiles at you.
match BeSad $varname$ frowns at you.
match Eating You take a bite of your $varname$.
matchwait
BeHappy:
put SAY :HAPPY ::%varname% I love you so much, %varname%!
goto triggers
BeSad:
put SAY :ANGRY I don't like %varname% very much.
goto triggers
Eating:
put SAY Boy, this %varname% sure is delicious! Mmm-mmm good!
goto triggers
A very basic version of this in Lich would just be a giant match block:
triggers:
match "eating","You take a bit of your"
match "behappy","smiles at you."
match "besad","frowns at you."
match "label","text-to-match"
match "label","text-to-match"
match "label","text-to-match"
match "label","text-to-match"
match "label","text-to-match"
matchwait
eating:
fput "say This sure is yummy."
goto "triggers"
behappy:
fput "say I feel so loved!"
goto "triggers"
besad:
fput "cry"
goto "triggers"
EDIT: Sorry, just saw a bit more of what you're trying to accomplish. My example above fails on a few particulars, especially with a command-line interface. Give me an example of how you would want to add a trigger and exactly what it would do, and I'll toss together a Lich snippet if it seems feasible.
pabstblueribbon
04-03-2007, 10:29 AM
Ah yes. The elusive JSE. I've been unable to find a download nor any documentation on how to use it. :(
As far as doing it in lich, your above example is basically how I want it to work, albeit 'configurable' via the command line. For instance if you type ;alias you see a list of your current alias's.
I just want a way to add triggers on the fly while the script is running, like alias. And possibly the ability to toggle it on or off. The E in front of it means it will parse, the D in front of it means it wont, IE enabled, and disabled. The first chunk is what its looking to match, the second after the => is what it will do when it matches. For instance:
;trigger
--- Your current Lich triggers are:
E 1) The cutter drops its anchor. => go gangplank
D 2) Thenle stretches with a mighty yawn, causing the fabric of his shirt to strain at the seams. => say :/? Nice shirt!
E 3) etc...
Then you set it with,
;trigger set The cutter drops its anchor.=go gangplank
etc
and enable/disable toggle
;trigger enable (number)
>;trigger enable 1
--- Enabling....
E 1) The cutter drops its anchor. => go gangplank
>;trigger disable 1
--- Disabling....
D 1) The cutter drops its anchor. => go gangplank
But from the looks of it, it seems like a JSE script will work as good as any, if only i could find someone to send it to me. Also, can I have an SF script running while JSE runs that script in a loop?
pabstblueribbon
04-03-2007, 10:44 AM
hopefully with some wildcards and the ability to set a variable within the trigger, for instance %1 whispers to you=whisper %1 Im a bit busy at the moment
doesnt need to save the variable, just needs to store it for the output when the trigger fires, ouput it, then dump it.
Caede
04-03-2007, 11:06 AM
JSE only works with Wizard -- it does allow you to run multiple scripts at once, however, just like Lich.
If you're interested, I'll send it to you -- otherwise, if you're only using SF, you'll need to stick with Lich.
This actually is a somewhat useful idea, since I'm always writing 'one-off' waitfors like this in Lich:
;e waitfor("gangplank"); fput "give ferry 10"; fput "go gang";
Your trigger idea would allow me to not have to spend the 5 seconds rewriting that everytime -- I could just ;trigger enable riverferry or summat.
I'll take a look at the ;settings code and see how tricky this might be.
100% Wool
04-03-2007, 12:59 PM
http://www.wiztrigger.com/
But this is for wizard only obviously.
It basically is a third party program that uses zMUD's trigger system
It costs 15 bucks though
Anebriated
04-03-2007, 04:45 PM
what programming language does JSE use? All I need is the old wizard scripting engine with the ability to run multiple scripts at once...
pabstblueribbon
04-03-2007, 08:22 PM
well, wiztrigger looks nice and all. But i'd rather keep it as a lich thing. Maybe we could start small and keep getting bigger. Its open source, and the repository is such a nice tool. Not to mention, i dont use the wizard. My hunting scripts just wouldnt work. And i really dont want to add ANOTHER front end addon. I really just want SF and lich. Keepin it simple. Maybe it doesnt take much resources, but i just dont like the idea of having multiple mods like, lich, blacklightning and psinet all running at once. Especially since lich has so far been the best i've tried (my opinion)
pabstblueribbon
04-07-2007, 09:47 PM
any news mate? and thanks for posting the jse, its very interesting. cant dump stormfront though.. sigh.
Bobmuhthol
04-07-2007, 09:50 PM
<<what programming language does JSE use? All I need is the old wizard scripting engine with the ability to run multiple scripts at once...>>
Its own. But it also reads Wizard scripts functionally, except for the MOVE command.
Shaelun
04-08-2007, 04:01 AM
Ah yes. The elusive JSE. I've been unable to find a download nor any documentation on how to use it. :(
I rather liked Jamus; up until he started publically bashing me every chance he got, anyway... I'm loath to say it, but objectivity demands I do: there is one thing JSE has that Lich doesn't -- you can match against game strings and set variables to capture portions of the text at the same time. 'Course that's the only thing, as far as I know, but w/e. Moot point.
Your idea really wouldn't be hard to implement... one script to handle the actual monitoring for triggers and reacting to them (constantly running), and another to handle the command-line enabling/disabling/altering of them.
... I guess maybe saying "it wouldn't be hard to implement," is misleading. It wouldn't be an enormous undertaking I guess is what I mean, but it's not something you can do with match blocks.
Anyway, I'll keep it in mind, but I doubt I'll ever sit down and actually get to it.
Shaelun
04-08-2007, 05:17 AM
I take it back, you could do it with match blocks I think... I forgot that you can just as easily give the match method variables as you can literal strings. And if anyone else forgot that scripts all share the same global variables, consider this sentence your reminder.
I often slip and call them methods (that's what they really are, but "command" has a lot more meaning for most people). So whenever I do, just read it as "command".
Have fun guys :)
Cap'nDrak
04-28-2007, 01:42 PM
Ok, I'm really new to the Lich system. So has anyone had issues with Lich and Vista? I'm completely sure that EVERYTHING has issues with Vista, but I can not even get it to start up. Help?
Shaelun
05-06-2007, 04:31 PM
Ok, I'm really new to the Lich system. So has anyone had issues with Lich and Vista? I'm completely sure that EVERYTHING has issues with Vista, but I can not even get it to start up. Help?
If I could help I would, but I know precisely nothing about Windows Vista. It may not be compatible at all.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.