• Hail, we're RedGuides. We want you to play six (yes, 6!) EverQuest characters at once. We have scripts and a friendly community to help, please join our playstyle and say hello! 👋
  • We've added LLM sections to our Terms & Rules and Resource Rules, for everyone's sanity & in-game safety.
    Read more
    a. Do not replace your voice with an LLM. This goes for your posts and your scripts. Drafting and editing with a tool is fine, but don't take you out of what you share.
    b. Do not replace your EQ character's voice with an LLM. We don't want scripts that speak over /ooc, /shout or other public channels. This has been an unwritten rule that's kept casino scripts off the site for decades, but we're now compelled to make it clear: keep automated communication private.

    Why Does RG Review Scripts?
    Nearly every LLM-written Lua script we see is making your character do impossible things, and rarely in a way that's beneficial to you. We've seen heavy server hammering, /target over impossible distances when /nav spawn would passively accomplish the same thing, a spawn search that fires 20+ times per second, and other pointless actions that are likely annoying GMs.

    You are welcome to use LLMs as a tool to structure, draft, and edit your work, but please read critically before hitting /lua run

Problem - Small Code problem in 10.0.4 Bind_AddToIgnore

Rich (BB code):
5079:    Sub Bind_AddToIgnore(MTIgnore)
5080:        | Take the targeted mob as a parameter for mob to ignore.
5081:        /if (!${Defined[${MTIgnore}]}) /declare MTIgnore string local ${Target.CleanName}
5082:        /if (!${MTIgnore.Length} && ${Target.ID} && ${Spawn[=${Target.CleanName}].ID} &&       ${Select[${Target.Type},NPC,Pet]}) /varset MTIgnore ${Target.CleanName}
5083:       /if (!${MTIgnore.Length} || ${MTIgnore.Find[null]} || ${Spawn[${MTIgnore}].ID}==${Me.ID} ) {
                   /echo No NPCs detected. Nothing added to list.
                  /return
               }
Line 5082 does nothing because MTIgnore.Lenght will never be 0. At most it would repeat the action from line 5081. MTIgnore can either be a user provided string, the name of a target or the 4 char string "NULL" from the empty target. I assume that there are no valid targets with an empty string as a name.
In line 5083 the first clause is superfluous for the same reason.

I suggest this, which allows only npcs
Rich (BB code):
    Sub Bind_AddToIgnore(MTIgnore)
        | Take the targeted mob as a parameter for mob to ignore.
        /if (!${Defined[${MTIgnore}]}) /declare MTIgnore string local ${Target.CleanName}
        /if (${MTIgnore.Equal[null]} || !${Spawn[${MTIgnore}].Type.Equal[NPC]}) {
            /echo No NPCs named ${MTIgnore} detected. Nothing added to the list.
            /return
        }
...

If you want to allow pets you have to exlude pc pets. And there is the question whether pets of an actual npc always have the same name. So it would possibly be safer to add the name of the owner. The actual ignore routine does check whether the pet owner is to be ignored, does it ?
 
Uh, oh. I made the classical mistake of only testing the new stuff, adding from target. Calling /addignore with a user string currently terminates KA because
/if (!${Defined[${MTIgnore}]}) should be
/if (!${Defined[MTIgnore]})
Sorry.
After the initial test we know that we have the name of a npc. So the further simplified version is
Rich (BB code):
    Sub Bind_AddToIgnore(MTIgnore)
        | Take the targeted mob as a parameter for mob to ignore.
        /if (!${Defined[MTIgnore]}) /declare MTIgnore string local ${Target.CleanName}
        /if (${MTIgnore.Equal[null]} || !${Spawn[${MTIgnore}].Type.Equal[NPC]}) {
            /echo No NPCs named ${MTIgnore} detected. Nothing added to list.
            /return
        }
        | Assign temp var   list
        /declare IgnoreAdd string local ${MobsToIgnore}
        | If MobsToIgnore default text with the word null in it assign var spawn clean name
        /if (${IgnoreAdd.Find[null]}) {
            /varset IgnoreAdd ${Spawn[${MTIgnore}].CleanName}
        } else {
            /varset IgnoreAdd ${IgnoreAdd},${Spawn[${MTIgnore}].CleanName}
        }
        /if (${MobsToIgnore.Find[${Spawn[${MTIgnore}].CleanName}]}) {
            /echo >> ${Spawn[${MTIgnore}].CleanName} << already on Ignore List.
            /return
        }
        /ini "${InfoFileName}" "${ZoneName}" "MobsToIgnore" "${IgnoreAdd}"
        /echo AddToIgnore -> ${Spawn[${MTIgnore}].CleanName} <- Adding to Ignore list.
        | Reassign MobsToIgnore var the new list
        /varset MobsToIgnore ${IgnoreAdd}
    /return
This time tested in Feerot the dream with:
a) user input Kavri resulting in adding Kavri Flightfoot
b) user input garbage -> nothing
c) no input, no target -> nothing
d) target self -> nothing
e) target my pet -> nothing
f) target Zari Ikura -> add Zari Ikura
 
Problem - Small Code problem in 10.0.4 Bind_AddToIgnore

Users who are viewing this thread

Back
Top
Cart