PDA

View Full Version : Benefits of Lich?



lrb508
04-17-2008, 11:45 PM
So, last time I played GS, Lich didn't exist. Or at least I didn't know about it. Can someone give me a basic overview of what exactly it is and what its benefits are?

PS: I've gotten Parallels and am now running Windows, and thus psinet and Wizard, on my Mac. It's pretty awesome.

Blushy
04-19-2008, 12:24 PM
Well Shaelun can probably tell you more, seeing as he wrote the thing, but it's basically a scripting engine that lets you use an actual object-oriented language, Ruby, for writing your scripts. It also comes with some rather useful scripts written by its creator, such as one that tracks all kinds of information about your character. It is incredibly flexible and powerful, and if you don't know Ruby, it's a great excuse to learn.

The only tiny complaint that I could have about it is that it can only monitor and insert data into the incoming and outgoing streams; it cannot remove data from either stream, so you can't write yourself any "voodoo-like" behavior.

Shaelun
04-21-2008, 11:24 AM
What are the benefits? Well... that depends. It's designed to be able to support anything the user can personally make Ruby do. I ended up writing a bunch of scripts that come along with it, but the "goal" of the program was always to allow users to implement anything they themselves were capable of coding -- not to implement it for them.

If you want a list of most of the scripts that come with it, see http://lich.sudolife.com/list.php



The only tiny complaint that I could have about it is that it can only monitor and insert data into the incoming and outgoing streams; it cannot remove data from either stream, so you can't write yourself any "voodoo-like" behavior.

Actually, you can. There's no simple, quick way of doing it, no... and it certainly won't work if a script is run in a safe environment, but it's just a matter of tracing the $_SERVERSTRING_ variable.



trace_proc = proc { |gameline|
if gameline =~ /fuck/i
$_SERVERSTRING_ = $_SERVERSTRING_.gsub(/fuck/i, "****")
end
}

trace_var(:$_SERVERSTRING_, trace_proc)

before_dying { untrace_var(:$_SERVERSTRING_, trace_proc) }
sleep

The only Lich-exclusive thing used in that snippet is before_dying, so if tracing a variable is something you're totally unfamiliar with, check any standard Ruby documentation (such as http://www.rubycentral.com/pickaxe/ref_m_kernel.html#Kernel.trace_var )

Couple of notes: Lich will (as always) let you shoot yourself in the foot without interfering, so I really suggest making sure whatever script you write includes a before_dying "clause" to make sure that if the script is killed, whatever tracing/replacing you're doing stops (because it otherwise will not -- note that the default in Ruby is to sleep permanently, so the script will just sit there waiting to be killed if setup as above).

The trace proc is run in a totally independent thread, and pausing the script will have no influence on it. The only reason killing it will stop things is that before_dying statement.

If you screw up, just ;exec untrace_var :$_SERVERSTRING_ or something and it'll remove any/all tracing of that variable.

Oh yeah... as for what that snippet would do, it would replace any occurrences of the word "fuck" with "****" (four asterisks).


There's no way that I'm aware of to 'block' commands to the game, safe mode or not. If the user wants a script killed or to type 'exit' or something, a script can't stop them.

Audriana
04-21-2008, 01:50 PM
Now THAT's sort of a good idea... I'm sure we've all been in the heat of the moment and wanted to spam FUCKING BULLSHIT WHAT THE FUCK I CANT DO ANYTHING IN THIS GODDAMN PIECE OF SHIT GAME... when we die. lol

I'd replace "Fuck" with "Skip" and "Shit" with "Pancakes"

"Skipping BullPancakes what the skip I can't do anything in this goddamn piece of pancake game"

Audriana
04-21-2008, 01:52 PM
Actually that would be a horrible idea. I'd get used to it and curse all the time. Then some reason the script wouldn't be there and I'd get banned.

Nieninque
04-21-2008, 02:48 PM
You can also have more than one script running at the same time.
I used to have one running for skinning, one for picking up skins and another for picking up loot. Made hunting a whole load easier (not that it is difficult anyway, but you know how it is.)

BigWorm
04-21-2008, 03:04 PM
You can also have more than one script running at the same time.
I used to have one running for skinning, one for picking up skins and another for picking up loot. Made hunting a whole load easier (not that it is difficult anyway, but you know how it is.)

I forget how useful this is because I use it so much. I forget that we could only run one in SF/Wiz. This is definitely a really nice feature.

Audriana
04-21-2008, 03:52 PM
Something I always put into my hunting scripts was a standup check. Now I can just have a script to always stand up and make the script start it before it starts running to the hunting grounds.

There's something about getting into a warcamp and going ;stand, and knowing that as soon as I possibly can, I'll be standing using any method available to me.

You can have a bunch of scripts going... I am usually running around with ;pickup, ;stand, ;xpsf (<< Worth lich by itself), ;rethought, and my own ;timer for mana & stamina timers.

Rolis
04-21-2008, 04:05 PM
I read up on the website about Lich and had a question. Lich has a point-to-point travel system that will take you to one of various 600+ rooms? Is that right? I was looking for a good travel script to get me place to place. Do these have good hunting areas?

Thanks

Blushy
04-21-2008, 05:03 PM
Actually, you can. There's no simple, quick way of doing it, no... and it certainly won't work if a script is run in a safe environment, but it's just a matter of tracing the $_SERVERSTRING_ variable.
Interesting. Is there a list of all the global/runtime variables and what they hold somewhere? Also, is there a reference for all the members of the various objects that are available to a Lich script, like what all the members of the Char, Skills, and Stats objects are?


There's no way that I'm aware of to 'block' commands to the game, safe mode or not. If the user wants a script killed or to type 'exit' or something, a script can't stop them.
This is really what I was looking for. Mainly, I wanted to write a script that would allow me to put my speech targets, tones, and verbs ANYWHERE in the line, instead of just right at the beginning, because the appropriate tone/verb usually occurs to me AFTER I've started typing what I want to say. But, yeah, you can't change what you've entered into the command line. So, no, Audriana, that, sadly, wouldn't work.

BigWorm
04-21-2008, 05:27 PM
Something I always put into my hunting scripts was a standup check. Now I can just have a script to always stand up and make the script start it before it starts running to the hunting grounds.

There's something about getting into a warcamp and going ;stand, and knowing that as soon as I possibly can, I'll be standing using any method available to me.

You can have a bunch of scripts going... I am usually running around with ;pickup, ;stand, ;xpsf (<< Worth lich by itself), ;rethought, and my own ;timer for mana & stamina timers.

I don't know if you wrote your own stand or you are using one of the ones Gib uploaded, but I agree that those are really useful.

For rogues, my script will use stealth stand to stand up if you're in hiding so that you won't come out into the open and does stunman stand if you're stunned. Though people prefer to just stand up, since it usually takes 2 seconds RT to tumble up unless I'm really encumbered and it succeeds nearly every time, I like to use that. Even with 2 seconds RT, it usually has me standing and out of RT before I even realize I was down.

The hardest part of the script is remembering to turn it off when you get back to town ;) so you don't start tumbling every time you try to sit down.

Audriana
04-21-2008, 07:22 PM
well I'm not highly trained in tumble or cman yet, so I modified yours a bit.

I have two things... Mine just stands, so you'll see me walk into the park, sitstand... sitstand.... pause... sit...
But when you die, it spams stand.
And when I get deeds in landing, it spams stand...

I'll fix it, or just wait til I get stunman stand and rg tumble down.

Scripts I need to make or modify at the moment:

A warcamp hunting helper for ranged - targets mobs in the following order: unstunned standing pures, unstunned standing ranged, unstunned standing anything, unstunned laying pures, unstunned laying ranged, unstunned laying anything, stunned pures, stunned ranged, stunned anything. I'll still do the attacking myself since I can usually get a shot off faster myself than a script can (1 second RT). It'll aim for the legs for anything unstunned and the head for anything stunned.

