Repair (script)

From Elanthipedia
Revision as of 20:05, 4 March 2016 by ISHARON (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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_toolstrapm 0
setvar_check_toolstrapr 0
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_toolstrapm 1 WHEN ^You are wearing.+leather toolstrap
ACTION setvar check_toolstrapr 1 WHEN ^You are wearing.+(braided|burnished) toolstrap
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|^I could not find|^I don't know what you are referring to
send rummage in my $pack
waitforre ^You rummage through|^I could not find|^I don't know what you are referring to

if %check_toolstrapm = 1 then gosub givetm item1
if %check_toolstrapm = 1 then gosub givetm item2
if %check_toolstrapm = 1 then gosub givetm item3
if %check_toolstrapr = 1 then gosub givetr item1
if %check_toolstrapr = 1 then gosub givetr item2
if %check_toolstrapr = 1 then gosub givetr item3
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

givetm:
var repair $0
send untie %repair from my $toolstrap_melee
waitforre ^You remove|^Untie what|^Your wounds
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 tie my %repair to my $toolstrap_melee
waitforre ^You attach|^You must be holding the item to tie to the toolstrap|^Tie what|^Your wounds
pause .5
return

givetr:
var repair $0
send untie %repair from my $toolstrap_ranged
waitforre ^You remove|^Untie what|^Your wounds
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 tie my %repair to my $toolstrap_ranged
waitforre ^You attach|^You must be holding the item to tie to the toolstrap|^Tie what|^Your wounds
pause .5
return

gives:
var repair $0
send get my %repair from my $sheath
waitforre ^You|^Perhaps|^Wear|^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|^Perhaps|^Wear|^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
setvar get_item4 0
setvar get_item5 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
ACTION setvar get_item4 1 WHEN ^You rummage through a large sack and see.+item4
ACTION setvar get_item5 1 WHEN ^You rummage through a large sack and see.+item5

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 toolstrapm item2
if %get_item3 = 1 then gosub toolstrapr item3
if %get_item4 = 1 then gosub sheath item4
if %get_item5 = 1 then gosub pack item5
goto empty

wear:
var item $0
send get %item from my large sack
waitforre ^You|^Perhaps|^Wear|^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

wear2:
var item $0
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

toolstrapm:
var item $0
send get %item from my large sack
waitforre ^You|^Perhaps|^Wear|^What
send tie my %item to my $toolstrap_melee
waitforre ^You attach|^You must be holding the item to tie to the toolstrap|^Tie what|^Your wounds
matchwait 1
return

toolstrapr:
var item $0
send get %item from my large sack
waitforre ^You|^Perhaps|^Wear|^What
send tie my %item to my $toolstrap_ranged
waitforre ^You attach|^You must be holding the item to tie to the toolstrap|^Tie what|^Your wounds
matchwait 1
return

sheath:
var item $0
send get %item from my large sack
waitforre ^You|^Perhaps|^Wear|^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|^Perhaps|^Wear|^What
if $charactername = Sarkranis && %item = recade then
{
send put my %item in my $sheath
matchre pack2 ^There isn't any more room|^What were you referring to
matchwait 1
return
}
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