Need help with script

Ask for help

Moderators: Murderator+, Murderator

Post Reply
Mazer
Posts: 125
Joined: 2007-11-13 00:39:14

Need help with script

Post by Mazer »

any ideas how to improve it ?

Code: Select all

sub CheckingPlayers()
VAR a, b
uo.ignore('self', 'on')
DIM Chars[2]
Chars[0] = '0x0190' #boba
Chars[1] = '0x0191' #ciuvas
while not uo.dead()
  for a = 0 to 1 
    while val(uo.getglobal('find')) == 1
      wait(50)
    wend
    uo.set('finddistance', '20')
    uo.findtype(Chars[a], '-1', '1')
    if uo.findcount() > 0 then
       uo.exec('exec recnamo')
      return
    else
      wait(500)
    endif
  next
wend
end sub

Some times it dosent work.. and dont recall.. just stops..
and recnamo()

Code: Select all

sub recnamo()
var a
VAR d = uo.getx('self')
run()
uo.deletejournal()
repeat
   uo.deletejournal()
   uo.waittargetobject('0x4000465D')
   uo.cast('Recall')
   a = 0
    repeat
      wait(100)
      a = a + 1
    until a > 36 or d <> uo.getx('self') or uo.injournal('fizzles')
until not uo.injournal('fizzles')
end sub
CuHTpoH
Posts: 287
Joined: 2007-11-01 19:09:30
Location: Moscow
Contact:

Re: Need help with script

Post by CuHTpoH »

Mazer wrote:any ideas how to improve it ?

Code: Select all

sub CheckingPlayers()
VAR a, b
uo.ignorereset # added
uo.ignore('self') # deleted ", 'on'"
DIM Chars[2]
Chars[0] = '0x0190' #boba
Chars[1] = '0x0191' #ciuvas
while not uo.dead()
  for a = 0 to 1
    while val(uo.getglobal('find')) == 1 # can't understand for what is needed
      wait(50)
    wend
    uo.set('finddistance', '20')
    uo.findtype(Chars[a], '-1', 'ground') #replaced '1' to 'ground'
    if uo.findcount('finditem')>0 then
      uo.exec('exec recnamo')
      return
    else
      wait(50) #replaced 500 to 50
    endif
  next
wend
end sub

Some times it dosent work.. and dont recall.. just stops..
and recnamo()

Code: Select all

sub recnamo()
var timec
var myx = uo.getx('self')
var myy=uo.gety('self') #added
#run() #what is that?
repeat
  uo.deletejournal()
  uo.waittargetobject('0x4000465D')
  uo.cast('Recall')
  timec=uo.timer()+80
  while not uo.injournal('fizzles') and not uo.injournal('reagents') and not timec<uo.timer() and (myx==uo.getx('self') and myy==uo.gety('self'))
    wait(50)
  wend
until myx<>uo.getx('self') and myy<>uo.gety('self') # I MADE A MISTAKE HERE! And now i fixed it - char recalls until both xpos and ypos changes
end sub

try that and tell me results
Last edited by CuHTpoH on 2007-12-18 20:08:55, edited 1 time in total.
**Выставляем отступы в скриптах*** ©Destruction
Feel the Power of Dark Side
Mazer
Posts: 125
Joined: 2007-11-13 00:39:14

Post by Mazer »

Code: Select all

sub run()
uo.exec('terminate CheckingPlayers')
uo.exec('terminate Checkinglife')
end sub
CuHTpoH
Posts: 287
Joined: 2007-11-01 19:09:30
Location: Moscow
Contact:

Post by CuHTpoH »

Does it work or no?
**Выставляем отступы в скриптах*** ©Destruction
Feel the Power of Dark Side
Mazer
Posts: 125
Joined: 2007-11-13 00:39:14

Post by Mazer »

recal dosent then it gets to other place it start to recal and recal and recal.. no pause.. 1 second 10 of all regents..
Mazer
Posts: 125
Joined: 2007-11-13 00:39:14

Post by Mazer »

player serch works with some errors :) fixed one mistake.. and then player recals near me and dont move script cant find it :)
CuHTpoH
Posts: 287
Joined: 2007-11-01 19:09:30
Location: Moscow
Contact:

Post by CuHTpoH »

look at my comment about my mistake at the end of the recnamo() script
and about characters find - that is not an error of injection, as i heard UOServer does not send information about another client appeared nearby until its moved..
**Выставляем отступы в скриптах*** ©Destruction
Feel the Power of Dark Side
Mazer
Posts: 125
Joined: 2007-11-13 00:39:14

Post by Mazer »

ok i understand about player serch :) but another mistake with your skript :) if i dont have regents script goes spamed
Mazer
Posts: 125
Joined: 2007-11-13 00:39:14

Post by Mazer »

ok tryed to slove by my self is it right ?

Code: Select all

sub tt()
var timec
var myx = uo.getx('self')
var myy=uo.gety('self') #added
repeat
  uo.deletejournal()
  uo.waittargetobject('0x4000465D')
  uo.cast('Recall')
  timec=uo.timer()+80
  uo.deletejournal()
  while not uo.injournal('fizzles') and not uo.injournal('reagents') and not timec<uo.timer() and (myx==uo.getx('self') and myy==uo.gety('self'))
    wait(50)
  wend
until myx<>uo.getx('self') and myy<>uo.gety('self') or uo.injournal('reagents')
end sub



can you see this one ?
http://forum.yoko.com.ua/viewtopic.php?t=12925
CuHTpoH
Posts: 287
Joined: 2007-11-01 19:09:30
Location: Moscow
Contact:

Post by CuHTpoH »

i'll look at the link.
And you, try to make smth. with "uo.injournal('reagents')" - play with that and it might stop repeating..
**Выставляем отступы в скриптах*** ©Destruction
Feel the Power of Dark Side
Mazer
Posts: 125
Joined: 2007-11-13 00:39:14

Post by Mazer »

Maybe you can help me connect scripts? :) Link i gaved and this serch player :) ?
Mazer
Posts: 125
Joined: 2007-11-13 00:39:14

Post by Mazer »

why this serching players cant find animals ?
Post Reply