The portal script - I want to port over Dhasks portal script to Lich instead and add a few things to it. and make it faster... FASTER MUH HAH HAH HAH
Rogue Guild Traveler - Between rogue guilds, to towns... basically portal script with rogue guild locaters too. so instead of .portal icemule .rg, .rg, .portal vaalor. I can just .rg icemule (it's faster to run to mule's guild than to open vaalor's how sad is that).

Picking script - Want to port over my picking script and add a few nifty things... "Smart, Lockmastery sensitive, memory picking"... I've been gathering picking data and getting stuff together. I think my data points to some very good trends and such, so it will be a very smart picker indeed. I have the true calculations down for the picking itself and the different possible messages. I have all the possible messages already in Deathravin's picker so it should be too tough.
It should remember the difficulty of boxes it receives from each person and will choose the lockpick it feels is best. If it ever breaks a pick, it will delete the bottom 15% off current mean of the overall difficulty so it will adjust for people hunting harder areas. (or I can just tell it to do that in the starting variables).

Selling script - I have one for landing, but I want one for frostacres so I can just pop it off anywhere... But I can't find anywhere to sell the magic items in frostacres.

Herbinator - will heal me down (sunfist sensitive), and it keeps a running total of herbs. If three herbs drop below 20 bites or if a single herb drops below 10, it goes and restocks on all the herbs, getting them all between 46-50 bites. It'll run for the potions and keep them as full as possible too.
It'll try to eat herbs on a bench before getting my own herbs (I know, I'm mean... but I'm also broke).

So maybe I should get coding ><

Shaelun
04-28-2008, 08:43 PM
I read up on the website about Lich and had a question. Lich has a point-to-point travel system that will take you to one of various 600+ rooms? Is that right? I was looking for a good travel script to get me place to place. Do these have good hunting areas?

Thanks

It's about 6,000, not 600... and it includes a lot of rooms. Try it if you like, but "good" hunting areas is kind of subjective and hard to comment on, ya know.

I'll say this -- since about half of it relies on user submissions and I just don't have the time to make sure thousands of rooms have the right data, it isn't perfect and has a handful of rooms that the script just can't traverse (because of errors in the database).


Blushy: if you want a list of global variables, just use the standard Ruby method global_variables -- it'll return an array consisting of all the global variables defined. Note that the interpreter defines its own variables, so they aren't all used by Lich. As for what contains what, I'm afraid there's no list: you'd have to read the source code to look it up.

Blushy
04-29-2008, 02:06 AM
Blushy: if you want a list of global variables, just use the standard Ruby method global_variables -- it'll return an array consisting of all the global variables defined. Note that the interpreter defines its own variables, so they aren't all used by Lich. As for what contains what, I'm afraid there's no list: you'd have to read the source code to look it up.
Yeah, but objects like Char and Skills aren't global variables. It's time to slog through the source.

Thanks!

fallenSaint
04-29-2008, 03:46 PM
Funny thing for me the most useful parts of Lich arent even the ability to write scripts in Ruby. I like some of its auto correcting features that work on your basic CMD scripts. I no longer have to put in checks to make sure I don't fall down in given areas. Don't have to put in checks for failed movements since itll keep trying til I make it. Don't have to worry about RT or CT timers screwing with me. Run multiple scripts at once and constantly and not suck any free resources I have. Stuff like that is why I adore the program, the Ruby I think is just a cherry on the top.

Shaelun
04-29-2008, 05:50 PM
Yeah, but objects like Char and Skills aren't global variables. It's time to slog through the source.

Thanks!

If it helps at all, classes are internally treated as constants of the "Class" class. You can get a list of all of those as an array with Class.constants. Basically everything that's of use to scripts is defined in the lich-lib.rb file; there are bits and pieces in other places, but the vast majority you can find in that file.

Lord Orbstar
08-04-2008, 07:28 PM
I feel stupid. i dont know what the fuck you guys are talking about. Isnt Ruby a gem? I use the Stormfront FE and thought that was advanced. This LICH or PSINET doesnt sound like anything you can just download and plug an play.

is it?

Renian
08-04-2008, 07:35 PM
Yes. They are.

Well...Separately. Together though, here's the instructions.

>?lich se
The PsiNet Library sent you this article:

[=-=-=-=-=-=-=-=-=-=-=-=]
Article "Lich SE" [AID #762]

Lich is not my program. I did not make it and I don't really care if you can't get it to work.

With that said, here are some basic instructions- if they do not work, and you contact me for help, I'm likely to be irate.

Essential bits of knowledge

1) PsiNet is not compatible with Lich's host redirection. You must use the registry method.
2) PsiNet must be closest to the game. If it detects that its connection to the game is being redirected or intercepted, it will fail to run.
3) This means, install PsiNet LAST.
4) Lich cannot handle launch instructions whose parameters include a space. Therefore, PsiNet2 must be installed to a folder which does NOT have spaces in it. For good measure, put Lich in a folder without spaces too.


Instructions:
1. Uninstall Lich and PsiNet.
2. Reinstall Lich, making sure it is in a folder that contains no spaces.
3. Go to start->all programs->Lich.
4. Click "Install to Registry".
5. Install PsiNet2 into a folder that contains no spaces.
6. Load Gemstone.

Credit for the first version goes to Renian. If this doesn't work, don't contact me.

TROUBLESHOOTING:

If you start getting multiple instances of Lich running then you have Psinet pointing to Lich and Lich pointing to Psinet.
Start over. Uninstall both and delete all lich files. Set Simu AutoLaunch registry back so it points to the SIMU launcher

Instructions:
1. Uninstall Lich and PsiNet.
2. Install the Simutronics launcher from http://www.play.net/software/lnchinst.exe.
(This will restore the registry to default and correct settings. You do NOT need to uninstall the launcher first. Make sure you are installing the LAUNCHER, not the ENTRY.)
- AutoSGE should run Stormfront without psinet or lich attached at this point
- if Psinet asks to be installed then the registry setting is wrong.
3. Reinstall Lich, making sure it is in a folder that contains no spaces.
4. Go to start->all programs->Lich.
5. Click "Install to Registry". (Simu Autolaunch registry entry changes to point to the lich)
6. Install PsiNet2 into a folder that contains no spaces. (Simu AutoLaunch registry entry changes to point to PsiNet)
7. Load Gemstone.


Now when AutoSGE launches the Game:
AutoSGE -> Psinet -> Lich -> Stormfront

Communication occurs:
Simu Server <- Psinet <- Lich <- Stormfront

--Gabric

[=-=-=-=-=-=-=-=-=-=-=-=]