View Full Version : Running SF script with Bigshot
Dosselmeyer
06-30-2012, 02:33 PM
So I wrote a very simple SF script to remove my enhancives and a seperate one to wear them for post and pre hunting respectively.
1. I always see people do this to conserve charges, I've never really done it before but when I had to pay 11K BP to recharge something it got my attention. Does this really help the items last longer between charges?
2. I tried to get Bigshot to use these scripts by adding the command for the first one ".prehunt" to the "prehunt commands" section in the "hunting tab" in the bigshot GUI. But when Bigshot starts to run this happens:
[bigshot]>.prehunt
Please rephrase that command.
Can anyone give some guidance here on how to get this working?
thanks,
Dosselmeyer
Manamethis
06-30-2012, 02:38 PM
Save it as a lich script .lic instead of having it as a SF script
Bobmuhthol
06-30-2012, 02:50 PM
From what I remember, SF/Wizard won't allow you start a script unless the command came from the input line. Lich should (edit: confirming Manamethis' suggestion).
Dosselmeyer
06-30-2012, 02:58 PM
Just so I am clear, and sorry to be NOOB here, I just need to find the file where the SF script is saved, and change the extension to .lic? Or is the suggestion to simply rewrite the script in Ruby? (there's a reason I wrote it in SF).
thanks,
Dosselmeyer
Jonty
06-30-2012, 03:12 PM
Just change the file extension to .lic and save it in the same folder where your lich scripts are located.
subzero
06-30-2012, 04:13 PM
It may actually be a little more complicated than that. I'd suggest learning a little bit of ruby, even if it's just looking at scripts doing something similar and copying the necessary stuff over. The reason I say this is because, depending on how many items you're trying to wear, how long it takes to get where you're going, and what obstacles may be in your way, you could very well run into situations where you're running out to hunt with these items in-hand. This tends to be bad when you run into critters and obstacles.
Also, you don't put scripts in the pre-hunt commands. You put them in the hunting scripts section. This results in all the scripts firing at once, as well as running you out to hunt, which is why I suggest learning some Ruby so that you can handle things like that. I would make the enhancive script the first on the list and do this (add the bolded stuff):
pause_script "bigshot"
the rest of your script goes here
unpause_script "bigshot"
before_dying { unpause_script "bigshot" }
The before_dying part is just an added precaution in case something stupid happens.
Tillmen
06-30-2012, 04:40 PM
To get Lich to run a Wizard or Stormfront script, put it in your Lich script directory with a .wiz or .cmd file extention. Then, use it as if it was a Lich script.
Tillmen
06-30-2012, 04:46 PM
pause_script "bigshot"
the rest of your script goes here
unpause_script "bigshot"
before_dying { unpause_script "bigshot" }
before_dying should be at the top of the script. If something happens and the script dies before the before_dying line is reached, then it doesn't do anything.
Dosselmeyer
06-30-2012, 07:21 PM
Thanks for the suggestions folks. As for learning Ruby, I got fairly decent at writing scripts in SF by looking at other peoples and copying/manipulating and learning while doing so. When I look at a Ruby script it makes my brain steam, I mean it's pretty much gobbledeygook to look at and I cant make heads or tails out of it.
Tillmen can you point me in the right direction for a book and or website to learn this stuff?
thanks again,
Brian
DaCapn
06-30-2012, 07:43 PM
Thanks for the suggestions folks. As for learning Ruby, I got fairly decent at writing scripts in SF by looking at other peoples and copying/manipulating and learning while doing so. When I look at a Ruby script it makes my brain steam, I mean it's pretty much gobbledeygook to look at and I cant make heads or tails out of it.
Tillmen can you point me in the right direction for a book and or website to learn this stuff?
thanks again,
Brian
Do the same thing but start with more simple scripts. You strategy is correct. If, for example, you don't know how to iterate over an array in ruby, google "ruby iterate over an array." Just do what you might do if you have any other kind of problem. Coding is like any other task, really. I think assuming that it isn't causes people a lot of trouble.
Also, the 'lich scripting reference' KP article has a list of some of the most basic functions defined in lich. If you understand if/then/else and just look at that list, you have enough to get started.
Jymamon
06-30-2012, 07:57 PM
O'Reilly's Programming Ruby (http://shop.oreilly.com/product/9780974514055.do) is a good book if you like dead trees like I do.
For looking up particular class interfaces, I use Ruby-Doc (http://ruby-doc.org/) is the perfect online reference when you know what you want to do and just need to find the right Ruby construct/syntax for it.
For the lich-specific stuff, the KP article (http://www.krakiipedia.org/wiki/Lich_scripting_reference) DeCapn mentioned is the right place to start. (You'll eventually want to just read lich.rbw for your answers, but you can still do plenty of useful stuff from just the above.)
subzero
06-30-2012, 08:43 PM
before_dying should be at the top of the script. If something happens and the script dies before the before_dying line is reached, then it doesn't do anything.
That makes sense. Also explains why it doesn't seem to work sometimes. I blame the people I learned to script from and their faulty scripts!
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.