PDA

View Full Version : Lich Assistance with Loot Grabber Script



deck
12-28-2005, 02:07 PM
Ok, I have this script that picks up gems, I wanted to use lich so I could match a ton of gems but it won't see them, it stops right after look, and doesn't do anything
won't report Fin, won't pickup any gems.

the gem definitions just grabs it and puts it in a bag. lemme know what you think.

start:

loot:
put look
match sapphire sapphire
match sruby star ruby
match ruby ruby
match diamond diamond
match nomore Obvious Exists:
matchwait


nomore:
echo FIN!

Drew2
12-28-2005, 04:18 PM
Because you can't use Wizard-type scripting in Lich.

PS- A script to pick up ONLY what you specify wouldn't be easy for you to write in Lich, unless you can tell me what an array is.

[Edited on 12-28-2005 by Tayre]

Axhinde
12-28-2005, 04:28 PM
If you wrote the script as a wizard script, just run it with ;wiz <script name> and it'll work fine.

deck
12-29-2005, 01:14 AM
yea, it didn't work fine, I ran a debug, and it seems when it is loading a roomname, it stops the next set of matches until after the room has completely loaded, I am wondering if this is a lich feature, or a bug suppose I'll go scower throught he source to see but responce from Shaelun or someone else who knew for sure would be appreciated.

BTW: an Array you can think of as a strand of numbers, kind of like Film negatives where you have one variable, with 10(or any other number) of different "compartments" to store data to be called individually in the script.

Drew2
12-29-2005, 09:24 PM
You'd want to do it like this.


gem = matchwait("diamond", "star ruby", "emerald", "etc.")

if gem == "diamond"
do this mess
elsif gem == "star ruby"
do this mess
etc.
etc.
end


That's a crude recreation of what you're doing, but there are of course much more efficeint ways of doing what you want to do.

[Edited on 12-30-2005 by Tayre]

deck
12-30-2005, 01:55 AM
yea, I just wanted to use lich only for expanding the 32 match limit.. but it seems it's limited in what it will allow you to automate.

Drew2
12-30-2005, 02:14 AM
Uh, no, it's not. You just don't know how to utilize it.

Bobmuhthol
12-30-2005, 02:16 AM
You have Exists instead of Exits, btw.

VotedAfkScrippr
12-30-2005, 03:19 AM
you can also try putting the matches before the look
like:

match whatever
match whatever2
put look
matchwait

might help

deck
12-30-2005, 08:18 AM
Nah, see the way lich is handling the room names descriptions exits when running wizard scripts isn't exactly like, this is prolly to stop automated hunting scripts. but I wanted to know if there's a way around it without actually having to edit lich. this is what the following code is, and what it returns this will give you an idea of what I'm talking about. it's pausing everyhing until the room finishes looking. I think he programmed it this way to prevent script hunting, but yea.


start:

loot:
match sapphire sapphire
match sruby star ruby
match ruby ruby
match diamond diamond
match nomore Obvious Exits:
echo LOOKING
put look
echo SEARCHING
matchwait


nomore:
echo FIN!

Does this.


;w gem
--- Lich: gem.cmd active.
[gem.cmd: LOOKING]
[gem.cmd]^look

[Observatory Entrance]

Obvious exits: up

[gem.cmd: SEARCHING]


### at this point it hangs until you do a manual look, then it will acually search the room. does the same thing whne you move from one room to another using Put %direction%




that should give you an idea of what I'm trying to do.

VotedAfkScrippr
01-02-2006, 02:45 AM
okay this may or maynot be the problem, but here are some things for you to think about...

in your original post, you stated this:
match nomore Obvious Exists:
matchwait


nomore:
echo FIN

you misspelled Exists, should be exits, lower case in the game
match Obvious
that would actually be just fine.

also

the second post you made, you stated this:
match nomore Obvious Exits:


nomore:
echo FIN!

this time Exits has a uppercase E , i would leave it as Obvious, or Obvious exits:

that is the way it appears in the game, however i've never had any issues with this before.

something else to think about...

i don't use .cmd's to compile anything with. they seem confusing placing them in the right folders and transferring them between SF and wizard.
So i just use the built in create a script feature in the wizard, i would copy and paste all your code into the create a script feature in the wizard and see if that works better, and if not, there is a very nice feature for StormFront that allows you convert that script to run in stormfront, using the method of script writing i just mentioned.

never tried writing for lich, but if this doesn't work, you can easily make a very code brute script that will try to pick up anything, and it will work fast, using the waitfor command.

another thing, i never used the loot command, i always used search.
you can use matches really well with searching, instead of waiting till after you search and checking the room.
that will only work if your hunting.

Shaelun
01-04-2006, 11:40 PM
As usual, sorry for the delayed response, but as I've said before, I very rarely check these boards.

I've been under the impression Wizard 'match' strings are case sensitive... that's how Lich handles them -- 'Obvious Exits' will not match when you LOOK and see 'Obvious exits'. And the prior 'Obvious exists' won't either, of course. There's your hang right there (no gems, no match on the exits line).

I didn't build in any restrictions whatsoever (except for the 'safe' mode to restrict what a script can do for the user's safety). Frankly I'm kind of starting to wish I had; more people seem to be using it for AFK hunting than I ever would have expected... but whatever, freedom of choice = good. I guess.

I don't know how to explain this without getting too technical for most people to follow, so this is a short explanation of why that 'echo SEARCHING' doesn't come until after the room has already scrolls: when Lich runs a Wizard script, it executes a Lich 'fput' instead of 'put' so that it can compensate for stuff like type ahead errors, RT, all that mess of junk. To be able to compensate it has to hang around until it either sees something that it knows means the PUT command didn't "get through" (because of RT or whatever), or that it doesn't recognize as one of hte usual "You can't do that while stunned!" or whatever game responses. If it doesn't recognize it, the script thinks the command worked and moves on. Since Lich is built slightly differently than other scripting engines, this doesn't actually cause a problem -- that's a whole 'nother explanation though, so I'll leave it at that.

Frankly Lich exists because it was (mostly) fun for me to learn enough to make and to actually write both... the fact that it runs Wizard and StormFront scripts wasn't really meant to be an 'improvement'. It was honestly just me sitting here going, "hey, wouldn't it be cool if my program could run almost *any* script, not just its own scripts?" So... I wrote in Wizard and StormFront script support. If you have problems, just use the good ol' Wizard to run certain scripts (and make bug reports if you're positive the problem is with Lich; I didn't write the function in to let it be half-assed, ya know).

deck
01-09-2006, 03:02 AM
Nah Shaelun, we actually spoke under my alter ego, this was due to the way lich handles the Nextroom bug (after logs of debugging I found it)

With the wizard, nextroom could be used to pause a script until after it finishes loading the room name. The way lich buffers rooms and does matches, makes this use obsolete.

Wizard Script.
Example:
put look
match gem
matchwait

gem:
nextroom
put get gem
ect.

It would wait until after the rooms loaded to put get gem

Again, Props on lich, excellent prog, it fixed many Wizard bugs that were driving me mad.