Yoko

All sides of Injection
It is currently 2024-03-28 17:56:34

All times are UTC+02:00




Post new topic  Reply to topic  [ 14 posts ] 
Author Message
PostPosted: 2007-02-20 12:57:46 
Offline

Joined: 2007-02-20 12:50:33
Posts: 6
would you guys be able to make a function such as:
UO.Move([Direction], [SpaceCount]))

a few examples would be

UO.Move(N, 5)
UO.Move(NE, 4)
UO.Move(E, 4)


Top
   
 Post subject:
PostPosted: 2007-02-20 15:47:31 
Offline
Expert!
User avatar

Joined: 2004-10-15 22:38:04
Posts: 1396
Location: Moscow City.
You can use uo.drop

_________________
The End.


Top
   
 Post subject:
PostPosted: 2007-02-20 19:15:36 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
Code:
UO.Drop('5',STR(UO.GetX('self')+?),STR(UO.GetY('self')-?),STR(UO.GetZ('self')),'finditem')

you can drop in anywhere

_________________
Уроки языка Injection
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net


Top
   
 Post subject:
PostPosted: 2007-02-21 03:37:43 
Offline

Joined: 2007-02-20 12:50:33
Posts: 6
im not quiet sure how to implement that?


Top
   
 Post subject:
PostPosted: 2007-02-21 08:19:35 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
Code:
STR(UO.GetX('self')+?)


for example your char is standing on 2514 x in script you can write to drop finditem
Code:
STR(UO.GetX('self')-2)


script will drop finditem in 2512 x and you'r "y"

you can write UO.GetX('self')-2 or +2 or +7 it doesn't metter

_________________
Уроки языка Injection
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net


Top
   
 Post subject:
PostPosted: 2007-02-21 09:35:12 
Offline

Joined: 2007-02-20 12:50:33
Posts: 6
when i use

Code:
UO.Drop('5',STR(UO.GetX('self')+2),STR(UO.GetY('self')-7),STR(UO.GetZ('self')),'finditem')


it says
Quote:
Invalid serial or object


if i replace 'finditem' with my serial,

Code:
UO.Drop('5',STR(UO.GetX('self')+2),STR(UO.GetY('self')-7),STR(UO.GetZ('self')),0x000ea976)


it says
Quote:
Can't pickup item


