Repair (script)

From Elanthipedia
Revision as of 10:28, 4 May 2011 by ISHARON (talk | contribs) (Created page with '{{Script |cat=utility |fe=Genie |auth=Isharon }} ==Description== This script submits all of the equipment that I am carrying for repair, waits until the repair…')
(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

setvar havelegwraps 0
setvar havetrousers 0
setvar haveironwood_greaves 0
setvar haveivory_greaves 0
setvar havegold-edged_greaves 0
setvar havepolished_greaves 0
setvar havesilver-edged_greaves 0
setvar havenightstick 0
setvar havebola 0
setvar havethrowing_club 0
setvar havethrowing_hammer 0
setvar havebludgeon 0
setvar havemace 0
setvar havewarhammer 0
setvar havechain 0
setvar havemorning-star 0
setvar havemaul 0
setvar havemattock 0
setvar havebaldric 0
setvar havehalberd 0
setvar haveskinning_knife 0
setvar havestiletto 0
setvar havedao 0
setvar haveflat-black_sword 0
setvar havejambiya 0
setvar havescimitar 0
setvar haveiltesh 0
setvar havebroadsword 0
setvar haveblade 0
setvar havebrushed_sword 0
setvar havegleaming_sword 0
setvar havegreatsword 0
ACTION setvar havelegwraps 1 WHEN ^In the .+ pack you see .+ legwraps
ACTION setvar havetrousers 1 WHEN ^In the .+ pack you see .+ trousers
ACTION setvar haveironwood_greaves 1 WHEN ^In the .+ pack you see .+ ironwood greaves
ACTION setvar haveivory_greaves 1 WHEN ^In the .+ pack you see .+ ivory greaves
ACTION setvar havegold-edged_greaves 1 WHEN ^In the .+ pack you see .+ gold-edged greaves
ACTION setvar havepolished_greaves 1 WHEN ^In the .+ pack you see .+ polished gold greaves
ACTION setvar havesilver-edged_greaves 1 WHEN ^In the .+ pack you see .+ silver-edged greaves
ACTION setvar havenightstick 1 WHEN ^In the .+ pack you see .+ nightstick
ACTION setvar havebola 1 WHEN ^In the .+ pack you see .+ bola
ACTION setvar havethrowing_club 1 WHEN ^In the .+ pack you see .+ throwing club
ACTION setvar havethrowing_hammer 1 WHEN ^In the .+ pack you see .+ throwing hammer
ACTION setvar havebludgeon 1 WHEN ^In the .+ pack you see .+ bludgeon
ACTION setvar havemace 1 WHEN ^In the .+ pack you see .+ \bmace\b
ACTION setvar havewarhammer 1 WHEN ^In the .+ pack you see .+ warhammer
ACTION setvar havechain 1 WHEN ^In the .+ pack you see .+ ball and chain
ACTION setvar havemorning-star 1 WHEN ^In the .+ pack you see .+ morning-star
ACTION setvar havemaul 1 WHEN ^In the .+ pack you see .+ \bmaul\b
ACTION setvar havemattock 1 WHEN ^In the .+ pack you see .+ mattock
ACTION setvar havebaldric 1 WHEN ^In the .+ pack you see .+ baldric
ACTION setvar havehalberd 1 WHEN ^In the .+ pack you see .+ halberd
ACTION setvar haveskinning_knife 1 WHEN ^In the .+ you see .+ skinning knife
ACTION setvar havestiletto 1 WHEN ^In the .+ you see .+ stiletto
ACTION setvar havedao 1 WHEN ^In the .+ you see .+ dao
ACTION setvar haveflat-black_sword 1 WHEN ^In the .+ you see .+ flat-black sword
ACTION setvar havejambiya 1 WHEN ^In the .+ you see .+ jambiya
ACTION setvar havescimitar 1 WHEN ^In the .+ you see .+ scimitar
ACTION setvar haveiltesh 1 WHEN ^In the .+ you see .+ iltesh
ACTION setvar havebroadsword 1 WHEN ^In the .+ you see .+ broadsword
ACTION setvar haveblade 1 WHEN ^In the .+ you see .+ blade
ACTION setvar havebrushed_sword 1 WHEN ^In the .+ you see .+ copper sword
ACTION setvar havegleaming_sword 1 WHEN ^In the .+ you see .+ silver sword
ACTION setvar havegreatsword 1 WHEN ^In the .+ you see .+ greatsword

put look in my $pack
waitforre ^In the .+ pack you see
put look in my $sheath
waitforre ^In the.+$sheath you see|^I could not find

if %havelegwraps = 1 then
{
var repair legwraps
gosub repair1
}
if %havetrousers = 1 then
{
var repair trousers
gosub repair1
}
if %haveironwood_greaves = 1 then
{
var repair ironwood greaves
gosub repair1
}
if %haveivory_greaves = 1 then
{
var repair ivory greaves
gosub repair1
}
if %havegold-edged_greaves = 1 then
{
var repair gold-edged greaves
gosub repair1
}
if %havepolished_greaves = 1 then
{
var repair polished greaves
gosub repair1
}
if %havesilver-edged_greaves = 1 then
{
var repair silver-edged greaves
gosub repair1
}
if %havenightstick = 1 then
{
var repair nightstick
gosub repair1
}
if %havebola = 1 then
{
var repair bola
gosub repair1
}
if %havethrowing_club = 1 then
{
var repair throwing club
gosub repair1
}
if %havethrowing_hammer = 1 then
{
var repair throwing hammer
gosub repair1
}
if %havebludgeon = 1 then
{
var repair bludgeon
gosub repair1
}
if %havemace = 1 then
{
var repair mace
gosub repair1
}
if %havewarhammer = 1 then
{
var repair warhammer
gosub repair1
}
if %havechain = 1 then
{
var repair chain
gosub repair1
}
if %havemorning-star = 1 then
{
var repair morning-star
gosub repair1
}
if %havemaul = 1 then
{
var repair maul
gosub repair1
}
if %havemattock = 1 then
{
var repair mattock
gosub repair1
}
if %havebaldric = 1 then
{
var repair baldric
gosub repair1
}
if %havehalberd = 1 then
{
var repair halberd
gosub repair1
}
if %haveskinning_knife = 1 then
{
var repair skinning knife
gosub repair2
}
if %havestiletto = 1 then
{
var repair stiletto
gosub repair2
}
if %havedao = 1 then
{
var repair dao
gosub repair2
}
if %haveflat-black_sword = 1 then
{
var repair flat-black sword
gosub repair2
}
if %havejambiya = 1 then
{
var repair jambiya
gosub repair2
}
if %havescimitar = 1 then
{
var repair scimitar
gosub repair2
}
if %haveiltesh = 1 then
{
var repair iltesh
gosub repair2
}
if %havebroadsword = 1 then
{
var repair broadsword
gosub repair2
}
if %haveblade = 1 then
{
var repair blade
gosub repair2
}
if %havebrushed_sword = 1 then
{
var repair brushed sword
gosub repair2
}
if %havegleaming_sword = 1 then
{
var repair gleaming sword
gosub repair2
}
if %havegreatsword = 1 then
{
var repair greatsword
gosub repair2
}
goto waitrep

repair1:
send get my %repair
waitforre ^You get|^You are already
send ask %1 about repairing all
send ask %1 about repairing all
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

repair2:
send get my %repair
waitforre ^You get|^You are already
send ask %1 about repairing all
send ask %1 about repairing all
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

waitrep:
pause 20
send read my %1 ticket
matchre get repairs should be ready by now
matchwait 1
goto waitrep

get:
setvar footwraps 0
setvar knee_spikes 0
setvar knuckles 0
setvar elbow_spikes 0
setvar stick 0
setvar greaves 0
setvar gloves 0
setvar gauntlets 0
setvar vambraces 0
setvar coat 0
setvar leathers 0
setvar shirt 0
setvar robe 0
setvar hauberk 0
setvar breastplate 0
setvar plate 0
setvar armor 0
setvar cowl 0
setvar balaclava 0
setvar helm 0
setvar buckler 0
setvar shield 0
setvar longbow 0
setvar ironwood_staff 0
setvar spear 0
setvar legwraps 0
setvar trousers 0
setvar ironwood_greaves 0
setvar ivory_greaves 0
setvar gold-edged_greaves 0
setvar polished_greaves 0
setvar silver-edged_greaves 0
setvar nightstick 0
setvar bola 0
setvar throwing_club 0
setvar throwing_hammer 0
setvar bludgeon 0
setvar mace 0
setvar warhammer 0
setvar chain 0
setvar morning-star 0
setvar maul 0
setvar mattock 0
setvar baldric 0
setvar halberd 0
setvar skinning_knife 0
setvar stiletto 0
setvar dao 0
setvar flat-black_sword 0
setvar jambiya 0
setvar scimitar 0
setvar iltesh 0
setvar broadsword 0
setvar blade 0
setvar brushed_sword 0
setvar gleaming_sword 0
setvar greatsword 0

ACTION setvar footwraps 1 WHEN ^In the large sack you see .+ footwraps
ACTION setvar knee_spikes 1 WHEN ^In the large sack you see .+ knee spikes
ACTION setvar knuckles 1 WHEN ^In the large sack you see .+ knuckles
ACTION setvar elbow_spikes 1 WHEN ^In the large sack you see .+ elbow spikes
ACTION setvar stick 1 WHEN ^In the large sack you see .+ parry stick
ACTION setvar greaves 1 WHEN ^In the large sack you see .+ greaves
ACTION setvar gloves 1 WHEN ^In the large sack you see .+ gloves
ACTION setvar gauntlets 1 WHEN ^In the large sack you see .+ gauntlets
ACTION setvar vambraces 1 WHEN ^In the large sack you see .+ vambraces
ACTION setvar coat 1 WHEN ^In the large sack you see .+ \bcoat\b
ACTION setvar leathers 1 WHEN ^In the large sack you see .+ leathers
ACTION setvar shirt 1 WHEN ^In the large sack you see .+ shirt
ACTION setvar robe 1 WHEN ^In the large sack you see .+ robe
ACTION setvar hauberk 1 WHEN ^In the large sack you see .+ hauberk
ACTION setvar breastplate 1 WHEN ^In the large sack you see .+ breastplate
ACTION setvar plate 1 WHEN ^In the large sack you see .+ gleaming silver plate
ACTION setvar armor 1 WHEN ^In the large sack you see .+ (gleaming silver armor|field armor)
ACTION setvar cowl 1 WHEN ^In the large sack you see .+ cowl
ACTION setvar balaclava 1 WHEN ^In the large sack you see .+ balaclava
ACTION setvar helm 1 WHEN ^In the large sack you see .+ \bhelm\b
ACTION setvar buckler 1 WHEN ^In the large sack you see .+ buckler
ACTION setvar shield 1 WHEN ^In the large sack you see .+ shield
ACTION setvar longbow 1 WHEN ^In the large sack you see .+ longbow
ACTION setvar ironwood_staff 1 WHEN ^In the large sack you see .+ quarter staff
ACTION setvar spear 1 WHEN ^In the large sack you see .+ spear
ACTION setvar legwraps 1 WHEN ^In the large sack you see .+ legwraps
ACTION setvar trousers 1 WHEN ^In the large sack you see .+ trousers
ACTION setvar ironwood_greaves 1 WHEN ^In the large sack you see .+ ironwood greaves
ACTION setvar ivory_greaves 1 WHEN ^In the large sack you see .+ ivory greaves
ACTION setvar polished_greaves 1 WHEN ^In the large sack you see .+ polished gold greaves
ACTION setvar silver-edged_greaves 1 WHEN ^In the large sack you see .+ silver-edged greaves
ACTION setvar nightstick 1 WHEN ^In the large sack you see .+ nightstick
ACTION setvar bola 1 WHEN ^In the large sack you see .+ bola
ACTION setvar throwing_club 1 WHEN ^In the large sack you see .+ throwing club
ACTION setvar throwing_hammer 1 WHEN ^In the large sack you see .+ throwing hammer
ACTION setvar bludgeon 1 WHEN ^In the large sack you see .+ bludgeon
ACTION setvar mace 1 WHEN ^In the large sack you see .+ \bmace\b
ACTION setvar warhammer 1 WHEN ^In the large sack you see .+ warhammer
ACTION setvar chain 1 WHEN ^In the large sack you see .+ ball and chain
ACTION setvar morning-star 1 WHEN ^In the large sack you see .+ morning-star
ACTION setvar maul 1 WHEN ^In the large sack you see .+ \bmaul\b
ACTION setvar mattock 1 WHEN ^In the large sack you see .+ mattock
ACTION setvar baldric 1 WHEN ^In the large sack you see .+ baldric
ACTION setvar halberd 1 WHEN ^In the large sack you see .+ halberd
ACTION setvar skinning_knife 1 WHEN ^In the large sack you see .+ skinning knife
ACTION setvar stiletto 1 WHEN ^In the large sack you see .+ stiletto
ACTION setvar dao 1 WHEN ^In the large sack you see .+ dao
ACTION setvar flat-black_sword 1 WHEN ^In the large sack you see .+ flat-black sword
ACTION setvar jambiya 1 WHEN ^In the large sack you see .+ jambiya
ACTION setvar scimitar 1 WHEN ^In the large sack you see .+ scimitar
ACTION setvar iltesh 1 WHEN ^In the large sack you see .+ iltesh
ACTION setvar broadsword 1 WHEN ^In the large sack you see .+ broadsword
ACTION setvar blade 1 WHEN ^In the large sack you see .+ blade
ACTION setvar brushed_sword 1 WHEN ^In the large sack you see .+ copper sword
ACTION setvar gleaming_sword 1 WHEN ^In the large sack you see .+ silver sword
ACTION setvar greatsword 1 WHEN ^In the large sack you see .+ greatsword

send get my %1 ticket
waitforre ^You get|^You are already
pause
send give %1
waitforre ^You hand
send look in my large sack
waitforre ^In the large sack you see

if %footwraps = 1 then
{
var item footwraps
gosub wear
}
if %knee_spikes = 1 then
{
var item knee spikes
gosub wear
}
if %knuckles = 1 then
{
var item knuckles
gosub wear
}
if %elbow_spikes = 1 then
{
var item elbow spikes
gosub wear
}
if %stick = 1 then
{
var item stick
gosub wear
}
if %greaves = 1 then
{
var item greaves
gosub wear
}
if %gloves = 1 then
{
var item gloves
gosub wear
}
if %gauntlets = 1 then
{
var item gauntlets
gosub wear
}
if %vambraces = 1 then
{
var item vambraces
gosub wear
}
if %coat = 1 then
{
var item coat
gosub wear
}
if %leathers = 1 then
{
var item leathers
gosub wear
}
if %shirt = 1 then
{
var item shirt
gosub wear
}
if %robe = 1 then
{
var item chain robe
gosub wear
}
if %hauberk = 1 then
{
var item hauberk
gosub wear
}
if %breastplate = 1 then
{
var item breastplate
gosub wear
}
if %plate = 1 then
{
var item plate
gosub wear
}
if %armor = 1 then
{
var item armor
gosub wear
}
if %cowl = 1 then
{
var item cowl
gosub wear
}
if %balaclava = 1 then
{
var item balaclava
gosub wear
}
if %helm = 1 then
{
var item helm
gosub wear
}
if %buckler = 1 then
{
var item buckler
gosub wear
}
if %shield = 1 then
{
var item shield
gosub wear
}
if %longbow = 1 then
{
var item longbow
gosub wear
}
if %ironwood_staff = 1 then
{
var item ironwood staff
gosub wear
}
if %spear = 1 then
{
var item spear
gosub wear
}
if %legwraps = 1 then
{
var item legwraps
gosub pack
}
if %trousers = 1 then
{
var item trousers
gosub wear
}
if %ironwood_greaves = 1 then
{
var item ironwood greaves
gosub pack
}
if %ivory_greaves = 1 then
{
var item ivory greaves
gosub pack
}
if %gold-edged_greaves = 1 then
{
var item gold-edged greaves
gosub pack
}
if %polished_greaves = 1 then
{
var item polished greaves
gosub pack
}
if %silver-edged_greaves = 1 then
{
var item silver-edged greaves
gosub pack
}
if %nightstick = 1 then
{
var item nightstick
gosub pack
}
if %bola = 1 then
{
var item bola
gosub pack
}
if %throwing_club = 1 then
{
var item throwing club
gosub pack
}
if %throwing_hammer = 1 then
{
var item throwing hammer
gosub pack
}
if %bludgeon = 1 then
{
var item bludgeon
gosub pack
}
if %chain = 1 then
{
var item chain
gosub pack
}
if %warhammer = 1 then
{
var item warhammer
gosub pack
}
if %morning-star = 1 then
{
var item morning-star
gosub pack
}
if %maul = 1 then
{
var item maul
gosub pack
}
if %mattock = 1 then
{
var item mattock
gosub pack
}
if %baldric = 1 then
{
var item baldric
gosub pack
}
if %halberd = 1 then
{
var item halberd
gosub pack
}
if %skinning_knife = 1 then
{
var item skinning knife
gosub sheath
}
if %stiletto = 1 then
{
var item stiletto
gosub sheath
}
if %dao = 1 then
{
var item dao
gosub sheath
}
if %flat-black_sword = 1 then
{
var item flat-black sword
gosub sheath
}
if %jambiya = 1 then
{
var item jambiya
gosub sheath
}
if %scimitar = 1 then
{
var item scimitar
gosub sheath
}
if %iltesh = 1 then
{
var item iltesh
gosub sheath
}
if %broadsword = 1 then
{
var item broadsword
gosub sheath
}
if %blade = 1 then
{
var item blade
gosub sheath
}
if %brushed_sword = 1 then
{
var item brushed sword
gosub sheath
}
if %gleaming_sword = 1 then
{
var item gleaming sword
gosub sheath
}
if %greatsword = 1 then
{
var item greatsword
gosub sheath
}
goto empty

wear:
send get %item from my large sack
waitforre ^You get|^What
send wear my %item
waitforre ^You|^Perhaps|^Wear|^What
return

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

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

empty:
send look in my large sack
waitforre ^There is nothing in there
send put my large sack in bucket
goto get