sub dress()
; by Korzhik
; v.2.1b
;var t = uo.timer()
var bandages = 200
var regs = 2
var potions = 6
var arrows = 0
; Horse. l - llama, z - zostr, cl - colored llama, cz - colored zostr
var horse = 'l'
var mm = 0 ; moms
var blood = 0
var restores = 0
var healstones = 0
; b - bers, n - nekr, h - human, a - ama, v - vamp, auto - auto:)
var race = 'auto'
var armor = 'auto'
var gs = false ; true - gs, false - no gs
; 1 more crystal armor. true || false
var crystal = true
var bow = 0
dress.start( bandages, regs, potions, arrows, horse, mm, blood, restores, healstones, race, armor, gs, crystal, bow )
t = (UO.timer() - t) / 10
UO.msg("done in "+ str(t)+ " sec")
UO.msg("by Korzhik.")
endsub
sub dress.start( bandages, regs, potions, arrows, horse, mm, blood, restores, healstones, race, armor, gs, crystal, bow )
uo.textclear()
if uo.dead() then
uo.msg( '.home' )
wait( 10000 )
endif
var plen = 5
dim packIndex[val(str(plen))]
packIndex[0] = '1' ; 100 band
packIndex[1] = '2' ; 1 potions
packIndex[2] = '3' ; 1 reg
packIndex[3] = dress.horse( horse )
packIndex[4] = '6' ; 100 arr
dim packItems[val(str(plen))]
packItems[0] = bandages
packItems[1] = potions
packItems[2] = regs
packItems[4] = arrows
dim packTypes[val(str(plen))]
packTypes[0] = '0x0E21'
packTypes[1] = '0x09B0'
packTypes[2] = '0x0E76'
packTypes[4] = '0x0F3F'
if uo.countground('0x0ED4') then
uo.set('finddistance','3')
var i,n,j
var equip_stone = dress.getStone('0x079B', false)
var armor_stone = dress.getStone('0x08BB', false)
var weapon_stone = dress.getStone('0x04B0', false)
var guild_stone = dress.getStone('-1', true)
;uo.textprint(armor_stone)
if not uo.ObjAtLayer('Torso') or uo.count('0x0EFA') == 0 then ; pack check
use( 'backpack' )
wait(5)
endif
for i = 0 to plen - 1
if i == 3 then
if not uo.ObjAtLayer('Horse') then
uo.recall( equip_stone, packIndex[i] )
repeat
wait(5)
until uo.ObjAtLayer('Horse')
endif
else
if packItems[i] then
while ( uo.count( packTypes[i] ) <> packItems[i] )
uo.recall( equip_stone, packIndex[i] )
deljournal( 'You put' )
repeat
wait(5)
until uo.injournal( 'You put' )
wend
endif
endif
next
var pvp = get('ch_pvp')
if not uo.ObjAtLayer('Torso') then
if not gs then
if (pvp == 'N/A' || val(pvp) == 0) then
pvp = dress.setPVP( armor_stone )
endif
if armor == 'auto' then
if race == 'n' || race == 'a' then
# ama arm
# leather arm
else
pvp = val(pvp)
uo.recall( armor_stone, dress.getArmorIndex(pvp) )
endif
else
uo.recall( armor_stone, armor )
endif
else
# guild armor
endif
repeat
wait(5)
until uo.ObjAtLayer('Torso')
endif
if bow then
uo.recall( weapon_stone, '4' )
while uo.LastGump('replyed') <> 0
wait(5)
wend
uo.lclick(215,226)
endif
if crystal then
uo.recall( armor_stone, '11' )
wait(100)
if (pvp < 270 || get('ch_mainarm') == 'N/A' || get('ch_mainarm') == '0x0000' ) then
uo.findType('0x1412', ' -1', 'backpack')
#uo.textprint(uo.getcolor('finditem'))
set('ch_mainarm', uo.getcolor('finditem'))
endif
endif
dress.equipRaceItems( race )
endif
#uo.msg( 'dress script by Korzhik' )
endsub
sub dress.getArmorIndex( p )
dim a[7]
a[0] = 270
a[1] = 215
a[2] = 155
a[3] = 65
a[4] = 35
a[5] = 15
dim r[7]
r[0] = '7'
r[1] = '6'
r[2] = '5'
r[3] = '4'
r[4] = '3'
r[5] = '2'
for var i = 0 to 5
if p > a[i] then
return r[i]
endif
next
return '1'
endsub
sub dress.equipRaceItems( race )
endsub
sub dress.setPVP( s )
use(s)
while uo.LastGump('replyed') <> 0
wait(5)
wend
var txt = uo.LastGump('text', 17)
;uo.textprint(txt + ' ' + s)
uo.rclick(189,275)
return set('ch_pvp', explode(txt, ' ', 2))
endsub
sub dress.getStone(c,g)
var t = '0x0ED4'
if g then
t = '0x151C'
endif
uo.findtype ( t, c, 'ground' )
return uo.getserial( 'finditem' )
endsub
sub dress.horse(n)
dim s[4]
s[0] = 'l'
s[1] = 'cl'
s[2] = 'z'
s[3] = 'cz'
dim r[4]
r[0] = 8
r[1] = 10
r[2] = 4
r[3] = 5
for var i = 0 to 3
if s[i] == n then
return r[i]
endif
next
return r[0]
endsub
; ------- end of dress ---------