Alstott
02-17-2012, 01:36 AM
so i suck at scripting, whatever. anyone know of a script that can pick up armor and disk it? -thanks
DaCapn
02-17-2012, 02:48 AM
fput "_drag ##{GameObj.loot.find {|obj| obj.type =~ /armor/ }.id} ##{GameObj.loot.find { |obj| obj.name =~ /#{Char.name} disk/i}.id}"
If (when) it doesn't work for your every need consider putting some work in and learning a little bit about ruby and built-in definitions for lich. You weren't born knowing how to tie your shoes. But these days, I bet you're pretty good at it.
Alstott
02-17-2012, 12:04 PM
Frankly, between two full time nursing jobs and full time school, learning Ruby isn't exactly a priority so I was hoping for some help. I appreciate yours and I completely understand where you're coming from, just don't have a lot of time on my hands.
DaCapn
02-18-2012, 01:10 PM
This is a definition in my library that I use to collect loot. You're going to have to modify it, but you won't have to type more than 10 characters.
$metal_list = ["Alexandrite","Bronze","Coraesine","Drakar","Eahnor","Eonake","Faenor","Glaes","Golvern","Gornar","Imflass","Invar","Iron","Ironwood","Kelyn","Krodera","Mithglin","Mithril","Obsidian","Ora","Razern","Rhimar","Rolaren","Urglaes","Urnon","Vaalorn","Veil","Veniom","Vultite","Zorchar"]
$wood_list = ["Carmiln","Deringo","Faewood","Fireleaf","Glowbark","Hoarbeam","Ilthorn","Ipantor","Kakore","Lor","Mesille","Modwir","Mossbark","Orase","Rowan","Ruic","Sephwir","Villswood","Witchwood","Wyrwood","Yew"]
$crap_adjectives = ["slashed","ripped","tattered","moldy","rotted","moth-eaten"]
$crap_list = ["wolifrew lichen"]
$library_deflist['loot_room'] = ['utility','Gather all loot from the room, skipping crap']
def loot_room
# Build array of good loot in the room
lootlist=[]
GameObj.loot.each { |obj|
goodloot = false
# Never loot
if obj.type =~ /food|junk|ammo|cursed/ then goodloot = false
# Always loot
elsif obj.type =~ /reagent|note|box|gem|magic|scroll|wand|skin|instru ment|jar|jewelry/ then goodloot = true
# Exceptions
elsif obj.type =~ /armor|weapon/
$metal_list.each { |mat| if obj.name =~ /#{mat}/i then goodloot = true; end }
$wood_list.each { |mat| if obj.name =~ /#{mat}/i then goodloot = true; end }
elsif obj.type =~ /herb/
$crap_list.each { |crap| if obj.name !~ /#{crap}/i then goodloot = true; end }
elsif obj.type =~ /clothing/
$crap_adjectives.each { |crap| if obj.name !~ /#{crap}/i then goodloot = true; end }
else goodloot = false; end
# Create array of good loot
if goodloot then lootlist.push(obj); end
}
if lootlist.size >= 1
fput "open my #{Lich.lootsack}"
# Manage full hands
if checkright and checkleft
handsfull = true
if GameObj.left_hand.name =~ /shield|buckler|targe|heater|parma|aegis|scutum|man tlet|pavis/i
stoweditem = [GameObj.left_hand,"worn"]; fput "wear ##{stoweditem[0].id}"
elsif GameObj.left_hand.noun =~ /bow/
stoweditem = [GameObj.right_hand,"stowed"]; fput "put ##{stoweditem[0].id} in my #{Lich.lootsack}"
else stoweditem = [GameObj.left_hand,"stowed"]; fput "put ##{stoweditem[0].id} in my #{Lich.lootsack}"
end
else handsfull = false
end
# Get all of the good loot
lootlist.each { |obj|
# Put boxes in disk if one exists
if obj.type =~ /box/ and GameObj.loot.any? { |item| item.name =~ /#{Char.name} disk/i }
multifput "open #{Char.name} disk","get ##{obj.id}","put ##{obj.id} in #{Char.name} disk","close #{Char.name} disk"
if GameObj.right_hand.type =~ /box/ or GameObj.left_hand.type =~ /box/ then fput "put ##{obj.id} in my #{Lich.lootsack}"; end
# Otherwise stow
else multifput "get ##{obj.id}","put ##{obj.id} in my #{Lich.lootsack}"
end
}
# Manage full hands
if handsfull
if stoweditem[1] =~ /worn/ then fput "remove ##{stoweditem[0].id}"
else fput "get ##{stoweditem[0].id} from my #{Lich.lootsack}"; end
end
fput "close my #{Lich.lootsack}"
end
end
Alstott
02-18-2012, 01:48 PM
I understand you didn't have to do that and how it probably frustrated you that I can't/won't learn Ruby at this time. You helped me anyway so I truely appreciate it.
I understand you didn't have to do that and how it probably frustrated you that I can't/won't learn Ruby at this time. You helped me anyway so I truely appreciate it.
Pfft fuck all that shit. I bet his doctor doesn't tell him to study chemistry and anatomy when he asks for help with his symptoms.
There's slightly less than infinite reasons why you shouldn't bother learning Ruby code and just ask in a thread where people who enjoy coding will more than happily help you out.
DaCapn
02-18-2012, 03:14 PM
I just didn't care for the "don't know, too lazy to find out, tell me the answer" tone of the opening post. Whether or not that's his MO, I just make it a point to not be too terribly helpful until I see some evidence of effort.
I've already shared that snippet no-fuss with a similar "you'll have to tweak a line or two" expectation. Thought I might as well be self-consistent.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.