View Full Version : Lich-Help Script hanging
100% Wool
11-19-2006, 10:38 AM
I started making a rat killing script and was wondering why it was hanging at this point. Anyone able to help me?
MOVE:
pause "1s"
until walk
nil # Do nothing, just cycle until the 'walk' command returns 'true'
end
if checkpcs
goto "MOVE"
end
if checknpcs "rat"
goto "RAT"
end
RATEWAIT:
pause "5s"
goto RAT
RAT:
put "kill rat"
match "MOVE", "you referring to"
match "MOVE", "You currently have no valid target"
match "DEAD", "dies"
match "DEAD", "dead"
match "DEAD", "The giant rat collapses to the ground, emits a final squeal, and dies."
match "DEAD" "A little bit"
match "RAT", "only type ahead"
match "RAT", "Please wait"
match "RAT", "scampers in!"
match "RAT", "Wait"
match "MOVE", "I could not find"
match "RATWAIT", "Roundtime:"
match "RATWAIT", "Roundtime: 5 sec."
matchwait
DEAD:
put "skin rat"
put "loot"
fetchloot
goto "CHECKEXP"
Artha
11-19-2006, 10:41 AM
Your loop is called RATEWAIT, but is referenced as RATWAIT.
100% Wool
11-19-2006, 11:16 AM
Thanks Artha.....
100% Wool
11-19-2006, 02:37 PM
One more thing. I just started using multimove and for some reason it isn't working properly. Am I doing this right?
----------------------
put "look"
match "MOVE", "Dim light filters down from the rusty grate"
match "MOVE", "[Abandoned Sewer]"
match "PREGOHUNT", "The old well is made of flat stones built up"
matchwait
PREGOHUNT:
put "stance offensive"
multimove 's', 'e', 'e', 'e', 'n', 'e', 'e', 's', 's', 'go open', 'e', 'go hole', 'go open', 'e', 'n' , 'go grate'
goto "MOVE"
-------------------------
Basically what I want it to do is when I'm at the well to go to the sewers by going to the PREGOHUNT table.
Also I thought the misspell in the loop would fix it but my script is still hanging after I attack a rat once
Shaelun
11-21-2006, 01:00 PM
I'm taking a break from studying for an exam and don't have a bunch of time, so I haven't gone over it thoroughly, but your first script shouldn't be behaving that way...
Since I don't force users to update and I'm fixing bugs all the time, I really need to know what version of the program somebody is using -- run the updatecheck.lic script and update to v3.44 if you need to.
Let me know whether it fixes it or not so I know if it's a bug that I need to fix or what.
As for the second one, Lich supports regular expressions in its MATCHes, and you're unknowingly making use of that: in regular expressions, the phrase "[ABCD]" will match any line that contains any one of "A", "B", "C", or "D" -- so basically you're saying "match any line containing any one of the following letters: [Abandoned Sewer]."
Shaelun
11-21-2006, 06:44 PM
Yeah, that was excessively perplexing at first. Notice the second line:
match "DEAD", "The giant rat collapses to the ground, emits a final squeal, and dies."
match "DEAD" "A little bit"
match "RAT", "only type ahead"
There's no comma between the label and the match-string, and unfortunately Lich didn't give you a warning because it by default concatenates adjacent strings together (in non-geek-speak, it made "DEAD" and "A little bit" into a single string as though you had a `+' inbetween them), which is a perfectly legal line of code. It hung because it was waiting for "DEADA little bit" -- it works fine w/ the comma in there.
That's a really, really easy to make mistake... unfortunately I'm not sure how to fix it without breaking backward compatibility. Well, I'll figure something out.
Enjoy.
100% Wool
11-22-2006, 04:07 PM
Thanks for the reply Shaelun
Shaelun
11-22-2006, 05:52 PM
Sure; sometimes even bugs are better than the alternatives.
Looking for a link to a page where I can get the software and possibly see a FAQ?
Shaelun
12-04-2006, 03:35 AM
http://lich.gs4groups.com
Hate to be an iche but I dont suppose theres a listing anywhere of common syntax and functions as it pertains to gemstone without actually having to learn ruby? Would anyone mind posting an example of a common script that uses a few loops? Like im looking at that rat script below is checkpcs an actual function in a C sense or is it just declared somewhere lower in the script?
Actually upon further digging your links page has more than enough information.
Thanks Shaelun
Shaelun
12-06-2006, 09:12 AM
You're welcome; if you missed them, there's also a number of text files in whatever directory you installed the program to (default "C:\Program Files\Lich").
Enjoy.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.