how to get an automatic SERIAL

Ask for help

Moderators: Murderator+, Murderator

Post Reply
creaturez
Posts: 9
Joined: 2004-11-02 21:52:22
Contact:

how to get an automatic SERIAL

Post by creaturez »

i have this piece of code

uo.addobject('corpose')
while uo.targeting()
wait(100)
wend

but I target every time the same type (a corpose) manually...

now i'm trying to find an automatic method to get the serial of the corpose that's under me; is there a function like
uo.getserialfromground(obj_type) or are ther any triks to do this?

ciao ciao andre
dagoFee
AGRS
Expert!
Posts: 1007
Joined: 2004-04-04 21:40:09
Contact:

Post by AGRS »

Code: Select all

Sub GetSerialFromGround()
  UO.GetSerial('~0x0000')
End Sub


Code: Select all

Sub GetSerialFromGround()
  UO.FindType('0x0000','0x0000','ground')
  If UO.FindCount()>0 Then
    Return UO.GetSerial('finditem')
  Else
    Return 0
  EndIf
End Sub
creaturez
Posts: 9
Joined: 2004-11-02 21:52:22
Contact:

Post by creaturez »

i'm trying to use your function in a simple way but doesn't work
where is the mistake?

sub main()
var SERIAL
SERIAL=GetSerialFromGround()
UO.Print(STR(SERIAL))
end sub

it prompts "0" every time

UO.FindType('0x0000','0x0000','ground')

what's ground? i put there 0x2006 (type of corpose) but doesn't work
dagoFee
AGRS
Expert!
Posts: 1007
Joined: 2004-04-04 21:40:09
Contact:

Post by AGRS »

UO.Print(STR(SERIAL)) --> UO.Print(SERIAL)
creaturez
Posts: 9
Joined: 2004-11-02 21:52:22
Contact:

Post by creaturez »

thanks : )
dagoFee
Post Reply