PDA

View Full Version : Maintain eblade on runestaff/weapons?



hijunkie
12-07-2014, 10:35 AM
Trying to find a way to get eblade-gsf (oldrepo script, closest to working script I found) to operate correctly. It works up until the point I lose the scintillating light and look at the runestaff where it sees nothing unusual. I've been looking through ruby/lich tutorials... but I don't seem to have the base knowledge to figure out the kinks. I could just hard code everything, but that doesn't really benefit everyone.

If there's a better script out there, or if anyone is willing to take on the challenge. It would be much appreciated.

Thanks again,
Ril :up:

Soulance
12-07-2014, 04:45 PM
That was one that I tried out but it didn't work all the time like you found out. Seems like it works for each "session" I log on, but loses track when logged off. Then I have to wait until the eblade drops to run it again. I'm sure someone could write a fairly easy script for it, but that someone is definitely not me.

subzero
12-08-2014, 12:50 AM
I can't test it, but it looks like I left out a little variable that sort of should be there... (my version has all the leet stuff!)

After line 52, add: dropped = false


cast_411 = proc {
if Spell[411].known? && Spell[411].affordable?
fput "release" unless prepped? !~ /none|elemental blade/i
multifput "prep 411", "cast #{@weap}"
result = matchwait /leaps from your hand|armor prevents|fumble|at what|could not find|misfires|nothing happens|^You already have a spell/i
if result =~ /leaps/
if running? "azbounty"
unpause_script "azbounty"
end
if running? "bigshot"
unpause_script "bigshot"
end
dropped = false
elsif result =~ /prevents|fumble|misfires|nothing/
waitcastrt?
eblade.call
elsif result =~ /have a spell/
fput "release" unless prepped? !~ /none|elemental blade/i
eblade.call
elsif result =~ /what|not find/
echo "Weapon not found. Script should find weapon... slacker"
nil
end
end
}

After line 92, add: dropped = true


if script.vars.empty?
eblade.call
while line = get
if line =~ /The scintillating ([a-z]+) light surrounding the .* fades away/
dropped = true
waitrt?
fput "stance defensive"
waitcastrt?
eblade.call
end
end


Let me know how that works.

subzero
12-08-2014, 01:02 AM
I'm not sure how ensorcell affected things, so you might need to account for that as well:


if dropped != true
fput "look at my #{@weap}"
x = matchwait /I could not find|is surrounded by a scintillating|You see nothing unusual|ethereal necrotic film/
if x =~ /I could not find/
echo "You don't seem to have a weapon to eblade, foo!"
exit
elsif x =~ /scintillating/
nil
elsif x =~ /nothing unusual|ethereal necrotic film/
cast_411.call
end
else cast_411.call
end

if running? "azbounty"
unpause_script "azbounty"
end
if running? "bigshot"
unpause_script "bigshot"
end
}

hijunkie
12-08-2014, 10:31 PM
Thanks so much! I really appreciate the effort you took on that. Works like a charm.

-Ril

DaCapn
12-08-2014, 10:44 PM
May want to add permanent ensorcell:
"A strange necrotic haze radiates from the staff."

subzero
12-08-2014, 11:10 PM
Thanks so much! I really appreciate the effort you took on that. Works like a charm.

-Ril

No problem. Glad it's working for ya now.


May want to add permanent ensorcell:
"A strange necrotic haze radiates from the staff."

Probably a good idea.

If anyone wants to update the script on the repo (nothing worse than having 20 of the same fucking script people edit and upload), feel free. I'm sure if you ask Tillmang nicely he can make that happen.

Tillmen
12-09-2014, 02:29 AM
The script isn't on the new repository yet, so no extra work needed to upload it.

subzero
12-09-2014, 05:05 AM
Guess that makes things a little easier then!

Samire
07-15-2015, 06:42 PM
I know this is an old thread, but I, too, am looking to utilize this script. The script uploaded to the repo appears to still need the updates proposed above, but my issue is different and probably straightforward for anyone familiar with writing scripts for lich.

>glance
You glance down to see a crystal-set rosewood runestaff in your right hand and nothing in your left hand.
>;eblade-gsf
--- Lich: eblade-gsf active.
[eblade-gsf]>look at my 90565587
I could not find what you were referring to.
>
[eblade-gsf: You don't seem to have a weapon to eblade, foo!]
--- Lich: eblade-gsf has exited.


It looks like the id for weapon is set via:

@weap = GameObj.right_hand.id

and then the look command is:

fput "look at my #{@weap}"


Anyone know why this isn't working for me?

Thanks

DaCapn
07-15-2015, 11:56 PM
IDs are preceded by "#". So "look at my 90565587" is attempting to look at a noun called "90565587" where as "look at my #90565587" would reference the object by ID. You'll note that #{} indicates a block which is inserted into a string. The "#" character is not a part of the string itself. If you want one to be in the string, you'd need to add another hash symbol. That is, "look at ##{id}". If you look at any script that does something with an object referencing an ID (correctly), this is what you'd see. Which would be a good way to figure out how to solve problems.

Samire
07-16-2015, 12:48 AM
Thank you for your response. I did as you suggested and both updated the code and confirmed the suggestion within another script. The line now looks like this:

fput "look at my ##{@weap}"

However, the result is the same.

>glance
You glance down to see a crystal-set rosewood runestaff in your right hand and nothing in your left hand.
>;eblade-gsf
--- Lich: eblade-gsf active.
[eblade-gsf]>look at my #91642465
I could not find what you were referring to.
>
[eblade-gsf: You don't seem to have a weapon to eblade, foo!]
--- Lich: eblade-gsf has exited.


I appreciate your assistance.

Tgo01
07-16-2015, 01:11 AM
Don't use "my" when using IDs.

Samire
07-16-2015, 06:14 PM
That fixed it!

Thank you both.