Repair (script)

From Elanthipedia
Revision as of 02:06, 16 September 2015 by ISHARON (talk | contribs)
Jump to navigation Jump to search
Repair (script)
Category utility
Front-end Genie
Author Isharon


Description

This script submits all of the equipment that I am carrying for repair, waits until the repairs are ready, and then wears or stows the repaired items.

Feel free to use this as a template.

Syntax

.REP [REPAIRER]: repairer is the name of the NPC who does repairs in the shop you're in.

Script

if $zoneid = 1 then
{
put #var mrep Catrox
put #var lrep Randal
}

if $zoneid = 4 then
{
put #var mrep Catrox
put #var lrep Randal
}

if $zoneid = 40 then
{
put #var mrep Dagul
put #var lrep Kamze
}

if $zoneid = 42 then
{
put #var mrep Dagul
put #var lrep Kamze
}

if $zoneid = 47 then
{
put #var mrep Fekoeti
put #var lrep Bonze
}

if $zoneid = 48 then
{
put #var mrep Fekoeti
put #var lrep Bonze
}

if $zoneid = 66 then
{
put #var mrep Granzer
put #var lrep Ylono
}

if $zoneid = 116 then
{
put #var mrep Ladar
put #var lrep Tuzra
}

if $zoneid = 127 then
{
put #var mrep Ladar
put #var lrep Tuzra
}

put #class racial on
put #class rp on
put #class combat off
put #class joust off

setvar_check_sheath_item1 0
setvar_check_sheath_item2 0
setvar_check_sheath_item3 0
setvar_check_pack_item1 0
setvar_check_pack_item2 0
setvar_check_pack_item3 0

ACTION setvar check_sheath_item1 1 WHEN ^You rummage through.+baldric.+and see.+item1
ACTION setvar check_sheath_item2 1 WHEN ^You rummage through.+baldric.+and see.+item2
ACTION setvar check_sheath_item3 1 WHEN ^You rummage through.+baldric.+and see.+item3
ACTION setvar check_pack_item1 1 WHEN ^You rummage through.+pack.+and see.+item1
ACTION setvar check_pack_item2 1 WHEN ^You rummage through.+pack.+and see.+item2
ACTION setvar check_pack_item3 1 WHEN ^You rummage through.+pack.+and see.+item3

put inventory
waitforre ^You are wearing
send rummage in my $sheath
waitforre ^You rummage through.+and see|^I could not find|^I don't know what you are referring to
send rummage in my $pack
waitforre ^You rummage through.+and see|^I could not find|^I don't know what you are referring to

if %check_sheath_item1 = 1 then gosub gives item1
if %check_sheath_item2 = 1 then gosub gives item2
if %check_sheath_item3 = 1 then gosub gives item3
if %check_pack_item1 = 1 then gosub givep item1
if %check_pack_item2 = 1 then gosub givep item2
if %check_pack_item3 = 1 then gosub givep item3
echo ***** Now waiting for repairs to be ready. *****
goto waitrep

gives:
var repair $0
send get my %repair from my $sheath
waitforre ^You get|^You remove|^What
send ask %1 about repairing all
waitforre \"There isn't a scratch on that, and I'm not one to rob you.\"|\"I will not repair something that isn't broken\.\"|Ask once more if you find these terms agreeable\.\"|Just ask me again and I can get started|My work will be complete by then\.|Please don't lose this ticket!|There is no damage to be mended\.\"
send ask %1 about repairing all
waitforre \"There isn't a scratch on that, and I'm not one to rob you.\"|\"I will not repair something that isn't broken\.\"|Ask once more if you find these terms agreeable\.\"|Just ask me again and I can get started|My work will be complete by then\.|Please don't lose this ticket!|There is no damage to be mended\.\"
send stow my %1 ticket
waitforre ^You|^Perhaps|^Stow|^What
send put my %repair in my $sheath
waitforre ^You|^Perhaps|^Stow|^What
pause .5
return

givep:
var repair $0
send get my %repair from my $pack
waitforre ^You get|^You remove|^What
send ask %1 about repairing all
waitforre \"There isn't a scratch on that, and I'm not one to rob you.\"|\"I will not repair something that isn't broken\.\"|Ask once more if you find these terms agreeable\.\"|Just ask me again and I can get started|My work will be complete by then\.|Please don't lose this ticket!|There is no damage to be mended\.\"
send ask %1 about repairing all
waitforre \"There isn't a scratch on that, and I'm not one to rob you.\"|\"I will not repair something that isn't broken\.\"|Ask once more if you find these terms agreeable\.\"|Just ask me again and I can get started|My work will be complete by then\.|Please don't lose this ticket!|There is no damage to be mended\.\"
send stow my %1 ticket
waitforre ^You|^Perhaps|^Stow|^What
send put my %repair in my $pack
waitforre ^You|^Perhaps|^Stow|^What
pause .5
return

waitrep:
pause 20
send read my %1 ticket
matchre getstart repairs should be ready by now
matchre exit ^What were you referring to|^I could not find what you were referring to
matchwait 1
goto waitrep

getstart:
setvar get_item1 0
setvar get_item2 0
setvar get_item3 0

ACTION setvar get_item1 1 WHEN ^You rummage through a large sack and see.+item1
ACTION setvar get_item2 1 WHEN ^You rummage through a large sack and see.+item2
ACTION setvar get_item3 1 WHEN ^You rummage through a large sack and see.+item3

send get my %1 ticket
waitforre ^You get|^You are already
pause
send give %1
waitforre ^You hand
send swap
waitforre ^You move
send rummage in my large sack
waitforre ^You rummage through a large sack and see.+

if %get_item1 = 1 then gosub wear item1
if %get_item2 = 1 then gosub sheath item2
if %get_item3 = 1 then gosub pack item3
goto empty

wear:
var item $0
send get %item from my large sack
waitforre ^You get|^You remove|^What
send wear my %item
matchre pack2 ^This .+ can't fit over the .+ you are already wearing|^You can't wear any more items like that
matchwait 1
return

sheath:
var item $0
send get %item from my large sack
waitforre ^You get|^You remove|^What
send put my %item in my $sheath
matchre pack2 ^There isn't any more room|^What were you referring to
matchwait 1
return

pack:
var item $0
send get %item from my large sack
waitforre ^You get|^You remove|^What
send put my %item in my $pack
waitforre ^You|^Perhaps|^Wear|^What
return

pack2:
send put my %item in my $pack
waitforre ^You|^Perhaps|^Wear|^What
return

empty:
send rummage in my large sack
waitforre ^You rummage through a large sack but there is nothing in there
send put my large sack in bucket
matchre getstart ^You drop a large sack
matchwait 1
send drop my large sack
matchre getstart ^You drop a large sack
goto getstart

return:
return

exit:
exit