Page 1 of 1

unneeded ore drop.

Posted: 2009-02-09 18:57:10
by Ever1x
I want script that will drop unneeded ores.
when i run script, if he finds iron cooper or bronze he drops it.
sub dropore()
var iron ='type,colour'
var cooper ='type,colour'
var bronze ='type,colour' ; ??? right
.....

Re: unneeded ore drop.

Posted: 2009-02-09 19:15:14
by Kynep
Ever1x wrote:I want script that will drop unneeded ores.
when i run script, if he finds iron cooper or bronze he drops it.
??? right
.....


No, here is algorytm, next think your self:

Code: Select all

sub dropore()
   var i, a
   DIM color[10]
   DIM types[4]

   color[0] = ' '
   color[1] = ' '
   color[2] = ' '
   ...
   color[9] = ' '

   types[0] =  ' '
   types[1] =  ' '
   types[2] =  ' '
   types[3] =  ' '
 
   for a = 0 to 3
      for i = 0 to 9
         UO.FindType(types[a], color[i], 'backpack')
         If UO.FindCount() > 0 then
            repeat
               UO.MoveItem('finditem', '-1', 'ground')
               wait(1000)
               UO.FindType(types[a], color[i], 'backpack')
            until NOT UO.FindCount()
         endif
      next
   next
end sub

Posted: 2009-02-09 20:42:31
by Kynep
I make some mistake, sorry :oops: . Try new script.

Posted: 2009-02-09 20:51:11
by Ever1x
you only changed types and colors?

sub mine()
UO.DeleteJournal()
var x, y, i, tmp, inside, moveX, moveY, st, first
st=0
first=UO.GetX()
start:
inside=0
for y=-2 to 2
for x=-2 to 2

try:
UO.Exec ("waittargettile "+" 1340 "+STR(UO.GEtX()+x)+" "+STR(UO.GetY()+y)+" 0")
UO.exec ("usetype 0x0E85")
#UO.Print (""+STR(x))
#UO.Print (""+STR(y))
i=0
while i< 100
if UO.InJournal("You loosen some rocks but fail to find any useable ore") then
wait (300)
i=200
UO.DeleteJournal()
goto try
endif
if UO.InJournal("Try mining elsewhere") then
i=200
UO.DeleteJournal()
endif
if UO.InJournal("You must wait to perform another action") then
wait (300)
i=200
UO.DeleteJournal()
goto try
endif
if uo.InJournal("till")then
uo.playwav("C:\WINDOWS\Media\ringin.wav")
gumpclick()
wait(300)
i=200
UO.DeleteJournal()
goto try
endif
if uo.InJournal("Elemental") or uo.InJournal("is attacking you")then
uo.playwav("C:\WINDOWS\Media\ringin.wav")
killelem()
uo.useobject("sword")
i=200
UO.DeleteJournal()
goto try
endif
if UO.InJournal("There is nothing here to mine for") then
wait (200)
i=200
UO.DeleteJournal()
endif
if UO.InJournal("You have no line of sight to that location") then
wait (300)
i=200
UO.DeleteJournal()
endif
wait (500)
;UO.FindType(0x19B9, 0x06D6, 2)
;UO.Drop('0',STR(UO.GetX('self')),STR(UO.GetY('self')),STR(UO.GetZ('self')),'finditem')
i=i+1
wend
next
next

if st == 0 then
no_ore()
uo.print("!! RUDA ZAKONCHILAS !!")
endif
endsub


What does these things mean?

Posted: 2009-02-09 21:46:26
by Kynep
Ever1x wrote:you only changed types and colors?

No. I add new for-next cicle. Fist script not work corectly.

Posted: 2009-02-09 22:25:57
by Ever1x
what does i mean? I can't get it.