Yoko

All sides of Injection
It is currently 2025-10-16 23:35:17

All times are UTC+02:00




Post new topic  Reply to topic  [ 7 posts ] 
Author Message
PostPosted: 2009-09-18 11:11:35 
Offline

Joined: 2007-09-03 16:31:57
Posts: 43
Hi!

I need a script that if I Say "Destroyer" in game, or Destr, or Des, the script search a player called like that ad add it to objects.

it's possible?


Top
   
 Post subject:
PostPosted: 2009-10-05 21:28:08 
Offline
User avatar

Joined: 2007-11-01 19:09:30
Posts: 287
Location: Moscow
before start scripts delete journal text with destr by uo.deletejournal() or by deljournal() (custom func, find it in this forum, also find checklag())
...
if uo.injournal('des') then
...

check that Track world items is ON
find players (0x0190 and 0x0191) on the ground
click and get their names
use 2 funcs -

Code:
sub getnam(id)
   var timez,t1="World save has been initiated"
   deljournal(t1)
   if uo.getname(id)=='' then
      uo.click(id)
      timez=uo.timer()+10
      while timez>uo.timer() and uo.getname(id)==''
         if uo.injournal(t1) then
            deljournal(t1)
            checklag()
            timez=uo.timer()+10
         endif
         wait(100)
      wend
      if timez<uo.timer() then
         return false
      endif
   endif
   return uo.getname(id)
endsub


Code:
# finds one string in another
; int findentry( string, string )
; entry - what we seek for
; str - in which string
sub findentry(entry,str)
   var i
   for i=0 to strlen(str)-strlen(entry)
      if mid(str,i,strlen(entry))==entry then
         return i
      endif
   next
   return -1
endsub


so if findentry() gives number bigger than -1 - there is des in name, than get it's serial

_________________
**Выставляем отступы в скриптах*** ©Destruction
Feel the Power of Dark Side


Top
   
PostPosted: 2009-10-05 23:00:06 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
Azt wrote:
Hi!

I need a script that if I Say "Destroyer" in game, or Destr, or Des, the script search a player called like that ad add it to objects.

it's possible?


I would search the journal, get the serial and set laststatus/lastattack/lasttarget with this serial so you can attack imediatly.
To filter it from regular speech you can make it work using some symbol - for example
:Nickname - would trigger the script.

Why do you need such thing anyway? For PvP? That's a lame pvp if you ask me.

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


Top
   
 Post subject:
PostPosted: 2009-10-06 07:57:53 
Offline
User avatar

Joined: 2007-11-01 19:09:30
Posts: 287
Location: Moscow
indeed it is

_________________
**Выставляем отступы в скриптах*** ©Destruction

Feel the Power of Dark Side


Top
   
 Post subject:
PostPosted: 2009-10-06 13:32:16 
Offline

Joined: 2007-09-03 16:31:57
Posts: 43
Sub Checklag()
deljournal('a backpack')
uo.click('backpack')
repeat
wait(50)
until uo.injournal('a backpack')
endsub

Sub deljournal(msg)
while uo.injournal(msg)
uo.setjournalline(uo.injournal(msg)-1,"")
wend
endsub

found this!

thanks


Top
   
 Post subject:
PostPosted: 2009-10-06 14:19:12 
Offline
User avatar

Joined: 2007-11-01 19:09:30
Posts: 287
Location: Moscow
Try to never use wait(X) where X<100
MUCH bigger chance of crash or unhandled exception in parser

_________________
**Выставляем отступы в скриптах*** ©Destruction

Feel the Power of Dark Side


Top
   
 Post subject:
PostPosted: 2009-10-06 14:21:42 
Offline
User avatar

Joined: 2007-11-01 19:09:30
Posts: 287
Location: Moscow
string of check will be like that:
IF uo.findentry('Destroyer',getnam(uo.getserial('finditem'))) then

_________________
**Выставляем отступы в скриптах*** ©Destruction

Feel the Power of Dark Side


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 5 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