Kinslar
06-07-2009, 01:53 AM
I have created a script that will either take me to an aliased hunting location or back to a town from my hunting location. I would like to make some general error recognition in my script but I am unable to come with a way to do that.
This would show up in line 4 below. I don't know how to get the script to check the variable %1 for the matchre commands. Essentially what I am hoping for is the Where: (line 3) group to get anything that isn't specified.
#matchre hunt /hunt/i
#matchre wl /wl/i
#matchre where /[a-z]/i
#put whisper group We are going to %1
#matchwait
goto %1
help:
echo ** ^ = Defensive stance is used while moving
echo ** Alias listed below are setup through PSInet
echo **
echo ** OPEN will open all containers
echo ** CLOSE will close all containers
echo ** HUNT {location alias} ^ will open containers, and move to hunting area if an alias is provided
echo ** Town ^ close all containers
echo ** WL ^ will close all containers and head for the Landing park alias
echo ** SH ^ will close all containers and head for the Solhaven North Market alias
goto end:
# This will open all containers
open:
put open %box_container
put open %gem_container
put open %herb_container
put open %main_container
put open %main_container2
put open %sheath1
put open %sheath2
put open %skin_pouch
put open %wand_container
goto end:
# This will close all containers
close:
put close %box_container
put close %gem_container
put close %herb_container
put close %main_container
put close %main_container2
put close %sheath1
put close %sheath2
put close %skin_pouch
put close %wand_container
goto end:
hunt:
put open %box_container
put open %gem_container
put open %herb_container
put open %main_container
put open %main_container2
put open %sheath1
put open %sheath2
put open %skin_pouch
put open %wand_container
put get %weapon
put stance defensive
waitfor You are now in a
You move into
echo * Ready to go hunting!
pause 3
if_2 put %2
if_2 waitfor goto complete
echo * Remember to change your stance to offensive
goto end
# This is used if you are following somebody else back to town.
town:
put close %box_container
put close %gem_container
put close %herb_container
put close %main_container
put close %main_container2
put close %sheath1
put close %sheath2
put close %skin_pouch
put close %wand_container
put stance defensive
waitfor You are now in a
echo * Heading for town!
goto end
# This will head to Wehnimer's Landing
wl:
put close %box_container
put close %gem_container
put close %herb_container
put close %main_container
put close %main_container2
put close %sheath1
put close %sheath2
put close %skin_pouch
put close %wand_container
put stance defensive
waitfor You are now in a
echo * Heading for town!
echo * Heading to the park in Wehnimer's Landing
pause 3
put wlpark
waitfor goto complete
goto end
# This will head to Solhaven
SH:
put close %box_container
put close %gem_container
put close %herb_container
put close %main_container
put close %main_container2
put close %sheath1
put close %sheath2
put close %skin_pouch
put close %wand_container
put stance defensive
waitfor You are now in a
echo * Heading for town!
echo * Heading to the NE part of North Market in Solhaven
pause 3
put SHNM
waitfor goto complete
goto end
where:
echo * LOCATION ENTERED IS NOT IN MACRO
echo **
echo **
goto help
end:
This would show up in line 4 below. I don't know how to get the script to check the variable %1 for the matchre commands. Essentially what I am hoping for is the Where: (line 3) group to get anything that isn't specified.
#matchre hunt /hunt/i
#matchre wl /wl/i
#matchre where /[a-z]/i
#put whisper group We are going to %1
#matchwait
goto %1
help:
echo ** ^ = Defensive stance is used while moving
echo ** Alias listed below are setup through PSInet
echo **
echo ** OPEN will open all containers
echo ** CLOSE will close all containers
echo ** HUNT {location alias} ^ will open containers, and move to hunting area if an alias is provided
echo ** Town ^ close all containers
echo ** WL ^ will close all containers and head for the Landing park alias
echo ** SH ^ will close all containers and head for the Solhaven North Market alias
goto end:
# This will open all containers
open:
put open %box_container
put open %gem_container
put open %herb_container
put open %main_container
put open %main_container2
put open %sheath1
put open %sheath2
put open %skin_pouch
put open %wand_container
goto end:
# This will close all containers
close:
put close %box_container
put close %gem_container
put close %herb_container
put close %main_container
put close %main_container2
put close %sheath1
put close %sheath2
put close %skin_pouch
put close %wand_container
goto end:
hunt:
put open %box_container
put open %gem_container
put open %herb_container
put open %main_container
put open %main_container2
put open %sheath1
put open %sheath2
put open %skin_pouch
put open %wand_container
put get %weapon
put stance defensive
waitfor You are now in a
You move into
echo * Ready to go hunting!
pause 3
if_2 put %2
if_2 waitfor goto complete
echo * Remember to change your stance to offensive
goto end
# This is used if you are following somebody else back to town.
town:
put close %box_container
put close %gem_container
put close %herb_container
put close %main_container
put close %main_container2
put close %sheath1
put close %sheath2
put close %skin_pouch
put close %wand_container
put stance defensive
waitfor You are now in a
echo * Heading for town!
goto end
# This will head to Wehnimer's Landing
wl:
put close %box_container
put close %gem_container
put close %herb_container
put close %main_container
put close %main_container2
put close %sheath1
put close %sheath2
put close %skin_pouch
put close %wand_container
put stance defensive
waitfor You are now in a
echo * Heading for town!
echo * Heading to the park in Wehnimer's Landing
pause 3
put wlpark
waitfor goto complete
goto end
# This will head to Solhaven
SH:
put close %box_container
put close %gem_container
put close %herb_container
put close %main_container
put close %main_container2
put close %sheath1
put close %sheath2
put close %skin_pouch
put close %wand_container
put stance defensive
waitfor You are now in a
echo * Heading for town!
echo * Heading to the NE part of North Market in Solhaven
pause 3
put SHNM
waitfor goto complete
goto end
where:
echo * LOCATION ENTERED IS NOT IN MACRO
echo **
echo **
goto help
end: