targetnext "filtering"

General Injection issues

Moderators: Murderator+, Murderator

Post Reply
bl4ck
Posts: 7
Joined: 2005-01-03 07:00:13

targetnext "filtering"

Post 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 ?
Beyonder
Expert!
Posts: 388
Joined: 2005-04-23 10:19:43
Contact:

Post 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
bl4ck
Posts: 7
Joined: 2005-01-03 07:00:13

humm

Post 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
Beyonder
Expert!
Posts: 388
Joined: 2005-04-23 10:19:43
Contact:

Post 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
Yoko
Site Admin
Posts: 1964
Joined: 2004-04-03 16:49:38
Contact:

Post by Yoko »

what do your recursion function do when just no man around?
Beyonder
Expert!
Posts: 388
Joined: 2005-04-23 10:19:43
Contact:

Post by Beyonder »

The same the nexttarget does when there is no people around i guess...
bl4ck
Posts: 7
Joined: 2005-01-03 07:00:13

oops

Post by bl4ck »

man, thank you very much, but when i use, it displays that:


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

:(
Beyonder
Expert!
Posts: 388
Joined: 2005-04-23 10:19:43
Contact:

Post by Beyonder »

Sorry, my mistake ;D.
Change this:
var IgCnt; //Ignore count
to:
var IgCnt=0; //Ignore count
bl4ck
Posts: 7
Joined: 2005-01-03 07:00:13

:D

Post 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!
Beyonder
Expert!
Posts: 388
Joined: 2005-04-23 10:19:43
Contact:

Post 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.
bl4ck
Posts: 7
Joined: 2005-01-03 07:00:13

hum

Post 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
bl4ck
Posts: 7
Joined: 2005-01-03 07:00:13

oh my

Post by bl4ck »

really dont works! have ya tried?

please help me out! any hope ??

:cry:
bl4ck
Posts: 7
Joined: 2005-01-03 07:00:13

Post by bl4ck »

any guy have ideas?
or anyone have used it and worked?? :/
Post Reply