Author Topic: Need some Help... Determining NPC from REAL players....  (Read 3568 times)

0 Members and 1 Guest are viewing this topic.

Offline AlphaTopic starter

  • Hero Member
  • *
  • Posts: 583
  • Activity:
    0%
  • Reputation Power: 10
  • Alpha barely matters.Alpha barely matters.
  • Respect: +44
  • Referrals: 0
    • View Profile
Need some Help... Determining NPC from REAL players....
« on: October 13, 2009, 03:26:41 PM »
0
ok.. so I've got a few resource farming scripts that I run, but some pretty borred people have taken to tracking me down on stealthers and killing me for what I farm..  What I'm having problems with is accurately determining if it's an NPC vs Real player...
I know there's a few ways to go about this but I don't understand what's going wrong with the way I chose..

Also.. I don't know if it makes a difference, but sometimes Red Brigands spawn & my Farmer will AutoDefend & kill them so I don't know if that has an effect..  . 

PS.. I realize that searching for _the_ is not 100% accurate... I could put in all the possible NPC names bc I know it's possible to have _the_ in a character named but it works for 99.9%..

Anyway here's where I was headed.

Code: [Select]

 ignoreitem #charid

START:

finditem IS_HS_XU_AV_KS_JS_ZU_KV_SAB_MAB_LAB_SH_EH_VD_JG_BB_SC_OAB_QAB_PAB_RAB_HN_IN_FN
If #findcnt < 1
  {
     wait 1
     goto start
  }
For #findindex 1 #findcnt
  {
     If #findrep = 7 || #findrep = 3
       {
         ignoreitem #findid
       }
     set %Target_id #findid
     Gosub Check_NPC
     If #Result = #FALSE
       {
          Display OK a "REAL" player is Nearby!
          halt
       }
  }


goto START

;-----------------
;-----------------

Sub Check_NPC

linespercycle 1000

Event_property:
set %waituntil #scnt2 + 10
Repeat
    {
    event property %Target_id
    wait 2
    }
Until #property <> $ || #scnt2 > %waituntil
set %player_property #property
If %player_property = $ || %player_property = N/A
   {
   ignoreitem %Target_id
   linespercycle 10
   return #false
   }

If #spc , the , #spc in %player_property
   {
     ignoreitem %Target_id
     Linespercycle 10
     Return #True  ;--Return #TRUE if it's an NPC
   }
Return #False  ;--Return #False if NOT an NPC


What I don't understand is that some NPC's with  _the_  in their title are making it past the If statement that would ignore them and returning #FALSE that it's not an NPC when it actually is...


Anyway if someone's borred ???

PS.. other ideas on ways to accomplish this

1)  Open paperdoll and scan for Jewelry.. pretty much EVERY player will have some.. no npc's will

2) Open paperdoll & scan for Insured items.. but this requires Even property which is probably what's causing my problem above

3) Journal Scan for the "You see: Collin the brigand"     etc...  though there would be a TON of possibilities you'd need to account for.. Bascially all Monster names / NPC types etc... though no event property needed..

Anyway.. thx.

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Need some Help... Determining NPC from REAL players....
« Reply #1 on: October 13, 2009, 04:38:19 PM »
0
Ive done it both ways .. you see , and find item

Try putting some Display ok <value>   in your script to debug whats happening as i carnt see where it goes wrong.
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline Khameleon

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
Re: Need some Help... Determining NPC from REAL players....
« Reply #2 on: October 13, 2009, 06:32:03 PM »
0
check against #Rep. Usually NPC's come back Grey or Yellow what ever the number corresponds

Offline AlphaTopic starter

  • Hero Member
  • *
  • Posts: 583
  • Activity:
    0%
  • Reputation Power: 10
  • Alpha barely matters.Alpha barely matters.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: Need some Help... Determining NPC from REAL players....
« Reply #3 on: October 13, 2009, 08:49:54 PM »
0
Khameleon Said"
Quote
check against #Rep.

Yeah It does that..  There's a If statement that checks for #findrep = 7 (Yellow) && 3 (Grey Animal) All other values are valid for REAL players..  The problem I'm having is that apparently #property can have all the info in it but the IF statement that checks that string doesn't work correctly on occasion.. (or that's what I come up with)

I've paused it right before it checks to see if   ( the , #spc , Brigand )  etc...    is in the string (& it is) but the statement evaluates to false still..   have to try it again and see..

Offline rana70

  • Elite
  • *
  • *
  • Posts: 294
  • Activity:
    0%
  • Reputation Power: 5
  • rana70 has no influence.
  • Gender: Male
  • Respect: +37
  • Referrals: 2
    • View Profile
    • MyScripts
Re: Need some Help... Determining NPC from REAL players....
« Reply #4 on: October 13, 2009, 09:13:44 PM »
0
Khameleon Said"
Quote
check against #Rep.

Yeah It does that..  There's a If statement that checks for #findrep = 7 (Yellow) && 3 (Grey Animal) All other values are valid for REAL players..  The problem I'm having is that apparently #property can have all the info in it but the IF statement that checks that string doesn't work correctly on occasion.. (or that's what I come up with)

I've paused it right before it checks to see if   ( the , #spc , Brigand )  etc...    is in the string (& it is) but the statement evaluates to false still..   have to try it again and see..

How about

Code: [Select]
if Brigand in #Property

Offline Khameleon

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
Re: Need some Help... Determining NPC from REAL players....
« Reply #5 on: October 14, 2009, 01:38:48 AM »
0
also check the property most npc's have the word THE, Avril "THE" Banker, Madrid "THE" Minter, C2 "The" Black Smith, Ect.

