PDA

View Full Version : Wizard scripter looking at Lich



Stayfair
06-02-2007, 09:27 AM
I've been scripting with the Wizard for a long while...wouldn't consider myself an expert but I've been able to write scripts for just about anything I've had a need to...

I'm curious about Lich, if for no other reason than it's just "bigger and better" than what I'm doing now. My problem is starting from scratch with something that seems infinitely more complex than the stuff I write for the Wizard.

Is there a "guide" somewhere for creating GSIV scripts for Lich? Or some very, very basic Lich scripts I could look at to try and get a feel for how they are written? I guess scripting 101 for Lich and GSIV....

I appreciate any help you may throw my way.

Couple other questions that come to mind...

Can you run more than one script simultaneously with Lich?
Can one script call another script and launch it?
Does the PC processor run at 100% with Lich like it does with Wizard scripts?

Caede
06-02-2007, 10:16 AM
Is there a "guide" somewhere for creating GSIV scripts for Lich? Or some very, very basic Lich scripts I could look at to try and get a feel for how they are written? I guess scripting 101 for Lich and GSIV....

There really isn't a guide per se, but there is a large volume of scripts that come with Lich as well as a script repository that's updated with new things from time to time. There are artisan scripts, travel scripts, scripts for keeping spells up, etc. Lots of examples. There are also some examples posted on this forum by myself and others.


Can you run more than one script simultaneously with Lich?
Yep. You can run as many as you want, and they can interact with each other.


Can one script call another script and launch it?
Yep.


Does the PC processor run at 100% with Lich like it does with Wizard scripts?
No -- Lich has some reasonable resource management. I only notice issues when I run things like MTP (Merzbow's Taxi Partnership) in Wizard mode. Even then, that's not CPU usage -- it seems to load into memory and suck up a few meg which never gets released. That's neither here nor there, though, as there really isn't a huge impact and I keep running long after I've run MTP 20 times in one session. (babble)


Just so you know, you can take basically any SF or Wizard script and run it via Lich like this:


;w <scriptname> <any argument you might have>


So initially, you can start running your Wizard scripts from inside of Lich. You can then start modifying those scripts, if you want, to make use of the additional Lich functionality.

If you choose to create Lich scripts from scratch, you'll notice that Shaelun basically re-implimented Wizard scripting so that things are very familiar. When you get more used to Lich and Ruby, you can start branching out to make use of the rest of the language.

Seriously, best idea -- download it, look at the scripts it comes with and look at the repository. Check here in the scripting forum for a few examples, too.

Enjoy.

--
Caede

Shaelun
06-02-2007, 11:38 AM
Sometimes I think you're better at answering questions about Lich than I am, Caede :p

If you want to read a bit more, you can find some links to Ruby tutorials (Ruby is the language Lich uses) -- both very simple and very complex -- here: http://lich.sudolife.com/links.php

Stayfair
06-02-2007, 01:07 PM
Thanks for the thoughtful response....it's time to take a closer look.

I'm sure I'll post back soon.

Stayfair
06-03-2007, 08:20 AM
I copied a couple of my scripts into the Lich scripting folder and tried to execute them in game with the ;w <scriptname> command but the results weren't good...they seem to execute the first line in the script and nothing else.

One script was a simple one I use to hand stuff from one character to another 'locker' character, and the other was hunting script I use for my mage. But again, both just executed the first line of the script and no more.

Any quick suggestions?

I haven't had time yet to look deeply at the Lich scripts so this is just a first reaction question...

Stayfair
06-03-2007, 09:08 AM
How do you set a container for Lich. I tried running ;sell but it didn't have a container to look into.

I need to do more reading;)

Drew
06-03-2007, 09:26 AM
I've never found where to set a container for my sheath and I've been using Lich for at least a year now I think.

Of course I haven't looked that hard.

Stayfair
06-03-2007, 11:48 AM
It seems like it's in ;settings, but I messed something up playing with that and now I can't view them anymore...here's what happened.

;settings
--- Lich: settings active.
Syntax is: ;settings (action) (setting_name) (whatever you're adding/deleting)

Valid actions are: add, remove/delete/rem/del, change, view
To view all your settings, view 'all'

Example1 (this would change your 'lootsack' setting to 'backpack'):
;settings change lootsack backpack

Example2 (this would add 'coffer', 'trunk' and 'ruby' to your 'treasure' setting):
;settings add treasure coffer, trunk, ruby

Example3 (this would remove 'ruby' from your treasure setting and leave the rest):
;settings remove treasure ruby


Then I did this....

;all
--- Lich: all_scripts_run_safe active.
--- Lich: all_scripts_run_safe finished.
;settings all
--- Lich: settings active.
--- Error: settings: Insecure operation - exists?
--- Lich: settings has exited.
;set
--- Lich: settings active.
--- Error: settings: Insecure operation - exists?
--- Lich: settings has exited.
;settings
--- Lich: settings active.
--- Error: settings: Insecure operation - exists?
--- Lich: settings has exited.

Currently trying to work my way out of this....it seems <;settings change lootsack cloak> is what I need to do but ;settings isn't working for me like it did initially at the moment.

Stayfair
06-03-2007, 11:54 AM
I managed to get ;settings to work again and set my lich.lootsack as my cloak by quitting the WFE and logging in again.

Stayfair
06-03-2007, 11:59 AM
Ahh... ;settings view all

This will show you your sheath setting Drew.

Stayfair
06-03-2007, 07:22 PM
Just so you know, you can take basically any SF or Wizard script and run it via Lich like this:


;w <scriptname> <any argument you might have>


So initially, you can start running your Wizard scripts from inside of Lich. You can then start modifying those scripts, if you want, to make use of the additional Lich functionality.
--
Caede

What kind of modifications do my Wizard scripts need to be run in Lich?

My sellall.cmd script begins by checking my location and then moving from wherever I am to the gemshop, then pawnshop, then bank, then back to my table. When I try running it from ;w sellall it performs my first look and hangs.

Slowly but slowly;)

