PDA

View Full Version : Lich Help



Savageheart
01-07-2008, 01:15 PM
Just downloaded Lich,

Having some troubles.

First, it is under the impression I don't know any spells and I am hard pressed to find some sort of character status upload feature as with Psinet.

It seems more customizable at first blush but the help files are not very competent, or perhaps I am just wonderfully incompetent. In either case can anyone give me a crash course on Lich?

Shaelun
01-08-2008, 06:01 PM
The documentation is definitely not up-to-snuff. Writing the program was fun. Documenting it was boring and tedious -- so I documented what I could stand to.

Crash course: it's a scripting engine and wasn't meant to provide "out of the box" functions the way Psinet does. It was written to be flexible and customizable enough to let someone implement any feature they were capable of writing the code for -- anything else was just me screwing around and having fun writing scripts that do precisely that (provide features). I generally try to keep them working, but I don't have the time nor the desire to work on them that I used to. My point is that you should use what works, and ignore what doesn't.

All character monitoring is handled by the "infomonitor" script. Just typing SKILLS FULL should be enough for it to track your character's information. Thereafter any script should be able to access that. I have no idea what "character status upload" feature you're talking about, so I can't really comment on that.

Sean of the Thread
01-08-2008, 06:05 PM
I just downloaded Lich and it stole my registry.

Shaelun
01-08-2008, 06:09 PM
I just downloaded Lich and it stole my registry.


Your bike, your Webkinz password, your account info, AND your registry?

Somebody should lynch whoever wrote the program. Where's my pitchfork?!

Sean of the Thread
01-08-2008, 08:21 PM
You forgot it stole my thanksgiving leftovers too.

Frozen Rope
01-08-2008, 08:46 PM
Can you tell me how to resolve this error Shaelun...

--- Lich: error around line 26: can't convert nil into String

that line says: put cast at Sillyempath

Frozen Rope
01-08-2008, 10:02 PM
Does lich handle well .cmd scripts with variables? %user0, %weapon, %S, %C?

FinisWolf
01-09-2008, 12:30 AM
Someone poast the LICH link please.

Finis

Frozen Rope
01-09-2008, 07:46 AM
http://lichproject.sourceforge.net/faq.php

Shaelun
01-09-2008, 10:24 AM
Can you tell me how to resolve this error Shaelun...

--- Lich: error around line 26: can't convert nil into String

that line says: put cast at Sillyempath

If you're running it as a Lich script (.lic), then you need to enclose in quotes the part that isn't a "command" or "directive" or whatever you want to call it. The put is a command (technically a "method," but calling it a "command" suffices), and it's expecting a string (i.e. something for it to "put" to the game as though you had typed it). It's not receiving a string though. Change the line to:


put "cast at Sillyempath"
... and it should work fine. If, however, you're running it as a Wizard/SF script, then you shouldn't be having a problem at all with that line -- so I'm assuming that isn't the case.


