Findobject!

Ask for scripts here

Moderators: Murderator+, Murderator

Post Reply
Ever1x
Posts: 38
Joined: 2009-02-09 17:12:23

Findobject!

Post by Ever1x »

First of all, is it possible to find items by serial?

Code: Select all

sub objsearch()
uo.findtype('SafeZone',-1,'backpack')
if UO.GetQuantity('finditem') then
uo.print("You can recall to safe zone!")
else
uo.exec('addobject SafeZone')
while uo.targeting()
wait(100)
wend
uo.saveconfig()
end if
end sub


I hope u can understand!
Scripts Writer
Posts: 2259
Joined: 2005-04-19 18:00:29
Location: Московская область
Contact:

Post by Scripts Writer »

Code: Select all

if uo.GetQuantity(serial) > 0 then
  #do something
endif
Ever1x
Posts: 38
Joined: 2009-02-09 17:12:23

Post by Ever1x »

and if its a horse?
If not objatlayer(Horse) and (CANT FIND Horse ID) then
end if
Ever1x
Posts: 38
Joined: 2009-02-09 17:12:23

Post by Ever1x »

is it possible?
UP
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

Code: Select all

If not uo.objatlayer("Horse") and uo.getQuantity("Horse ID") == 0 then
endif
Is the problem?
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Telegram: @tatikom
Ever1x
Posts: 38
Joined: 2009-02-09 17:12:23

Post by Ever1x »

Code: Select all

sub main()
var id1=0x01267EC9
UO.Set('finddistance', '15')
UO.FindType('0x0191', -1,'ground')
if uo.findcount() then
uo.print('Found by Type')
if uo.getserial('finditem') ==id1 or uo.getquantity(id1)>0 then
uo.print('Found by serial')
end if
end if
end sub


This scp doesn't print found by serial! Why?
Savage
Expert!
Posts: 1205
Joined: 2004-04-04 11:13:54
Location: Балаково, Саратовская обл.
Contact:

Post by Savage »

var id1='0x01267EC9'
Horse is mobile object, try on TWI checkbox to find by type.
Try uo.print(STR(UO.GetSerial('finditem')))
Ever1x
Posts: 38
Joined: 2009-02-09 17:12:23

Post by Ever1x »

Could u tell me what is TWI? U can use russian, I uderstand russian, but not perfect! :(

Oh I uderstood, TWI is Track World Items! :)

It prints out value 0! Should be 1?
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Post by Mirage »

mb:

Code: Select all

sub main()
var id1='0x01267EC9'
UO.Set('finddistance', '15')
 UO.FindType('0x0191', -1,'ground')
   if uo.findcount() then
      uo.print('Found by Type')
      if uo.getserial('finditem') == id1 then
         uo.print('Found by serial')
       else
         uo.print('Looozzz!!')
     end if
   end if
end sub

try this
Ever1x
Posts: 38
Joined: 2009-02-09 17:12:23

Post by Ever1x »

Worked, but what there is different? :D
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Post by Mirage »

var id1='0x01267EC9' <--
Эээ как бы сказать по не нашенски... УЧИ ЯЗЫК екарный бабай! :lol:
Ever1x
Posts: 38
Joined: 2009-02-09 17:12:23

Post by Ever1x »

Forgot to put ''! Omg, Cant believe!
Ever1x
Posts: 38
Joined: 2009-02-09 17:12:23

Post by Ever1x »

UP

Code: Select all

sub main() 
var id1='Horse'
UO.Set('finddistance', '5')
 UO.FindType('0x00CC', -1,'ground')
   if uo.findcount() then
      uo.print('Found by Type')
      if uo.getserial('finditem') == id1 then
         uo.print('Found by serial')
       else
      uo.exec('addobject Horse')
      while uo.targeting()
        wait(100)
      wend
      uo.saveconfig()
     end if
   end if
end sub


'Horse' Is an object. Added with exec('addobject ')

I want to know the way, how can I use in scp objects/Types which is already in injection!
Savage
Expert!
Posts: 1205
Joined: 2004-04-04 11:13:54
Location: Балаково, Саратовская обл.
Contact:

Post by Savage »

What you mean under: "how can I use in scp objects/Types which is already in injection"?
Ever1x
Posts: 38
Joined: 2009-02-09 17:12:23

Post by Ever1x »

I thought that some wouldn't understand.
In Injection there is sections Objects, Object Types. You don't need to declare variables, var Horse in this situation. And u may use exec('addobject XXXX') to Create a new "Variable For Object" or just update old ones.
Savage
Expert!
Posts: 1205
Joined: 2004-04-04 11:13:54
Location: Балаково, Саратовская обл.
Contact:

Post by Savage »

Code: Select all

if uo.getserial('finditem') == 'Horse' then

U need it?
Ever1x
Posts: 38
Joined: 2009-02-09 17:12:23

Post by Ever1x »

Yes I need that place! :)
Ever1x
Posts: 38
Joined: 2009-02-09 17:12:23

Post by Ever1x »

Found out how! :D No need to reply anyone.
Post Reply