View Full Version : Wanted:script for picking up disarmed weapons
deadly
11-28-2009, 11:21 AM
is knocked to the ground!
then would grab what ever weapon came before said message.
would be helpful in otf picking up my empaths runestaff that I lost yesterday and was lucky enough to get back.
Are you joking? That would be literally the easiest thing in the world to write but it means shit because of the RT you'll definitely be facing, you can choose to either ''get (whatever weapon is on the ground you need)'' or ''get my (other weapon you've brought incase ithzir picked up the disarmed one)''
You'll have 5-20 second to decide which '' .weap or .myweap '' to type.
deadly
11-28-2009, 12:02 PM
no no no
I MA so I want it to auto sheath and grab the weapon that was disarmed
this way I wont have to catch the weapon getting disarmed part. when I hunt i get screen scroll like crazy with the group I hunt with.
A good start would be capturing logs of what it looks like when you drop a weapon because of curse/get disarmed/get your arm bit off/whatever and post that up here.
SpiffyJr
11-28-2009, 01:12 PM
All I need is the "Your blah blah was knocked to the ground" and I could write yo u a script real quick.
deadly
11-28-2009, 10:50 PM
is knocked to the ground! is what it shows after the name of your weapon. was hoping it could be a wildcard before that message so it will sheath my current weapon and grab what ever weapon was dropped. this way if im hunting in a group with new people I wont have to add their weapon to the script.
BigWorm
11-28-2009, 10:55 PM
is knocked to the ground! is what it shows after the name of your weapon. was hoping it could be a wildcard before that message so it will sheath my current weapon and grab what ever weapon was dropped. this way if im hunting in a group with new people I wont have to add their weapon to the script.
Post a short log of you being disarmed.
deadly
11-28-2009, 11:03 PM
[Roll result: 118 (open d100: 94)]
******** swings his short sword at your dragon-carved runestaff and connects!
Your dragon-carved runestaff is knocked to the ground!
Roundtime: 5 sec.
Alorn15
11-28-2009, 11:17 PM
I'll take a stab:
status_tags
while(line = get) # Will run until killed
if(line =~ /exist="(\d+)".*?is knocked to the ground\!$/ # Will pick up any weapon disarmed. For only your own, change this line to the following: /^Your.*?exist="(\d+)".*?is knocked to the ground\!$/
waitrt?
fput "get ##{$1}"
# fput "stow ##{$1}" # Not sure if you want this?
end
end
Untested, and there are probably some regular expression optimizations to be done because I'm not the most knowledgeable on regex performance (it does after all match against every incoming line, so optimization is worth doing.)
Tillmen
11-29-2009, 01:03 AM
I would suggest having the script use status_tags and grab the ID of the weapon, to avoid problems with finding the the correct noun, or multiple weapons with the same noun.
Alorn15
11-29-2009, 01:23 AM
Hmm... edited... how does that look?
Smythe
11-29-2009, 01:38 AM
an if yer using Wizard, this
# getweapon.lic
# Use in disarming areas. Watches fer it, den immediately tries to get da weapon.
setpriority 1
loop {
respond("Entered disarm detect loop\.")
disarmed = (waitfor("is knocked to the ground\!").gsub!(/ is knocked to the ground\!/, '').gsub!(/Your /, '')).scan(/\w+/)
waitrt?
fput "stow right"
fput "get #{disarmed.last}"
result = waitfor "You pick up"
until result =~ /#{disarmed}/
end
clear
}
exit
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.