PDA

View Full Version : Some lich questions



crb
02-17-2010, 09:47 AM
So I finally managed to get lich installed and playing nicely, yay me.

I have some questions.

1. What is the difference between sloot and sloot2?

2. When I try to run sloot it doesn't work




>;sloot
--- Exception: uninitialized constant SpiffyLib
sloot:75:in `start_script'

I've downloaded from the repo all "spiffy" things, so I'm not sure what I'm missing.

3. Does spiffyloot pick up things on the ground (like a nice weapon dropped when I severed the beast's arm), or just things found when searching? If I kept it active always would it search other's kills?

4. Can I freely add ruby and other lich code to existing wizard scripts if I run them as lich scripts or does it have to be all one way or the other?

5. Difference between Optimus Prime and Megatron?

5.b. You know what'd make both of those better? More micromanagement. Being able to set a routine for each critter type you wish to hunt. Some critters are vulnerable to X attack, others Y attack. Also, setting critter priority, so you can kill the most dangerous thing first, and finally setting critter status priority, picking the critter status priority you want to deal with first for the critter type you're dealing with first. Not just defaulting to nil, since for flying critters a flying status indicates more danger. Though I suppose you could hard code it like flying,nil,stunned,prone,webbed,bound,sleeping

Or, to explain it in a story problem. If I'm hunting OTF I want to always kill griffins first, always kill flying griffins before other griffins, and I want to use web bolt as my first attack, always, on griffins. Whereas I never want to use web bolt on other critters.

The last thing I can think of is tasks. If there was a way to indicate the script to only hunt one critter type and ignore all others for one hunt only without losing all the other settings.

Idea for spiffyloot: let the box storage variable be an array, letting someone to put in disk,backpack,cloak as their setting then trying those containers in order (if one gets filled move down the list).

Drew
02-17-2010, 09:50 AM
Do you have slib? I think that is needed for the spiffy scripts. It seems like megatron is the hunter most people use now. There's definitely a way to use wizard script code in lich scripts, but you'll have to wait for someone more qualified than me to explain it.

pabstblueribbon
02-17-2010, 09:54 AM
Well, pre-Tillmen lich you could run SF scripts through lich, this is no longer possible in the way it was done previously. There is however, a converter, that will turn your wiz scripts into lich scripts called wiz_to_lich.lic I believe.

There might be bugs, I used it in the beginning, being a solid SF scripter but ever since I learned lich/ruby I haven't looked back. Its been a year or so since I've even messed with it and I doubt its had much attention as far as bugs go.

pabstblueribbon
02-17-2010, 09:57 AM
Oh and any spiffy questions should be directed to lichnet. I know a few people that use that looting script but I know he was in the middle of a rewrite of his lib (Which is what defines his commonly used functions. For the record I really hate libs) when he quit, so that may explain the incompatibilities.

I really should just upload my looting script.

Anser for #3, I dont know if its implemented in sloot, but you can easily get any items in a room with GameObj. Its what I do and I just pass it through a filter of wanted or junk items.

Buckwheet
02-17-2010, 10:46 AM
Make sure you trust slib and sloot then run ;sloot setup.

crb
02-17-2010, 11:13 AM
nope



>;trust slib
--- Lich: 'slib' is now a trusted script.
;trust sloot
--- Lich: 'sloot' is now a trusted script.
;sloot
You feel more refreshed.
>--- Exception: uninitialized constant SpiffyLib
sloot:75:in `start_script'
;repo download all
--- Lich: repository active.
[repository: connecting to the server...]
[repository: error: could not find that script on the server]
--- Lich: repository has exited.
>;sloot setup
--- Exception: uninitialized constant SpiffyLib
sloot:75:in `start

pabstblueribbon
02-17-2010, 11:22 AM
If have tried to run slib and then trust it, it won't work. It will think it has run as untrusted but wont actually do anything and then won't run after you've trusted it. You need to log out/kill lich.

Stupid libs.

Tillmen
02-17-2010, 03:39 PM
If have tried to run slib and then trust it, it won't work. It will think it has run as untrusted but wont actually do anything and then won't run after you've trusted it. You need to log out/kill lich.

Stupid libs.

When slib is run untrusted, its definitions are only available to untrusted scripts, but it also sets a global variable that indicates it has been loaded. The sloot sees the global variable and doesn't try to run slib again. You don't have to restart after trusting slib, just run slib yourself.

Tillmen
02-17-2010, 03:45 PM
Well, pre-Tillmen lich you could run SF scripts through lich, this is no longer possible in the way it was done previously. There is however, a converter, that will turn your wiz scripts into lich scripts called wiz_to_lich.lic I believe.

There might be bugs, I used it in the beginning, being a solid SF scripter but ever since I learned lich/ruby I haven't looked back. Its been a year or so since I've even messed with it and I doubt its had much attention as far as bugs go.

Lich will run, or at least attempt to run, Wizard and Stormfront scripts, but it won't look in your Wizard/Stormfront script directory. If it's in Wizard/Stormfront format, it should have a .wiz or .cmd file extension and be in your Lich script directory, and you can start it like a Lich script.

Tillmen
02-17-2010, 03:52 PM
4. Can I freely add ruby and other lich code to existing wizard scripts if I run them as lich scripts or does it have to be all one way or the other?

To add Lich code to a Wizard script, you have to wrap the code in LICH { }, which might look something like this:

waitfor at you!
LICH { wait_until { checkmana(6) } }
put incant 906

I don't think this is a good way to do it. It's only there to attempt to be backwards compatible with old scripts. You're better off using wiz_to_lich.lic to convert the script, and then add the Lich code, which would look more like this:

waitfor "at you!"
wait_until { checkmana(6) }
put "incant 906"

When Lich runs a Wizard or Stormfront script, it's doing basically the same conversion that wiz_to_lich.lic does. It just doesn't save the results, and has to do the conversion every time you run the script.

pabstblueribbon
02-17-2010, 04:08 PM
oh.

Forgot about LICH { }

I never used it with much success anyways.

And.. did it always have running sf and wiz scripts natively built in? I don't recall it working like that when I was wanting to use it that way a long time ago... You put that functionality in there just to spite me didnt you!

Drew
02-17-2010, 04:15 PM
Shaelun's lich could run SF scripts pretty darn early on.

crb
02-17-2010, 04:21 PM
So why two sloots? What is the difference?

pabstblueribbon
02-17-2010, 04:22 PM
Shaelun's lich could run SF scripts pretty darn early on.

Yeah. I said that.. when it switched to Tillmens at some point it could not which is why wiz_to_lich.lic was made.

Drew
02-17-2010, 04:25 PM
I read every 4th sentence.

pabstblueribbon
02-17-2010, 04:28 PM
So why two sloots? What is the difference?

Download Notepad ++ and open them up with the ruby language setting.

And compare!

Sloot2 is probably a rewrite. Same with the two libs.

Anne
02-17-2010, 04:38 PM
So why two sloots? What is the difference?

There are asthetic differences between sloot and sloot2, as well as some internal things that I think Spiffy was working on. In theory they should work the same.

However, in practice, for some reason sloot won't loot all dead npcs for me. Sloot2 does it just fine, but then sloot2 won't sell. So, I use sloot2 and just handle selling with my own script.

Tillmen
02-17-2010, 04:40 PM
And.. did it always have running sf and wiz scripts natively built in? I don't recall it working like that when I was wanting to use it that way a long time ago... You put that functionality in there just to spite me didnt you!

I didn't have it 3.58, the first pure Ruby version. It was added back in in 3.92, but was buggy. Slowly, the bugs were fixed.

doveclaw
02-24-2010, 10:01 AM
5. Difference between Optimus Prime and Megatron?

5.b. You know what'd make both of those better? More micromanagement. Being able to set a routine for each critter type you wish to hunt. Some critters are vulnerable to X attack, others Y attack. Also, setting critter priority, so you can kill the most dangerous thing first, and finally setting critter status priority, picking the critter status priority you want to deal with first for the critter type you're dealing with first. Not just defaulting to nil, since for flying critters a flying status indicates more danger. Though I suppose you could hard code it like flying,nil,stunned,prone,webbed,bound,sleeping

Or, to explain it in a story problem. If I'm hunting OTF I want to always kill griffins first, always kill flying griffins before other griffins, and I want to use web bolt as my first attack, always, on griffins. Whereas I never want to use web bolt on other critters.


Optimus Prime was originally created by Azanoth who no longer plays. It seemed like there were more and more feature requests that people wanted, but nobody was interested in doing it. Basically, Megatron is Optimus Prime with feature enhancements that I wanted or added for other people.

On a side note, I was working on a MA version of Megatron, I made a little progress early on, but honestly I've had a hard time finding motivation since I don't MA. Basically I have a "beta" version, that I eventually removed from repo, that can follow, but logic for handling round times and such still needs to be added.

For the most part I've added all the things that I want and most of what other people want (at least the vocal ones), as long as it was applicable to a hunting script meant to be "generalized", so development has slowed down a bit lately.

crb
02-24-2010, 12:33 PM
What is the purpose of the NPC status regex you added in the advance tab in the settings?

doveclaw
02-24-2010, 01:06 PM
What is the purpose of the NPC status regex you added in the advance tab in the settings?

There is a regex that is used in which when met Megatron will no longer wait for the creature to strike first and will keep attacking until the creature is either dead or no longer meets the regex.

So basically, if a creature is stunned, it will keep attacking until it is either not stunned or dead.

The default setting in Megatron was thus, stunned|kneeling|sitting|lying|prone, can't remember if that's different from Optimus. The advantage is if you want to add other status's that lich supports such as calm/webbed/etc.

You changed the default setting to "flying|webbed|stunned|kneeling|sitting|lying|prone" which is fine for the most part, except that flying is probably a bad idea since the creature is probably perfectly healthy and willing to strike back.

crb
02-24-2010, 05:28 PM
See, I thought it was a regex to decide the order in which a critter should be dispatched.

The only bug I've still got with the code is sometimes it doesn't break from the attack routine when the target dies, it goes on and attacks target 2 with the remainder of the routine, instead of starting over.

Ideally if the target is no longer available because it ran or died, the script would break from the routine and reevaluate the room to pick the next target.


Though I'm not 100% sure if the 516 bug is fixed, in my testing it seems to work but I haven't tested it to what I would consider a thorough level.

doveclaw
03-04-2010, 08:39 AM
See, I thought it was a regex to decide the order in which a critter should be dispatched.

The only bug I've still got with the code is sometimes it doesn't break from the attack routine when the target dies, it goes on and attacks target 2 with the remainder of the routine, instead of starting over.



Targeting is handled completely by find_target, I'm guessing the changes will need to be made there. find_target is initially called for every iteration of the while loop immediately following wander, if there are no targets it exits and runs wander. If the target were to die in the middle of the attack_routine_commands loop then break if npc.status == 'dead' || npc.nil? || npc == false || percentmana < @rest_at_mana is triggered. find_target is called immediately before this, and *this* is most likely where your problem is. If the target dies on the first attack in the sequence, your code is grabbing the next target and going on to the next attack in the old sequence. I guess you'll want to remove that second find_target before the if statement above, not positive whether that will cause more problems for you or not since I'm not familiar with all your changes.