ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: Kryz on August 22, 2015, 11:48:57 PM

Title: Issue finding NPC
Post by: Kryz on August 22, 2015, 11:48:57 PM
I must be doing something wrong here... I cannot seem to find these mongers, am I making some simple mistake?


Code: [Select]
Sub FindMonger
   MongerLoop:
   finditem HS_IS_OCB_NCB G_15
   if #FindKind <> - 1
      {
       event property #FindId
       if monger in #Property
          {
           display it works!
           goto MongerEnd
          }
       }
       goto MongerLoop
MongerEnd:
ingoreitem reset people
wait 5s
return
Title: Re: Issue finding NPC
Post by: manwinc on August 23, 2015, 12:46:53 AM
I hate findkind

Sub FindMonger
Finditem HS_IS_OCB_NCB G_15
if #Findcnt > 0
{
For #Findindex 1 #Findcnt
{
Event property #Findid
if Monger in #Property
Display Monger: #Findid
}
}
Return

Also, you can use break to jump out of For's Instead of Using Gotos


For %Number 1 100
{
If %Number = 50
Break
}
Display %Number
Halt
Title: Re: Issue finding NPC
Post by: Kryz on August 23, 2015, 01:08:57 AM
Thank You Manwinc! That solved my issue, ill avoid findkind in the future.