Stayfair
06-03-2007, 07:34 PM
On another note, today I've had difficulty logging in multiple characters...I use psinet and lich...it hangs right at the start.

Stayfair
06-05-2007, 06:46 AM
No thoughts on getting Wizard scripts to run in Lich using ;w?

It says 100% compatibility but I must be missing something because none of mine run in Lich....any thoughts? Just from looking at Lich scripts and writing Wizard scripts it seems odd that they would run...

I'm sure I have to modify them somehow...or do something with them that I'm not doing.

Caede
06-05-2007, 08:33 AM
I'd have to look at the script to see what might be breaking.

I've run quite a few scripts that were Wizard-only originally through the ;w method on both SF and Wizard, and haven't had much of a problem. I know the Wizard-version of SBC doesn't work no matter what, but other than that I've never had a problem. So, I really couldn't know until I see.

Regarding the hanging -- I also use two accounts at one time with both Lich and Psinet. There were some issues with Lichnet hanging on startup, and removing it from startup had been clearning up some of those problems. Try removing Lichnet from your favorites like this:



;favs del all lichnet


Feel free to send me a message on AIM if you need some help.

--
Caede

Drew
06-05-2007, 03:02 PM
No thoughts on getting Wizard scripts to run in Lich using ;w?

It says 100% compatibility but I must be missing something because none of mine run in Lich....any thoughts? Just from looking at Lich scripts and writing Wizard scripts it seems odd that they would run...

I'm sure I have to modify them somehow...or do something with them that I'm not doing.


Kind of a simple question, but have you moved them into the lich script directory?



Only thing I use ;wiz for is to run my icemule to landing script, I took out all the pauses since my ranger has a lot of survivial, if he falls lich will stand him back up. It was a heck of a lot easier than writing a script that did a match on every ice patch or something similar.

Deathravin
06-05-2007, 04:51 PM
Well I have pretty grandiose plans for a ranged rogue locksmith.

I don't script for it to play my game for me, but more for the aspect that I made something work. I like to write code, and watch it work the exact way I intended for it to work, and to tweak it, modify it, and rip my hair out trying to find out why it doesn't work...
Besides, it's a good reason to learn ruby.


At any rate, that's a good idea - making a script with wizard scripting, then adding ruby to the parts wizard can't do... and slowly start converting the script into ruby. That's a pretty good idea...

Since my script is so wide-sweeping (My end goal is a fully integrated script that will hunt, pick boxes, do guild reps for lockpick mastery, and everything in between) - I'm starting off with one small part (picking a disarmed box), then getting a bit tougher (picking a disarmed box with the right lockpick), then a bit tougher (picking a disarmed box with the right lockpick after checking if there is a way to get a guild rep off this box)... etc - and hopefully my coding just get faster and more consolidated as I go on...

Shaelun
06-09-2007, 09:35 PM
Well, first things first: it says near 100% compatibility. Second, tiny little things that work in Wizard scripts may be quirky with Lich. For example, I've seen people use "waitfor >" in Wizard scripts -- that will probably hang forever when Lich runs it, because Lich scripts don't see exactly what's in your game window. Lich reconstructs it almost perfectly, but the operative word here is almost. If Lich is behaving undesirably, just run the script with Wizard.

Celephais
06-10-2007, 01:54 PM
wouldn't "Waitfor &gt;" work in lich then? (or \&gt\; if ampersand and semicolon need to be escaped)

Shaelun
06-15-2007, 07:37 PM
wouldn't "Waitfor &gt;" work in lich then? (or \&gt\; if ampersand and semicolon need to be escaped)

No. Simutronics never actually sends that character to the game client. Wizard writes it to the window itself anytime it receives a status-prompt-update-tag, I think, but I wouldn't stake my life on that detail or anything.

Lich scripts see what the game sends, not what the game client displays. They're clueless about what your game window is showing. Which is why Lich scripts can get at the raw data and whatnot.


(was the answer delayed enough for you, LOL? Dunno how I didn't see this sooner...)

Celephais
06-16-2007, 12:56 AM
In the case of stormfront, the &gt; is actually sent in the stream... it's <promt time=whatever>[promttodisplay... &gt; in most cases]</promt>

In the case of a wizard stream would waitfor GSLWhatever work? can you waitfor GSL commands in Lich?

Shaelun
06-16-2007, 11:18 AM
The issue isn't that you can't reproduce the functionality, and I remember actually fixing that incompatibility... as I recall, I never tested that it actually works though. It was really just an example meant to illustrate that it doesn't say it'll run any script (nor will it). I couldn't think of a better way of explaining.


To answer you, yes, you can. Just not by default -- you'd have to enable receiving that data in your script, which is of course off by default. There are much faster and easier ways of accomplishing the same thing though.