PDA

View Full Version : Random Bounty Scripts (for Lich)



Caede
08-16-2006, 11:55 AM
This is a very simple [not tested heavily] script for foraging tasks for the AG. Since my character has 0 survival and first aid, foraging can be a bit time-consuming -- but, with this script it does go by fairly quickly. The next time I get the 'farmed out' messaging, I'll edit the script to include that, and move someplace else.

The script will kneel and forage, then get up and run away if a critter arrives. Once it finds a safe room, it will continue foraging. It goes without saying that this would be pretty stupid to run unattended.

Obviously, tweak for your spells, etc.

Requires Lich, and a herbsack. (e.g. ;settings add herbsack: my sack)



if script.vars.empty?
goto "Help"
else
goto "forage"
end

forage:
loop {
if (checkpoison)
fput "incant 114"
elsif (!checknpcs && !checkpcs)
if (standing?)
if (checkright)
fput "stow right"
end
fput "kneel"
end
fput "forage for #{script.vars[1]}"
if (waitfor('You begin to forage around when your hand','As you forage around, you notice that someone','Roundtime') =~ /As you forage|You begin to forage around when your hand/)
fput "stance def"
fput "stand"
waitrt?
fput "ready weapon"
run
else
waitrt?
end
if (checkright(script.vars[1]))
fput "put #{script.vars[1]} in my #{Lich.herbsack}"
end
else
fput "stance def"
fput "stand"
waitrt?
fput "ready weapon"
run
end
}


help:
respond("Usage: ;foragetask <herb>")
respond
respond("Example: ;foragetask \"valerian root\"")


I'll be adding a few more scripts which I'm using to help out with bounty tasks in the next few days.

Caede
09-27-2006, 05:38 PM
While I was waiting for the ferry from Illi to Vaalor, I made a very small change to the default ';walk' script to handle escorts.

Nothing monumental, just a little time-saver. Does nothing to handle attacks -- keep an eye on it while it's running, of course.



# escort.lic
#!/usr/bin/env ruby
# Very simply modification to ;walk which waits for an escort following you
# Lets you perform "batch movements," so to speak. For instance: ;move 10n 10e 3sw 2u "climb path" 5d, etc.
help = <<HELP

To perform batch movements, just enter the # of times to move in that direction and the direction. It's pretty forgiving about organization. For instance:
;move 5nw, climb road, 2d, 3 e, climb step, 3w
;move 4nw "climb road" 3sw "2climb step"

(take note that any movement which requires multiple words to be sent must be either enclosed in quotes, or you can separate the directions with commas as shown above -- do whichever you find easiest)
HELP

if script.vars.empty? or script.vars[1] =~ /help/i
respond help
end

if script.vars[0].include?(',')
dirs = script.vars[0].scan(/[^,]+/)
else
dirs = script.vars[1..-1]
end

dirs.each { |dir|
if dir.slice(/\d+/).nil?
move dir.gsub(',', '').strip
waitrt?
waitfor ", following you."
else
dir.slice(/\d+/).to_i.times {
move dir.sub(/\d+/, '').gsub(',', '').strip
waitrt?
waitfor ", following you."
}
end
}


Here's an example of going from Illistim (just inside the Sapphire Gate, where you pick up travelers) to Vaalor:


;escort "go gate",sw,se,"go port",s,s,out,sw,w,w,s,sw,e,se,s,se,se,se,e,se,se,se,e, e,e,se,se,se,e,e,se,se,se,se,e,se,se,se,s,s,se,se, se,s,se,se,se,s,s,se,se,se,e,e,se,se,se,e,se,se,se ,"go dock"
## Wait for the ferry, go gang, out, etc
;escort s,s,se,se,s,se,s,s,se,se,s,s
search
;escort "go crev",se,s,se,s,se,se,"go bridge"


If you get attacked, simply pause (;p) and unpause (;up) when you're ready to continue. Don't forget to move back where you stopped before unpausing.

Joseph
09-27-2006, 08:49 PM
Nice lil' tidbit.. and easier than the way I did it with JSE.. well done.

Mistomeer
09-28-2006, 07:18 PM
Last I knew, kneeling didn't affect foraging. Does anyone know different?

Bobmuhthol
09-28-2006, 07:19 PM
I'm fairly certain that it does. You might be thinking of skinning.

Merzbow
09-28-2006, 09:02 PM
Kneeling has no effect on foraging success as far as I can tell.

Bobmuhthol
09-28-2006, 09:06 PM
:(

nvm

Caede
09-28-2006, 11:52 PM
Once again, was waiting for the ferry and decided to finish writing this little escort script. It seems I get Illistim to Vaalor about 3 times a day, so if no one else uses this, I certainly will.



# Escort from Illistim to Vaalor -- requires escort.lic (modification to walk)

illistimtoferry:
start_script "escort", [ "go gate","sw","se","go port","s","s","out","sw","w","w","s","sw","e","se","s","se","se","se","e","se","se","se","e","e","e","se","se","se","e","e","se","se","se","se","e","se","se","se","s","s","se","se","se","s","se","se","se","s","s","se","se","se","e","e","se","se","se","e","se","se","se","go dock" ]
waitfor "Finely-carved modwir posts support the weight of the fel boards that form the floor of the dock."
goto "waitforferry"

waitforferry:
match "enterboat", "a gangplank"
match "noferry", "Obvious"
fput "look"
matchwait

noferry:
match "enterboat", "scrambles back onto the boat and lowers the gangplank."
matchwait

enterboat:
fput "go gangplank"
goto "waitforland"

waitforland:
match "leaveboat", "scrambles back onto the boat and lowers the gangplank."
matchwait

leaveboat:
fput "out"
goto "ferrytovaalor"

ferrytovaalor:
start_script "escort", [ "s","s","se","se","s","se","s","s","se","se","s","s" ]
waitfor "Up close, the wall of towering boulders looks impenetrable"
fput "search"
start_script "escort", [ "go crev","se","s","se","s","se","se","go bridge" ]
waitfor "The traveller walks off."
echo "All done."


Again, if you get attacked simply pause (;p) and unpause (;up) when you're ready to continue. Don't forget to move back where you stopped before unpausing. Since you're already using Lich, you could run another script in tandem with this to watch for attacks, of course.

I'll test it on my next run and update accordingly.