View Full Version : Larton (NPC locksmith) ?
Septik
01-22-2009, 06:43 PM
Hey all,
I'm trying to get this auto Larton locksmith script to work. Using SF. Anyone have one available or can look this over and tell me what I did wrong?
It looks in the cloak but then that's it. It doesn't take em out and get em picked. Any input would be greatly appreciated.
locksmithin:
put look in my cloak
match lock1 coffer
match lock2 chest
match lock3 strongbox
match lock4 trunk
match lock5 box
lock1:
put get my coffer
put put coffer on count
waitfor wax-stained
put ring bell
put pay 2000
waitfor Larton accepts
put get coffer
put open my coffer
put get coins
pause 4
put empty coffer in my back
put coffer in my cloak
goto locksmithin
lock2:
put get my chest
put put chest on count
waitfor wax-stained
put ring bell
put pay 2000
waitfor Larton accepts
put get chest
put open my chest
put get coins
pause 4
put empty chest in my back
put put chest in my cloak
goto locksmithin
lock3:
put get my strongbox
put put chest on count
waitfor wax-stained
put ring bell
put pay 2000
waitfor Larton accepts
put get strongbox
put open my strongbox
put get coins
pause 4
put empty strongbox in my back
put put strongbox in my cloak
goto locksmithin
lock4:
put get my trunk
put put trunk on count
waitfor wax-stained
put ring bell
put pay 2000
waitfor Larton accepts
put get trunk
put open my trunk
put get coins
pause 4
put empty trunk in my back
put put trunk in my cloak
goto locksmithin
lock5:
put get my box
put put box on count
waitfor wax-stained
put ring bell
put pay 2000
waitfor Larton accepts
put get box
put open my box
put get coins
pause 4
put empty box in my back
put put box in my cloak
goto locksmithin
:thanx:
You forgot your matchwait after your first set of matches.
Looking further at the script...
If you put the empty boxes back in your cloak then loop back to look in your cloak, it's just going to take out that empty box again.
Make sure if you actually want it to use the verb "put", you have "put put", otherwise it's going to be all COFFER IN MY CLOAK!!!! and nothing's going to happen.
You don't need an amount; PAY by itself will pay the fee if you have the silvers on you.
Septik
01-22-2009, 07:21 PM
Ah didn't even notice I was putting them back in my cloak. Thanks for catching that.
Would you know the command to make it continue the script if there are no boxes in my cloak?
Liagala
01-22-2009, 07:25 PM
There is no "else" type command, in SF. The best you can do is match to something else. In this case, I would match a period. It's the only thing I can think of that's guranteed to show up after all boxes when you look in your cloak. Even gear you carry around constantly can get swapped around in the order of things, messing your script up. Just add a "match done ." after the list of boxes, and
done:
exit
somewhere at the end.
Septik
01-22-2009, 07:28 PM
Great. Thanks for the help!
Cephalopod
01-22-2009, 11:21 PM
Here's an old, clunky Lich script to do this. At Larton's, you would run it like this:
;npclocksmith (yourcontainer) casket
def openbox(container,box,trash)
fput "get #{box} from my #{container}"
if (matchwait("Get what","You remove") =~ /get what/i)
respond("Could not find that box.")
goto "theend"
end
if (checkarea == "Locks and More")
boxplatform = 'table'
belltoring = 'chime'
trash = 'drop'
else
boxplatform = 'counter'
belltoring = 'bell'
end
fput "put #{box} on #{boxplatform}"
fput "ring #{belltoring}"
fput "pay"
fput "get #{box} from #{boxplatform}"
fput "open my #{box}"
fput "get coins"
waitrt?
pause 1
if (Lich.lootsack != '')
fput "empty my #{box} into my #{Lich.lootsack}"
else
fput "empty my #{box} into my #{container}"
end
waitrt?
pause 1
if (trash == 'drop')
fput "drop #{box}"
elsif (trash)
fput "put my #{box} into #{trash}"
else
fput "put my #{box} into waste"
end
end
def displayhelp
respond("Usage: ;npclocksmith <container> [optional trash container]")
respond
respond("Example: ;npclocksmith backpack casket")
end
if script.vars.empty?
displayhelp
else
boxdb = ["coffer","strongbox"," box","chest"]
script.vars[1].split(',').each { |from_container|
# if you use Psinet, change 'look in' to 'llook in'
fput("look in my #{from_container}").scan(/\b(?:#{boxdb.join('|')})(?=,|\.)/).each { |box|
openbox(from_container,box,script.vars[2])
}
}
end
theend:
thefarmer
01-23-2009, 12:28 AM
Won't do much good since he asked for help on a SF one..
However lich still has the best scripts.
Cephalopod
01-23-2009, 09:51 AM
Always a chance to convert more folks.
Here's my larton script.. just modify the containers and run it from larton's (room after you make sure no one else is there)
You also need to make sure you have plenty of coins on you just in case the boxes get expensive.. when there are no more boxes, it takes you to the bank to deposit all coins, then to a thrak table.
Brute is a gnome so he doesn't carry much... should be easy to add more containers though if necessary.
goto trydisk
trydisk:
SETVARIABLE mycontainer brute disk
SETVARIABLE mystep trydisk
match gotcoffer coffer
match gottrunk trunk
match gotstrong strongbox
match gotbox box
match gotchest chest
match nothing nothing in there
match nothing2 you see
match nothing2 could not find
put look in %mycontainer
MATCHWAIT
trycloak:
SETVARIABLE mycontainer my cloak
SETVARIABLE mystep trycloak
match gotcoffer coffer
match gottrunk trunk
match gotstrong strongbox
match gotbox box
match gotchest chest
match nothing3 nothing in there
match nothing4 you see
put look in %mycontainer
MATCHWAIT
trybackpack:
SETVARIABLE mycontainer my backpack
SETVARIABLE mystep trybackpack
match gotcoffer coffer
match gottrunk trunk
match gotstrong strongbox
match gotbox box
match gotchest chest
match nothing5 nothing in there
match nothing6 you see
put look in %mycontainer
MATCHWAIT
gotcoffer:
SETVARIABLE boxtype coffer
goto doBox
gottrunk:
SETVARIABLE boxtype trunk
goto doBox
gotstrong:
SETVARIABLE boxtype strongbox
goto doBox
gotbox:
SETVARIABLE boxtype box
goto doBox
gotchest:
SETVARIABLE boxtype chest
goto doBox
nothing:
goto trycloak
nothing2:
goto trycloak
nothing3:
goto finished
nothing4:
goto finished
nothing5:
goto finished
nothing6:
goto finished
doBox:
put get %boxtype from %mycontainer
put put my %boxtype on counter
wait
put ring bell
put pay 3000
wait
put get %boxtype from counter
put open my %boxtype
wait
put get coins
waitfor You gather
put empty my %boxtype into my cloak
waitfor You try to empty
put put my %boxtype in casket
waitfor you place a
goto %mystep
nothing3:
goto finished
nothing4:
goto finished
finished:
echo **************************
echo ***ALL DONE WITH BOXES****
echo **************************
put go doo
put out
move w
move w
move w
move w
move w
move s
put go bank
put go arch
put deposit all
wait
put go arch
put out
move n
put go inn
move n
put go table
echo ********** FINISHED ************
Kinslar
05-20-2009, 07:34 PM
I took Brute's script as a base and modified it. Right now it only works in the Landing, however without too much effort the variables can be added for the other cities. I also put checks in for too little money, no space to empty into the backpack. The script types (global and script) are for my personal use. I use the same variable names in many different macros.
DEBUG OFF
################################################## #####################
#Mazel's Lock Opening Script #
#Created: 5/18/2009 Verion 1.1 #
# #
#Usage: .lock #
# #
#descirption: Looks through disk, cloak and backpack for boxes #
# checks for coffers, trunks, strongboxes, boxes, chests #
# #
#Variable list #
#lockcontainer: script variable - current container pulling boxes from#
#lockstep: script variable - current container to check #
#boxtype: script variable - type of box to be unlocked #
#shield: Global variable - Name of shield being used #
#weapon: Global variable - Item to be stowed while dealing with boxes #
#garbage: script variable - garbage recepticle #
#workspace: script variable - where to put box for locksmith #
#main_countainer: global variable - default container #
################################################## #####################
put Open Cloak
put Open backpack
################################################## #####################
#Determine city of locksmith
################################################## #####################
#To add more cities add a match line with city name and locksmith name
#patten is: match {city name} {locksmith name}
Location:
match Landing Larton
put look
matchwait
#Create a goto group for each city using the same {city name} from match above
#include variables for garbage recepticle and what the workspace is for that locksmith
Landing:
#SETVARIABLE City Landing
SETVARIABLE garbage casket
SETVARIABLE workspace counter
goto trydisk
################################################## #####################
#Look in disk, cloak and backpack for boxes. Repeat till all are done
################################################## #####################
trydisk:
SETVARIABLE lockcontainer kinslar disk
SETVARIABLE lockstep trydisk
match gotcoffer coffer
match gottrunk trunk
match gotstrong strongbox
match gotbox box
match gotchest chest
match nothing nothing in there
match nothing you see
match nothing could not find
put look in %lockcontainer
MATCHWAIT
trycloak:
SETVARIABLE lockcontainer my cloak
SETVARIABLE lockstep trycloak
match gotcoffer coffer
match gottrunk trunk
match gotstrong strongbox
match gotbox box
match gotchest chest
match nothing2 nothing in there
match nothing2 you see
match nothing2 could not find
put look in %lockcontainer
MATCHWAIT
trybackpack:
SETVARIABLE lockcontainer my backpack
SETVARIABLE lockstep trybackpack
match gotcoffer coffer
match gottrunk trunk
match gotstrong strongbox
match gotbox box
match gotchest chest
match nothing3 nothing in there
match nothing3 you see
put look in %lockcontainer
MATCHWAIT
################################################## #####################
#Set box type that will be worked on
################################################## #####################
gotcoffer:
SETVARIABLE boxtype coffer
goto pickbox
gottrunk:
SETVARIABLE boxtype trunk
goto pickbox
gotstrong:
SETVARIABLE boxtype strongbox
goto pickbox
gotbox:
SETVARIABLE boxtype box
goto pickbox
gotchest:
SETVARIABLE boxtype chest
goto pickbox
################################################## #####################
#Nothing found goto the next container type
################################################## #####################
nothing:
goto trycloak
nothing2:
goto trybackpack
nothing3:
goto finished
################################################## #####################
#Get the box picked
################################################## #####################
pickbox:
put get %boxtype from %lockcontainer
put put my %boxtype on %workspace
waitfor you put
put ring bell
Match poor don't have enough
Match continue Turning his attention
put pay
MATCHWAIT
#This match group will verify you have funds to pay for lock picking
continue:
wait
put get %boxtype from %workspace
put open my %boxtype
wait
put get coins
waitfor You gather
look in %boxtype
match cleanup everything falls in quite nicely
match cleanup but nothing comes out
match backup /[a-z]/
put empty my %boxtype into my %main_container
MATCHWAIT
#This match group will make sure no loot is left in container before cleanup
#Can't be throwing away loot now can we!
backup:
#In case the main container is full this will put the loot into the current box container
match cleanup everything falls in quite nicely
match full /[a-z]/
put empty my %boxtype into my %lockcontainer
MATCHWAIT
cleanup:
put put my %boxtype in %garbage
waitfor you place a
goto %lockstep
full:
echo **********************************
echo ***Too much loot in %boxtype for %main_countainer and your %lockcontainer ****
echo **********************************
goto finished
poor:
echo ***********************************
echo ***Need more coin for %boxtype ****
echo ***********************************
put get %boxtype from counter
waitfor You remove
goto finished
finished:
echo **************************
echo ***ALL DONE WITH BOXES****
echo **************************
put close cloak
put close backpack
DELETEVARIABLE boxtype
DELETEVARIABLE lockcontainer
DELETEVARIABLE workspace
DELETEVARIABLE lockstep
DELETEVARIABLE garbage
echo ********** FINISHED ************
Bhuryn
05-20-2009, 09:02 PM
you can just "pay" don't need to put a number on it
Kinslar
05-30-2009, 03:42 PM
This now works for Solhaven as well.
DEBUG OFF
################################################## #####################
#Mazel's Lock Opening Script #
#Created: 5/18/2009 Verion 1.1 #
# #
#Usage: .lock #
# #
#descirption: Looks through disk, cloak and backpack for boxes #
# checks for coffers, trunks, strongboxes, boxes, chests #
# #
#Variable list #
#lockcontainer: script variable - current container pulling boxes from#
#lockstep: script variable - current container to check #
#boxtype: script variable - type of box to be unlocked #
#shield: Global variable - Name of shield being used #
#weapon: Global variable - Item to be stowed while dealing with boxes #
#garbage: script variable - garbage recepticle #
#workspace: script variable - where to put box for locksmith #
#main_countainer: global variable - default container #
################################################## #####################
put Open Cloak
put Open backpack
################################################## #####################
#Determine city of locksmith
################################################## #####################
#To add more cities add a match line with city name and locksmith name
#patten is: match {city name} {locksmith name}
Location:
match Landing Larton
match Solhaven Jyhm
match NoSmith /[a-z]/
put look
matchwait
#Create a goto group for each city using the same {city name} from match above
#include variables for garbage recepticle and what the workspace is for that locksmith
Landing:
#SETVARIABLE City Landing
SETVARIABLE garbage casket
SETVARIABLE workspace counter
goto trydisk
Solhaven:
#SETVARIABLE City Solhaven
SETVARIABLE garbage wastebarrel
SETVARIABLE workspace counter
goto trydisk
################################################## #####################
#Look in disk, cloak and backpack for boxes. Repeat till all are done
################################################## #####################
trydisk:
SETVARIABLE lockcontainer kinslar disk
SETVARIABLE lockstep trydisk
match gotcoffer coffer
match gottrunk trunk
match gotstrong strongbox
match gotbox box
match gotchest chest
match nothing nothing in there
match nothing you see
match nothing could not find
put look in %lockcontainer
MATCHWAIT
trycloak:
SETVARIABLE lockcontainer my cloak
SETVARIABLE lockstep trycloak
match gotcoffer coffer
match gottrunk trunk
match gotstrong strongbox
match gotbox box
match gotchest chest
match nothing2 nothing in there
match nothing2 you see
match nothing2 could not find
put look in %lockcontainer
MATCHWAIT
trybackpack:
SETVARIABLE lockcontainer my backpack
SETVARIABLE lockstep trybackpack
match gotcoffer coffer
match gottrunk trunk
match gotstrong strongbox
match gotbox box
match gotchest chest
match nothing3 nothing in there
match nothing3 you see
put look in %lockcontainer
MATCHWAIT
################################################## #####################
#Set box type that will be worked on
################################################## #####################
gotcoffer:
SETVARIABLE boxtype coffer
goto pickbox
gottrunk:
SETVARIABLE boxtype trunk
goto pickbox
gotstrong:
SETVARIABLE boxtype strongbox
goto pickbox
gotbox:
SETVARIABLE boxtype box
goto pickbox
gotchest:
SETVARIABLE boxtype chest
goto pickbox
################################################## #####################
#Nothing found goto the next container type
################################################## #####################
nothing:
goto trycloak
nothing2:
goto trybackpack
nothing3:
goto finished
################################################## #####################
#Get the box picked
################################################## #####################
pickbox:
put get %boxtype from %lockcontainer
put put my %boxtype on %workspace
waitfor you put
put ring bell
Match poor don't have enough
Match continue Turning his attention
Match opened But he hasn't
put pay
MATCHWAIT
#This match group will verify you have funds to pay for lock picking
continue:
wait
put get %boxtype from %workspace
put open my %boxtype
wait
put get coins
waitfor You gather
put look in %boxtype
match cleanup everything falls in quite nicely
match cleanup but nothing comes out
match backup /[a-z]/
put empty my %boxtype into my %main_container
MATCHWAIT
#This match group will make sure no loot is left in container before cleanup
#Can't be throwing away loot now can we!
backup:
#In case the main container is full this will put the loot into the current box container
match cleanup everything falls in quite nicely
match full /[a-z]/
put empty my %boxtype into my %lockcontainer
MATCHWAIT
cleanup:
put put my %boxtype in %garbage
waitfor you place a
goto %lockstep
full:
echo **********************************
echo ***Too much loot in %boxtype for %main_countainer and your %lockcontainer ****
echo **********************************
goto finished
poor:
echo ***********************************
echo ***Need more coin for %boxtype ****
echo ***********************************
put get %boxtype from counter
waitfor You remove
goto finished
opened:
echo ***********************************
echo ***this %boxtype has already been unlocked ****
echo ***********************************
put get %boxtype from counter
waitfor You remove
goto finished
NoSmith:
echo ***********************************
echo *** No NPC Locksmith here ****
echo ***********************************
goto finished
finished:
echo **************************
echo ***ALL DONE WITH BOXES****
echo **************************
put close cloak
put close backpack
DELETEVARIABLE boxtype
DELETEVARIABLE lockcontainer
DELETEVARIABLE workspace
DELETEVARIABLE lockstep
DELETEVARIABLE garbage
echo ********** FINISHED ************
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.