[HELP] I Need script for target

Ask for scripts here

Moderators: Murderator+, Murderator

Post Reply
Azt
Posts: 43
Joined: 2007-09-03 16:31:57

[HELP] I Need script for target

Post by Azt »

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?
CuHTpoH
Posts: 287
Joined: 2007-11-01 19:09:30
Location: Moscow
Contact:

Post by CuHTpoH »

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: Select all

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: Select all

# 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
Nmy
Expert!
Posts: 2152
Joined: 2005-09-14 15:31:58
Location: Latvia

Re: [HELP] I Need script for target

Post by Nmy »

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.
CuHTpoH
Posts: 287
Joined: 2007-11-01 19:09:30
Location: Moscow
Contact:

Post by CuHTpoH »

indeed it is
**Выставляем отступы в скриптах*** ©Destruction
Feel the Power of Dark Side
Azt
Posts: 43
Joined: 2007-09-03 16:31:57

Post by Azt »

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
CuHTpoH
Posts: 287
Joined: 2007-11-01 19:09:30
Location: Moscow
Contact:

Post by CuHTpoH »

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
CuHTpoH
Posts: 287
Joined: 2007-11-01 19:09:30
Location: Moscow
Contact:

Post by CuHTpoH »

string of check will be like that:
IF uo.findentry('Destroyer',getnam(uo.getserial('finditem'))) then
**Выставляем отступы в скриптах*** ©Destruction
Feel the Power of Dark Side
Post Reply