PDA

View Full Version : Searching Critters Script



Jonty
01-26-2004, 02:28 PM
You'll need to set your container variable and your shield variable if you use one for this script to run correctly.



#search

first:
if_1 goto start
AddToHighlightStrings string=".search <critter>" foreColor=14 highlightEntireLine=True /quiet
echo Usage is: .search <critter>
DeleteFromHighlightStrings string=".search <critter>"
AddToHighlightStrings string=".search <critter> <critter> etc...." foreColor=14 highlightEntireLine=True /quiet
echo
echo Or for multiple critters: .search <critter> <critter> etc....
DeleteFromHighlightStrings string=".search <critter> <critter> etc...."

def:
save def
match end You are now in a defensive stance.
match wait ...wait
put stance defensive
matchwait

wait:
wait
goto %s

start:
save start
counter set 1
match search You are now in a defensive stance.
match wait ...wait
put stance defensive
matchwait

search:
wait
match wand wand
match orb orb
match lockpick lockpick
match scroll scroll
match amulet amulet
match diamond diamond
match emerald emerald
match lapis lapis lazuli
match opal opal
match pearl pearl
match ruby ruby
match sapphire sapphire
match shell shell
match topaz topaz
match coral coral
match amber amber
match amethyst amethyst
match bloodstone bloodstone
match garnet garnet
match gem gem
match crystal crystal
match jasper jasper
match moonstone moonstone
match glimaerstone glimaerstone
match stone stone
match check%c Try looking in, on, behind or under it. Or examining it.
match check%c nothing of interest
match check%c nothing else
match check%c What were you referring to?
match check%c with it!
match check%c You're not in any condition to be searching around!
match check%c Geez! It's still alive! Not a good time for that.
put search %1
matchwait

lockpick:
save lockpick
Goto get%c

amulet:
save amulet
Goto get%c

wand:
save wand
Goto get%c

scroll:
save scroll
Goto get%c

diamond:
save diamond
Goto get%c

emerald:
save emerald
Goto get%c

lapis:
save lapis
Goto get%c

opal:
save opal
Goto get%c

pearl:
save pearl
Goto get%c

ruby:
save ruby
Goto get%c

shell:
save shell
Goto get%c

sapphire:
save sapphire
Goto get%c

topaz:
save topaz
Goto get%c

coral:
save coral
Goto get%c

amber:
save amber
Goto get%c

amethyst:
save amethyst
Goto get%c

bloodstone:
save bloodstone
Goto get%c

garnet:
save garnet
Goto get%c

gem:
save gem
Goto get%c

jasper:
save jasper
Goto get%c

crystal:
save crystal
Goto get%c

quartz:
save quartz
Goto get%c

spinel:
save spinel
Goto get%c

stone:
save stone
Goto get%c

tourmaline:
save tourmaline
Goto get%c

zircon:
save zircon
Goto get%c

orb:
save orb
Goto get%c

glimaerstone:
save glimaerstone
Goto get%c

moonstone:
save moonstone
Goto get%c

get1:
counter set 2
wait
match open you
match open Wear what?
put wear my %shield
matchwait

open:
wait
match get2 you
match get2 Ok, it opened.
match get2 That is already open.
put open my %container
matchwait

get2:
wait
put get %s
waitfor You pick up
put put my %s in my %container
waitfor You put

check2:
shift
if_1 goto search
put close my %container

check1:
shift
if_1 goto search

end:

[Edited on 1-31-2004 by Jonty]

gcstader
01-26-2004, 09:45 PM
Thanks for posting this script Jonty. I changed my hunting script and it seems to work well. Here's the changes:
---------------
dead:
pause 1
put SIGN OF SHIELDS
waitfor !
put stance d
waitfor You are now in a defensive stance.
match strongbox strongbox
match coffer coffer
match box box
match chest chest
match trunk trunk
match broke It had nothing else of value.
match broke2 It had nothing of interest.
put search manticore
matchwait

broke:
put look
goto checkroom

broke2:
put look
goto checkroom

strongbox:
put put longsword in my harness
waitfor longsword
put get strongbox
put put strongbox in my cloak
put get longsword from harness
waitfor longsword
put look
goto checkroom

coffer:
put put longsword in my harness
waitfor longsword
put get coffer
put put coffer in my cloak
put get longsword from my harness
waitfor longsword
put look
goto checkroom

