View Full Version : Waitfor? Match?
Intel
03-12-2013, 07:57 AM
Here is what I started with, yet failed to succeed with. I am trying to hand my weapon off when it needs blessed. My script does nothing in response. Any ideas?
start:
waitfor "You swing a black vultite broadsword"
match "start", "AS:"
match "bless", "Roundtime:"
matchwait
bless:
pause_script "bigshot"
pause
waitrt?
fput "give characterx"
waitfor "characterx offers you"
fput "accept"
unpause_script "bigshot"
goto "start"
-----------------------------
this is the text I was going off of:
You swing a black vultite broadsword at a goblin!
AS: +55 vs DS: +15 with AvD: +36 + d100 roll: +51 = +127
... and hit for 11 points of damage!
Jarring blow to the goblin's back.
Roundtime: 5 sec.
JR>at ghoul
You swing the vultite broadsword at the ghoul, but it has no effect!
Roundtime: 5 sec.
Intel
03-12-2013, 08:01 AM
p.s. I didn't use a 'waitfor bless runs out' because I tried that too, and it didn't always catch.
Gilralyn
03-12-2013, 08:18 AM
I haven't tested this, but I'd probably try doing it this way.
while line=get
if line =~ /^You swing .* but it has no effect\!$/
pause_script "bigshot" if running?('bigshot')
dothistimeout "stance defensive", 3, /^You are now in defensive stance/
dothistimeout "give Character", 3, /^You offer/
elsif line =~ /^Character offers you/
dothistimeout "accept", 3, /^You accept/
unpause_script 'bigshot' if running?('bigshot')
end
end
Intel
03-12-2013, 08:53 AM
Yea I was going to use "but it has no effect" but I am using bigshot with 3 characters and 2 are swinging and I don't want both of them to respond to that. I made some modifications pausing other scripts when my bless wears off the weapon.. so I am going to go with that for now. But I really wish I knew how to utilize a script like the one I tried.
Thanks all.
Catts
03-12-2013, 08:58 AM
nvm
Gilralyn
03-12-2013, 01:50 PM
Yea I was going to use "but it has no effect" but I am using bigshot with 3 characters and 2 are swinging and I don't want both of them to respond to that.
The code snippet I put in there will only match for the character swinging the weapon. It shouldn't trigger a response from your other characters. However, the script you run on your cleric/voln blesser will need to remember who hands him the weapon so he can give it back to the appropriate character.
Tillmen
03-13-2013, 05:09 AM
Maybe I'm missing something, but my cleric blesses all sorts of things without holding them. If the cleric is going to be there the whole time, it might be easier to have the cleric run this script and let the swingers ignore the problem.
loop {
if get =~ /^([A-Z][a-z]+) swings .* no effect!$/
cast 304, $1
end
}
or if the cleric needs to bless his own weapon too:
loop {
if get =~ /^([A-Z][a-z]+) swings? .* no effect!$/
if $1 == 'You'
cast 304
else
cast 304, $1
end
end
}
Also, if the cleric is hunting with spells, you don't have to worry about pausing bigshot to use this script. Bigshot uses the same cast method to cast spells that this script does, and it has a built in queue to make the scripts play nice with each other.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.