It handles Wizard and SF scripts almost perfectly. For some reason it's never run SBC, despite running MTP (a derivative script) perfectly... that's the only script I ever found that it didn't run properly though. Note that I fixed a bug with Wizard/SF scripts in v3.52, so if you're using a version prior to that you may have problems. Note also that it doesn't actually use Wizard's variable settings (Lich isn't sophisticated enough to go scanning your computer's memory for Wizard's variable values). It uses its own -- see the settings.lic script for info on that.

FinisWolf
01-09-2008, 11:26 AM
http://lichproject.sourceforge.net/faq.php

Thanks!

Finis

Gibreficul
01-09-2008, 06:25 PM
I think Lich and Vista dislike each other, especially with psinet piled on top.

Frozen Rope
01-09-2008, 09:17 PM
If you're running it as a Lich script (.lic), then you need to enclose in quotes the part that isn't a "command" or "directive" or whatever you want to call it. The put is a command (technically a "method," but calling it a "command" suffices), and it's expecting a string (i.e. something for it to "put" to the game as though you had typed it). It's not receiving a string though. Change the line to:


put "cast at Sillyempath"
... and it should work fine. If, however, you're running it as a Wizard/SF script, then you shouldn't be having a problem at all with that line -- so I'm assuming that isn't the case.


It handles Wizard and SF scripts almost perfectly. For some reason it's never run SBC, despite running MTP (a derivative script) perfectly... that's the only script I ever found that it didn't run properly though. Note that I fixed a bug with Wizard/SF scripts in v3.52, so if you're using a version prior to that you may have problems. Note also that it doesn't actually use Wizard's variable settings (Lich isn't sophisticated enough to go scanning your computer's memory for Wizard's variable values). It uses its own -- see the settings.lic script for info on that.


Thanks for replying.

It is a .cmd script I was attempting to run through lich (;w). I suppose it's possible that is not the exact line in error as the error message says the error is 'around' line 26. I just c&p'd line 26 from my editor. If you have time and care to look I'll post a handful of lines around 26....maybe you'd see something obvious causing the error.

If I read your last paragraph correctly lich will interpret a wizard script that uses a variable in the command line like this example <.attack wolverine thrak>....but if a line such as <put look in my %backpack> is used within the script it will not look up %backpack and see that it's my sock that I'd like to store the item in.

Correct?

Shaelun
01-10-2008, 10:34 AM
Frozen Rope: Absolutely correct. You can setup Lich's own preferences to mimic whatever your front-end's settings are, but it's totally independent.

I'm not sure what the problem with the script in question is... can you upload it so I can have a peek at it?

Gibreficul: lots and lots of things have a problem with Vista, or so I hear... unfortunately I've only heard of one person trying to run Lich in Vista, and they said that it didn't appear to do anything at all. I never heard anything else from them, so I'm not sure what to say about it (I don't have a copy to test on, and I don't know where to even start poking around for incompatibility issues).

The program just may be broken completely in Vista, for all I know.

Frozen Rope
01-10-2008, 06:57 PM
Frozen Rope: I'm not sure what the problem with the script in question is... can you upload it so I can have a peek at it?

Let me look myself this weekend and see if I can resolve it on my own. With the help files in the Lich directory I'm pretty sure I'll figure out what the problem was. I'll post a bit of it this weekend if I can't figure it out on my own.

Thanks.

Halstein
01-10-2008, 06:59 PM
I run both Lich and Psinet together on a couple Vista x64 machines without problem.

Frozen Rope
01-12-2008, 08:49 AM
I can edit the settings-charactername.txt file in the Lich directory in SciTE and avoid having to add the variables for containers and what not in game.

But I also added a weapon2: setting for naming a variable for a second weapon...can I add any setting I need just by entering it in this file the same way the other settings are entered?

Frozen Rope
01-13-2008, 03:04 PM
Frozen Rope: Absolutely correct. You can setup Lich's own preferences to mimic whatever your front-end's settings are, but it's totally independent.

I'm not sure what the problem with the script in question is... can you upload it so I can have a peek at it?


Well...I can't quite get it. Here is the script as I use it, it's just a simple short script to spell myself up. What this does is cast 401 on myself 4 times. When I run it using ;w it casts 401 on me once before I get an error... How simple would this be to write in Lich? If it's not too much trouble could you fix this script to work with ;w and also let me see how it would have the same functionality but written for Lich? If you're too busy I understand...

--- Lich: error around line 36: can't convert nil into String

#Spellup Wizard

# .sg 4 401


save %1
Counter set %1
SHIFT
GOTO Start

6:
5:
4:
3:
2:
1:

Start:
put prep %1
Match Cast Your spell is ready.
Match StartWait wait
MatchWait

StartWait:
pause 2
GOTO Start

Cast:
counter subtract 1
put cast at Wizard
Match %C You gesture
Match CastWait wait
MatchWait

CastWait:
pause 3
GOTO %C

0:
SHIFT
Counter set %S
If_1 GOTO Start
Exit

Shaelun
01-14-2008, 05:57 PM
I went to fix what I thought was a bug in the Wizard/SF interpreting code, and I don't really see one. I do however notice that the `%c' and `%s' character sequences appear to be case sensitive; I changed it for the next version, since Lich is supposed to behave exactly like Wizard/SF when running one of their scripts. For the time being, try changing those to use lower case letters instead.

As for rewriting it in Lich format...


spell = Script.self.vars[2]
Script.self.vars[1].to_i.times { cast(spell, 'Wizard') }
Script.self = lookup and retrieve the current script object
vars[1] = the command-line variables are stored in this array for every script
to_i = to_integer (convert from a string to an Integer class object)
times = that many times, execute this block
cast(spell, 'Wizard') = handle casting the spell on the target ('Wizard' here -- type ``;man cast'' in-game for details)

That should do it. Long chain of methods, but it was easy enough to come up with off-hand.

Frozen Rope
01-14-2008, 10:01 PM
I still couldn't get it to work even changing to lower case on the %C and %S. I got this error message:

--- Lich: error around line 21: undefined local variable or method `labels' for #<Script:0x2f06c50>

I changed the script to this from what you saw in my last post and it works fine now.

#Spellup Wizard

# .sg 4 401 406 414


save %1
counter set %1
shift
goto start

6:
5:
4:
3:
2:
1:

start:
put prep %1
put cast at wizard
pause 3
counter subtract 1
goto %c

0:
shift
counter set %s
if_1 goto start
exit

Frozen Rope
01-14-2008, 10:11 PM
I went to fix what I thought was a bug in the Wizard/SF interpreting code, and I don't really see one. I do however notice that the `%c' and `%s' character sequences appear to be case sensitive; I changed it for the next version, since Lich is supposed to behave exactly like Wizard/SF when running one of their scripts. For the time being, try changing those to use lower case letters instead.

As for rewriting it in Lich format...


spell = Script.self.vars[2]
Script.self.vars[1].to_i.times { cast(spell, 'Wizard') }
Script.self = lookup and retrieve the current script object
vars[1] = the command-line variables are stored in this array for every script
to_i = to_integer (convert from a string to an Integer class object)
times = that many times, execute this block
cast(spell, 'Wizard') = handle casting the spell on the target ('Wizard' here -- type ``;man cast'' in-game for details)

That should do it. Long chain of methods, but it was easy enough to come up with off-hand.

The only thing that .lic version doesn't do that my .cmd would is loop through multiple cast of multiple spells...such as .sg 4 401 406 414...where there I'd get 4 cast of each spell.

I looked at your lich docs this weekend and played around for a little while...I didn't pick up on things as quickly as I'd have liked to but I didn't have as much time as I'd like to have had either.

Maybe for the time being since my time is short I'll concentrate on trying to make some more of my .cmd scripts work when run through lich. I love the fact that lich doesn't run my pc's processor at 100% when I run scripts.

Shaelun
01-15-2008, 12:05 AM
The errors you're getting are really puzzling me for the time being. I'll try to figure out what's going on though...

Here's a fully-functional version:


list = Script.self.vars[2..-1]
num = Script.self.vars[1].to_i

for spell in list
num.times { cast(spell, 'Wizard') }
end

Hopefully this'll give you the basic idea:

When you reference an array the way the first line does, it returns a subset of that array (in this case array index positions 2 through -1 [-1 being the last element]). So the first line is making a copy of the appropriate variables entered on the command line, and storing them in the list variable.

The second line is just converting the first command line variable to an integer and storing it in the num variable. The reason for converting it from a String object to an Integer object is that the num.times part requires an Integer, and won't work with a String.

The third line is the same basic syntax for a for loop that you find in most high-level scripting languages. for (variable_name) in (array) -- a Ruby tutorial will elaborate.

Then we have the same basic num.times thing as before. Then the last line just ends the for loop.

Good luck :)

Shaelun
01-15-2008, 12:42 AM
So I altered the script you previously posted in order to run it and get a closer look at what's happening, and there aren't any errors at all. Are you absolutely certain that you're using Lich v3.53, and changed all the instances of %s and %c? This is the script as I have it; try it and see what happens:



#Spellup Wizard

# .sg 4 401


save %1
Counter set %1
SHIFT
GOTO Start

6:
5:
4:
3:
2:
1:

Start:
put prep %1
Match Cast Your spell is ready.
Match StartWait wait
MatchWait

StartWait:
pause 2
GOTO Start

Cast:
counter subtract 1
put cast at Shaelun
Match %c You gesture
Match CastWait wait
MatchWait

CastWait:
pause 3
GOTO %c

0:
SHIFT
Counter set %s
If_1 GOTO Start
Exit

Frozen Rope
01-16-2008, 09:37 PM
So I altered the script you previously posted in order to run it and get a closer look at what's happening, and there aren't any errors at all. Are you absolutely certain that you're using Lich v3.53, and changed all the instances of %s and %c? This is the script as I have it; try it and see what happens:



#Spellup Wizard

# .sg 4 401


save %1
Counter set %1
SHIFT
GOTO Start

6:
5:
4:
3:
2:
1:

Start:
put prep %1
Match Cast Your spell is ready.
Match StartWait wait
MatchWait

StartWait:
pause 2
GOTO Start

Cast:
counter subtract 1
put cast at Shaelun
Match %c You gesture
Match CastWait wait
MatchWait

CastWait:
pause 3
GOTO %c

0:
SHIFT
Counter set %s
If_1 GOTO Start
Exit


I'll try that tonight, thanks. I'm pretty certain I did that but who knows...I build houses for a living so apparantly it's easier to do that then write a program in Lich ;)

In the mean time I'm trying to add variables to the Character.settings.txt file in Lich so I can run my .cmd scripts through Lich until I pick up better on Lich.

I added weapon.dagger to the settings file and added put get my Lich.weapon to my .cmd script. I ;reloaded to updage and ran the script...it returned a Get what? in game, appearing also to echo Lich.weapon to the game window. Are there parenthesis or brackets I'm missing? I tried a bunch of different combinations but couldn't get it right...any quick fix here?

Frozen Rope
01-16-2008, 11:15 PM
So I altered the script you previously posted in order to run it and get a closer look at what's happening, and there aren't any errors at all. Are you absolutely certain that you're using Lich v3.53, and changed all the instances of %s and %c? This is the script as I have it; try it and see what happens:



#Spellup Wizard

# .sg 4 401


save %1
Counter set %1
SHIFT
GOTO Start

6:
5:
4:
3:
2:
1:

Start:
put prep %1
Match Cast Your spell is ready.
Match StartWait wait
MatchWait

StartWait:
pause 2
GOTO Start

Cast:
counter subtract 1
put cast at Shaelun
Match %c You gesture
Match CastWait wait
MatchWait

CastWait:
pause 3
GOTO %c

0:
SHIFT
Counter set %s
If_1 GOTO Start
Exit


Well, I'm not sure what the problem with my script was because the .cmd script you posted, the version of mine that you altered, worked fine. I botched something...but glad it works.

I'm trying to work in some Lich stuff into my .cmd scripts....maybe ease my way in. I was told they work together is that right? If so hopefully you can straighten me out with my previous post.

Thanks again...preciate the time you're giving me...

Shaelun
01-18-2008, 10:51 PM
Yes, they work together. You can include Lich code in a .cmd script like so:


if_1 goto whocares
put cast something at someone

LICH {
echo "You have to follow proper syntax and all other normal Lich rules here"
if Char.health < 50
echo "Get healed."
end
} LICH

goto somelabel

It's a useless, contrived example, but you get the idea. You can use as many of those snippets as you like. Essentially it "embeds" a mini-Lich-script in the Wizard script. They also run in a "safe" environment, though, and aren't able to do things like access the hard drive or anything else that could possibly be unwanted by the user.

Oh, nearly forgot -- you cannot use labels within the Lich block(s). Labels aren't native to Ruby, and these "embedded" Lich snippets don't go through the preprocessing a normal .lic script does (that's when Lich sets up label jumps for the script). You can use labels all you want in the normal Wizard formatted portions, but that's all.

Frozen Rope
01-18-2008, 11:44 PM
I added weapon.dagger to the settings file and added put get my Lich.weapon to my .cmd script. I ;reloaded to update and ran the script...it returned a Get what? in game. Are there parenthesis or brackets I'm missing? I tried a bunch of different combinations but couldn't get it right...any quick fix here?

How am I getting the syntax wrong for calling a variable stored in the settings.txt file to one of my .cmd scripts?

In my .cmd script I'd enter put get my %weapon and that would get the weapon from my container that I have stored in the %weapon variable slot in my options.

I know Lich's variables are stored in the character.settings.txt file but I'm having a hard time getting the syntax right for using that in one of my .cmd scripts that I'm running through Lich. I thought it was put get my 'Lich.weapon' but that returns a Get what? instead of drawing my weapon. I know it's a baby step, but could ya help me with this?

Shaelun
01-19-2008, 01:05 AM
Lich.weapon is essentially a variable. So you use it the same way; if it's a Lich "snippet":


put "get my #{Lich.weapon}"
If it isn't a Lich snippet, you don't want anything weird. The actual values aren't shared by Lich & Wizard, but the syntax and scripts should be identical. Basically I wrote my own version of Wizard/StormFront's script interpreters, so treat it exactly like a Wizard script that has no match limit. Just the same as you'd do in Wizard:


put get my %weapon

Also, that's not the right file. It's "settings-{characterName}.txt" (e.g. "settings-Shaelun.txt"