Code:
UO.Drop('5',STR.UO.GetX('self')+0, STR(UO.GetY('self)-5), STR(UO.GetZ('self'),'self')


it gives me the error
Quote:
(CHARACTER NAME)
Can't pickup item.


if anyone can give me a working example of the code, i would appreciate it.


Top
   
 Post subject:
PostPosted: 2007-02-21 11:40:32 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
Code:
uo.drop([quantity],[X,Y,Z],[object])


Code:
sub seno()
   var x, y
     x=uo.getX('laststatus')
     y=uo.getY('laststatus')
   var i,Exit
      DIM seno[3]
       seno[0]=0x0F36 ; #Bse 3 tipa sena
       seno[1]=0x100C ;#-\\-\\-\\-\\-\\-
       seno[2]=0x100D ;#-\\-\\-\\-\\-\\-
      For i=0 to 2
       Exit=0
     uo.FindType(seno[i],'-1','backpack')
     uo.Drop('1', x-1, y, 0, 'finditem')
      wait(3)
        next
     uo.FindType(seno[i],'-1','backpack')
     uo.Drop('1', x+1, y, 0, 'finditem')
endsub


Code:
   uo.findtype(musor,'-1','2')
   if uo.findcount() then
      uo.drop("1",str(uo.getx(x)),str(uo.gety(x)-1),0,"finditem")
   endif


Code:
UO.FindType(T,C,'backpack')
If C < 0 Then
C = UO.GetColor('finditem')
endif
Var b = UO.GetSerial('finditem')
UO.FindType(T,C,'ground')
Var g = UO.GetSerial('finditem')
UO.MoveItem(b, '0', g,str(uo.getx(g)),str(uo.gety(g)),'0')
Wait(500)


Code:
uo.moveitem(object,[quantity,containerobject/ground,[x,y,z]])


it's like
Code:
uo.moveitem('WhatToMove','how much','Where',you can setX,Y,Z)

'WhatToMove' - for example "finditem"
'how much' - "15"
'where' - "backpack" ; "0x1234567"(serial) ; "ground"
you can set X,Y,Z - remember if your setting X,Y,Z you must write all 3 parametrs, Z cordinate always is 0 so you can write just 0 or if you need to move something up or down you can set STR or direct number, they are always numbers and without "" but you can get numbers with STR and its no different
so for example x=458 you can write STR(uo.getx()) if you are standing on x=458 its like now x = STR(uo.getX())
if you have uo.getX() without anything - default its your character cordinates but you can get X from almoust anything like
uo.getX('serial')
uo.getX('self')
uo.getX('object')
Objects: lastobject ; lasttarget ; backpack ; lastcontainer ; laststatus ; lastattack ; lastequip ; lasthorse ; lastcorpse ; finditem ; self ;
maybe you will also need Track World Items
so the very simple example
uo.findtype('0xtype') - it will search for any item with this type in your characters backpack
Code:
uo.findtype('0xtype')
if uo.findcount() then
uo.moveitem( "finditem" , "all" , "ground" , STR(uo.getX()) , STR(uo.getY()) , 0 )

_________________
Уроки языка Injection
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net


Top
   
 Post subject:
PostPosted: 2007-02-21 13:50:20 
Offline

Joined: 2007-02-20 12:50:33
Posts: 6
can you just show me the code to track ect. in a code bracket to move 5 spaces in any direction relative to where u r standing that will work? thanks in advance.


Top
   
 Post subject:
PostPosted: 2007-02-21 14:20:33 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
like?
Code:
if uo.getdir() == ? then
uo.moveitem( "finditem" , "5" , "ground" , STR(uo.getX()+5) , STR(uo.getY()) , 0 )
endif
if uo.getdir() == ? then
uo.moveitem( "finditem" , "5" , "ground" , STR(uo.getX()-5) , STR(uo.getY()) , 0 )
endif

etc etc you have 4 directions or 8

btw tiles not spaces

_________________
Уроки языка Injection
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net


Top
   
 Post subject:
PostPosted: 2007-02-21 23:15:31 
Offline

Joined: 2007-02-20 12:50:33
Posts: 6
when i use that code it says object not found. and the if statement gives me an error.

Only the lines of code u need to move 5 tiles, which will work when i implement it.


Top
   
 Post subject:
PostPosted: 2007-02-22 00:01:55 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
t r y t o u n d e r s t a n d

I think you have enough information to write you'r own code - good luck

_________________
Уроки языка Injection
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net


Top
   
 Post subject:
PostPosted: 2007-02-22 09:13:50 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
O'k give me brackets type

_________________
Уроки языка Injection
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net


Top
   
PostPosted: 2007-02-22 11:27:45 
Offline

Joined: 2007-02-20 12:50:33
Posts: 6
I cant read the language of the writer of this code, but thanks for the send_step function

Quote:
# Direction Legend #
# For the move function. #
# ----------------------------
#north -- send_step(33,0)
#north east -- send_step(39,1)
#east -- send_step(34,2)
#south east -- send_step(40,3)
#south -- send_step(35,4)
#south west -- send_step(37,5)
#west -- send_step(36,6)
#north west -- send_step(38,7)


here is the code i wrote to move a certain amount of steps in a specific direction, besides the send_step function. Maybe this function can be implemented and enumerated to make programming easier? and have a small algorithm to make sure the client has moved to the correct tile.
Code:

#DONT CHANGE THIS FUNCTION.
sub send_step(keycode,dir)
   var x = UO.GetX()
   var y = UO.GetY()
   var timeout = 0
   if UO.GetDir()<>dir then
      UO.Press(keycode)
      Repeat
         wait(50)
      Until UO.GetDir()==dir
   endif
   UO.Press(keycode)
   Repeat
      timeout=timeout+50
      wait(50)
   Until x<>UO.GetX() || y<>UO.GetY() || timeout>2000
   if timeout>2000 then
      return 0
   endif
   return 1
end sub

#DONT CHANGE THIS FUNCTION
sub move(keycode,dir,numberOfTiles)
   var i = 0
   var x = UO.GetX()
   var y = UO.GetY()
   Repeat
      x = UO.GetX()
      y = UO.GetY()
      Repeat
         send_step(keycode,dir)
         CheckLag()
      Until x <> UO.GetX() || y <> UO.GetY()
      i = i + 1
   Until i == numberOfTiles
end sub


sub CheckLag()
   UO.Click('backpack')
   Repeat
      Wait(1000)
   Until UO.InJournal('backpack')
   UO.DeleteJournal()
end sub



Top
   
 Post subject:
PostPosted: 2007-02-22 14:53:33 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
ok now I get it...
i think all you need is send_step(keycode,dir,count)
and then make this function like
Code:
for n = 0 to count

like how many steps
or you can just use code
Code:
for n = 1 to 5
send_step()
next

or you need me to do it ?

_________________
Уроки языка Injection
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 14 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited