Version 1.1
New features in this version:
* You can select now the runebook when you execute the script.
* If they are near, the character will buy in all the vendors of the shop.
* Added support for one more vendor type.
Code:
###################################################
### Script Name: Buy Regs
###################################################
### Author: Dearhell / dearhell666@hotmail.com
###################################################
### Version: 1.1
###################################################
### Tested with: 2.03 client, Sphere 0.55i, shard VTR ( www.coliseouo.tk )
###################################################
### Description: Script for buying regs
###################################################
### Revision Date: 10/02/05
###################################################
### Public Release: 06/02/05
###################################################
#How it works: The character goes recalling from shop to shop, and he buys regs on them.
#If he has not enough mana, he drinks a mana bottle.
###################################################
### Setup Instructions:
### Select the runebook you are going to use.
### The runes must be in this order: First spot: magery shop 1, Second spot, magery shop 2
### . . . n Spot Rune to your home. I.e: Spot 1: britain, spot 2: magincia, spot 3: vesper,
### spot 4: home
### Comment these lines after the first time you use the script, because you only need to add your
### runebook the first time you run the script.
###################################################
sub buyRegs()
UO.Print('Add the Runebook you are going to use')
UO.AddObject('magery')
while UO.Targeting()
wait(200)
wend
UO.Print('Runebook selected')
UO.SaveConfig()
###################################################
### These variables must be setted up.
###################################################
VAR shopsQuantity=9 ;the number of shops you have in your runebook
VAR buyListName='regs' ;the name of your buy list
###################################################
#Recalling is set up in order that the shop runes must start from the first Runebook spot
###################################################
VAR recallNumber=20
###################################################
Dim vendorType[2]
vendorType[1]='0x0190'
vendorType[2]='0x0191'
VAR i=0
VAR x
shopsQuantity=ShopsQuantity+1
UO.Exec("set norbcheck 1") ;In order to recall
UO.Exec("set norbcalc 1") ;In order to recall
UO.Exec("set finddistance 3")
For i=1 to shopsQuantity
UO.Recall('magery',recallNumber)
wait(3000)
UO.Useskill('Meditation')
wait(3000)
For x=1 to 2
repeat
UO.FindType(vendorType[x],-1,'ground')
If (UO.GetName('finditem')==UO.GetName()) then
UO.Print('We delete the character name from the search list')
UO.Ignore('finditem')
UO.FindType(vendorType[x],-1,'ground')
wait(5000)
endIf
if UO.FindCount()<>0 then
UO.Print('We buy regs from -> '+UO.GetName('finditem'))
wait(1000)
UO.Say('Hi '+UO.GetName('finditem'))
wait(2000)
UO.Buy(buyListName,UO.GetName('finditem'))
wait(2000)
UO.Ignore('finditem')
EndIf
Until UO.FindCount()==0
Next
if (UO.Mana<15) then
UO.UseType('mana')
EndIf
recallNumber=recallNumber+2
Next
UO.Recall('magery',recallNumber)
UO.Exec("set finddistance 14")
UO.IgnoreReset()
End Sub