Page 1 of 1

targetnext "filtering"

Posted: 2005-05-06 13:15:06
by bl4ck
hi guys!

im looking for a script that do this:

when i press nexttarget, IF the target appointed is "Bob" or "Tiny",
it ignore that guys, and go for nexttarget avaiable!

something like that:

sub targetfilter()
uo.press (123) ; target next key
" IGNORE Bob and Tiny and keep going! "
end if
end sub

:/

any idea ?

Posted: 2005-05-06 13:26:19
by Beyonder
Dunno if UO.Ignore has any influence on targetnext but you can try it.
Just set :

Code: Select all

if (UO.GetName('lasttarget')=='Timmy') then
UO.Ignore('lasttarget')
end if
......
......
UO.IgnoreReset()  ## Dont forget this line at the end
end sub

humm

Posted: 2005-05-07 01:20:27
by bl4ck
thank you man, it may work, but i dont get the full idea..


how i can put to more than one guy to be ignored?
help me out with the full code looks:

sub targetfilter()
uo.press (123) ; target next key
if (UO.GetName('lasttarget')=='Timmy' or 'Doug' or 'Duckhead') then
UO.Ignore('lasttarget') then
uo.press (123) ; target next key
( AND IF IT GET DOUG AGAIN, IT WILL IGNORE AGAIN?)
end if
UO.IgnoreReset()
end sub


help me out, im lost =O

Posted: 2005-05-07 07:11:15
by Beyonder
Better make it through recursy:

Code: Select all

sub IgnoreLast(Name) # Functions looks if last target had a name=Name and ignores it then.
if (UO.GetName('lasttarget')==Name) then
UO.Ignore('lasttarget')
return 1 # Return 1 if we ignored someone
end if
return 0
end sub

sub targetfilter()
  var IgCnt; //Ignore count
  uo.press (123) ; target next key

  IgCnt=IgCnt+IgnoreLast('Timmy') # Counting ignored people
  IgCnt=IgCnt+IgnoreLast('Doug') # Counting ignored people
  IgCnt=IgCnt+IgnoreLast('Duckhead') # Counting ignored people

  if (IgCnt>0) then ## Means that we ignored someone
    UO.exec('exec targetfilter') ## Running this function again without deleting ignore list
    return
  end if

  UO.IgnoreReset() ## If target is locked than delete ignorelist, why do we need it if we've found a target?
end sub

Posted: 2005-05-09 00:00:39
by Yoko
what do your recursion function do when just no man around?

Posted: 2005-05-09 08:48:19
by Beyonder
The same the nexttarget does when there is no people around i guess...

oops

Posted: 2005-05-11 11:08:43
by bl4ck
man, thank you very much, but when i use, it displays that:


Line 461: Bad operation for this type of variable - IGCNT

:(

Posted: 2005-05-11 12:43:28
by Beyonder
Sorry, my mistake ;D.
Change this:
var IgCnt; //Ignore count
to:
var IgCnt=0; //Ignore count

:D

Posted: 2005-05-11 13:25:01
by bl4ck
all right,

i changed, but it seems to dont work,
the character name of my friend is "Derrubadinha"

need i to change

sub IgnoreLast(Name) # Functions looks if last target had a name=Name and ignores it then.
if (UO.GetName('lasttarget')==Name) then

to

sub IgnoreLast(Derrubadinha) # Functions looks if last target had a name=Name and ignores it then.
if (UO.GetName('lasttarget')==Derrubadinha) then


?

i've tried both ways and it just seens to dont work.
the target names go changing.. but Derrubadinha keeps
one of them!

Posted: 2005-05-11 14:46:47
by Beyonder
No, the only thing you have to change is here:

Code: Select all

  IgCnt=IgCnt+IgnoreLast('Timmy') # Counting ignored people 
  IgCnt=IgCnt+IgnoreLast('Doug') # Counting ignored people
  IgCnt=IgCnt+IgnoreLast('Duckhead') # Counting ignored people

Add as much people as you want there wit ha 1 line for 1 guy.
Nothing more to change.

hum

Posted: 2005-05-12 00:26:44
by bl4ck
i tried it before make the question,
dont works man, liek in the first example,
i put "Derrubadinha" in

IgCnt=IgCnt+IgnoreLast('Derrubadinha') # Counting ignored people

but he keeps appearing like a normal target!
have ya tested it?
:(

thank you very much

oh my

Posted: 2005-05-12 06:07:19
by bl4ck
really dont works! have ya tried?

please help me out! any hope ??

:cry:

Posted: 2005-05-13 08:11:42
by bl4ck
any guy have ideas?
or anyone have used it and worked?? :/