box:
put put longsword in my harness
waitfor longsword
put get box
put put box in my cloak
put get longsword from my harness
waitfor longsword
put look
goto checkroom

chest:
put put longsword in my harness
waitfor longsword
put get chest
put put chest in my cloak
put get longsword from my harness
waitfor longsword
put look
goto checkroom

trunk:
put put longsword in my harness
waitfor longsword
put get trunk
put put trunk in my cloak
put get longsword from my harness
waitfor longsword
put look
goto checkroom
------------
Any suggestions on how to make this better? Also, what is the point in using WAIT commands if the scripting engine automatically waits for the roundtime?

Thanks
~Greg

Jonty
01-26-2004, 09:59 PM
Also, what is the point in using WAIT commands if the scripting engine automatically waits for the roundtime?


The wait command doesn't wait for time to pass..., it waits for a responce from the game. The purpose of my wait commands are to slow the script down so it doesn't type ahead. It's like the waitFor command, except it waits for ANY responce.

Jonty
01-26-2004, 10:01 PM
Originally posted by gcstader
Any suggestions on how to make this better?
Yeah, the following is pointless, they do the exact same thing.


broke:
put look
goto checkroom

broke2:
put look
goto checkroom

Jonty
01-26-2004, 10:05 PM
Ok, I guess you didn't really look at how my script was written. You have 5 sections that do the exact same thing, but for different box types. You can condense the script by using the save variable instead. Assign the box type to the save variable; then go to ONE section to get and store the box using the save variable.

gcstader
01-26-2004, 10:15 PM
<< The purpose of my wait commands are to slow the script down so it doesn't type ahead. It's like the waitFor command, except it waits for ANY responce. >>

Alright, here's a situation I need some help with: I need to climb over a gate. If the climb fails you are knocked to the ground with appx. 10 sec. RT. If successful then, I should continue walking. I've set it up like this:
------
climbgate:
match moverest Within a short time, you have leapt down on the other side.
match failedclimb you fall
put put my longsword in my harness
waitfor longsword
put wear my shield
waitfor shield
put stance o
put climb gate
matchwait

failedclimb:
#If I failed then I have a 10 sec RT before I can stand. Will the script automatically wait for the roundtime before executing "put stand"
put stand
match up You stand back up.
match failedclimb You fail to stand
matchwait

up:
put climbgate
match moverest Within a short time, you have leapt down on the other side.
match failedclimb you fall
matchwait

moverest:
put get longsword from my harness
waitfor longsword
put rem shield
put stance d
move go trail
move northeast
move northeast
move east
move east
put give guard 5 silver
move go gate
move east
move east
move east
move east
move east
move east
move go bank
goto bankdepo
---

[Edited on 1-27-2004 by gcstader]

Jonty
01-26-2004, 10:17 PM
Don't you have to jump after you climb the gate?

Edited: Nevermind.

[Edited on 1-27-2004 by Jonty]

Jonty
01-26-2004, 10:24 PM
This should work. Not 100% sure though since I can't test it.



prepGate:
put put my longsword in my harness
waitfor longsword
put wear my shield
waitfor shield
put stance o

climbgate:
match moverest Within a short time, you have leapt down on the other side.
match failedclimb you fall
put climb gate
matchwait

wait:
wait
# the following goto command is here in case you want to use this wait section for other sections instead of making multiple sections.
goto %s

failedclimb:
save failedclimb
match climbgate You stand back up.
match wait You fail to stand
match wait ...wait
put stand
matchwait

moverest:
put get longsword from my harness
waitfor longsword
put rem shield
put stance d
move go trail
move northeast
move northeast
move east
move east
put give guard 5 silver
move go gate
move east
move east
move east
move east
move east
move east
move go bank
goto bankdepo


[Edited on 1-27-2004 by Jonty]

gcstader
01-26-2004, 10:26 PM
Thanks

100% Wool
03-02-2004, 10:47 PM
I was wondering if anyone has incorporated this search script with the new loot verb it'd be much more helpful instead of typing .search <critter> we could just set a macro for . loot and it'd work great
I wish I knew how to make hardcore scripts like this but I can't so if anyone has anything like this would you mind putting it up on the boards to share with the masses?

Thanks in advance