Offline AlphaTopic starter

  • Hero Member
  • *
  • Posts: 583
  • Activity:
    0%
  • Reputation Power: 10
  • Alpha barely matters.Alpha barely matters.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: Need some Help... Determining NPC from REAL players....
« Reply #6 on: October 14, 2009, 08:46:46 AM »
0
Well.. Here's the comparison I really should be using..  (This is just a piece from Narbor STATS that I borrowed so yea.)

Code: [Select]
%player_property =  Brandon the Brigand   (example)

set %player true
if the , #spc , mage in %player_property || the , #spc , merchant in %player_property ||
+ the , #spc , gypsy in %player_property || the , #spc , tailor in %player_property ||
+ the , #spc , messenger in %player_property || the , #spc , fisher in %player_property ||
+ the , #spc , sailor in %player_property || the , #spc , weaver in %player_property ||
+ the , #spc , jeweler in %player_property || the , #spc , herbalist in %player_property ||
+ the , #spc , rancher in %player_property || the , #spc , fighter in %player_property ||
+ the , #spc , seeker , #spc , of , #spc , adventure in %player_property ||
+ the , #spc , miner in %player_property || the , #spc , thief in %player_property ||
+ the , #spc , actor in %player_property || the , #spc , harbor , #spc , master in %player_property ||
+ the , #spc , noble in %player_property || the , #spc , thief , #spc , guildmaster in %player_property ||
+ the , #spc , wandering , #spc , healer in %player_property ||
+ the , #spc , priest , #spc , of , #spc , mondain in %player_property ||
+ the , #spc , paladin in %player_property || the , #spc , body , #spc , sculptor in %player_property ||
+ the , #spc , hairstylist in %player_property || the , #spc , peasant in %player_property ||
+ the , #spc , beggar in %player_property || the  , #spc , ranger in %player_property ||
+ the , #spc , peasant in %player_property || the , #spc , ninja in %player_property ||
+ the , #spc , samurai in %player_property || the , #spc , brigand in %player_property ||
+ the , #spc , barkeep in %player_property || the , #spc , bartender in %player_property ||
+ the , #spc , sculptor in %player_property || the , #spc , artist in %player_property ||
+ the , #spc , bard in %player_property || the , #spc , bride in %player_property ||
+ the , #spc , groom in %player_property || the , #spc , tinker , #spc , guildmistress in %player_property ||
+ the , #spc monk in %player_property || the , #spc , Shepherd in %player_property
If #spc , the , #spc in %player_property
   {
   ignoreitem %Target_id
   set %player false
   }

Anyway.. I was just searching for   #spc , the , #spc above because the huge IF statment seems to fail... it's not WHAT to search for it's just that it simply fails for some reason occasionally & I don't know why.

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Need some Help... Determining NPC from REAL players....
« Reply #7 on: October 14, 2009, 09:05:32 AM »
0
Whats Narbor STATS  ??

Yea thats an odd failure... have you tried

set !test #spc , the , #spc
if !test in blabla
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline AlphaTopic starter

  • Hero Member
  • *
  • Posts: 583
  • Activity:
    0%
  • Reputation Power: 10
  • Alpha barely matters.Alpha barely matters.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: Need some Help... Determining NPC from REAL players....
« Reply #8 on: October 14, 2009, 10:27:32 AM »
0
Narbor STATS is a player scanner script.... DOH I just realized I mixxed those 2 scripts up in my Head.   I actually took the part with most of the various NPC titles out of   omgburgersthewatcher  ... but it seemed to me that perhaps the number of statements in the IF was perhaps what was failing so I tried just search for  THE in the title...

EN Said:
Quote

Have you tried?
set !test #spc , the , #spc
if !test in blabla

Yeah it works like 90% of the time.  The problem seems to arise when it's hitting a huge group of NPC's.  The property value updates from the event property correctly, but the IF statement just fails.....      I think I'm going to try some strategic waits..   I only messed with this for like an hour before I crashed.. and haven't had a second to play with it since I asked here.   Hmm.. actually I think I'm going to make it simple until I figure out where it's breaking..
Code: [Select]

 ignoreitem #charid

START:

finditem IS_HS_XU_AV_KS_JS_ZU_KV_SAB_MAB_LAB_SH_EH_VD_JG_BB_SC_OAB_QAB_PAB_RAB_HN_IN_FN
If #findcnt < 1
  {
     wait 1
     goto start
  }
For #findindex 1 #findcnt
  {
     If #findrep = 7 || #findrep = 3
       {
         ignoreitem #findid
       }
     set %Target_id #findid
     Gosub Check_NPC
     If #Result = #FALSE
       {
          Display OK a "REAL" player is Nearby!
          halt
       }
  }


goto START

;-----------------
;-----------------

Sub Check_NPC

linespercycle 1000

Event_property:
set %waituntil #scnt2 + 10
Repeat
    {
    event property %Target_id
    wait 2
    }
Until #property <> $ || #scnt2 > %waituntil
set %player_property #property
If %player_property = $ || %player_property = N/A
   {
   ignoreitem %Target_id
   linespercycle 10
   return #false
   }
Display ok Property = %player_property  Is  _the_ in this string?

If #spc , the , #spc in %player_property
   {
     ;--Commenting line below out so that it continues to scan same npcs... This way I can see if it fails to recognize 1 item as an NPC when
     ;---running fullspeed etc

     ;--- ignoreitem %Target_id
   
     Linespercycle 10
     Return #True  ;--Return #TRUE if it's an NPC
   }
Display ok Apparently there's a REAL person nearby.. is this true?

Return #False  ;--Return #False if NOT an NPC



Tags: