• 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 - MQ2 String.Replace function issues? (1 Viewer)

WhoDunIt

New member
Ever since the latest patch I have noticed my enchanter 'hanging' while debuffing.

After digging into the issue, It looks to me like it's due to the String.replace[,] function returning NULL when the second parameter is empty:

Rich (BB code):
Sub Main    
    /declare TestVar                  string         outer       
    /varset TestVar HelloWorld
    /echo ${TestVar.Replace[Hello,]}
    | This is echoing NULL when you would expect it to echo World
/return

This has major implications in KISS as it's used all over the place. Could someone confirm that i'm not going crazy and they are seeing the same?
 
Confirmed here. Any value present in the second parameter results in expected behavior. Not supplying a second parameter, as well as supplying a NULL var (below) results in a NULL return.

Rich (BB code):
/declare TestVar                  string         outer 
/declare TestVar1                string         outer       
/varset TestVar HelloWorld
/echo ${TestVar.Replace[Hello,${TestVar1}]}
 
That is my fault, I got a report that .Replace[\.\\] crashes the client, no one told me people used it to delete part of the string as well I just had to assume both parameters where always supplied.

But that brings me to this point... is that misuse and not intended or should I somehow go in and make second parameter optional?

What should happen if they leave parameter 1 empty?

Does .Replace[Hello,""] work?
 
I would expect (given the lack of an available String.Empty or a constant that denotes a NULL, unless I'm mistaken) that no second parameter would equate to removing the first parameter from the input string.
Granted that's still kinda wonky, and from my perspective I'd much prefer to have something I could pass in to tell it to replace with empty instead of giving it nothing.
string a = "HelloWorld";
Console.WriteLine(a.Replace("Hello",));

Doesn't make much sense (being nitpicky...)

string a = "HelloWorld";
Console.WriteLine(a.Replace("Hello",null));

But this does (though I'd still always use String.Empty....)
Apples and oranges, just my thoughts.

Edit: "What should happen if they leave parameter 1 empty?"
That should throw an error as far as I'm concerned.

Edit2: Though best practices would dictate that if ${TestVar.Replace[Hello,]} worked before it should continue to do so.
 
Rich (BB code):
Does .Replace[Hello,""] work?

It gives NULL

- - - Updated - - -

And while you are here and in the bug fixing mood, Me.XTHaterCount and Me.XTAggroCount are always returning 0.
 
Anyone else using a SK?

All my Lifetap spells are targeting myself and not mobs... nukes and everything else hits the npcs... lifetaps are trying to act like Self Healing spells
 
Anyone else using a SK?

All my Lifetap spells are targeting myself and not mobs... nukes and everything else hits the npcs... lifetaps are trying to act like Self Healing spells


I put my Life taps in the DPS section.



DPS8=Dichotomic Fang|99
DPS9=Dire Testimony|98
DPS10=Touch of T`Vem|98



DPS8=Dichotomic Fang|99
DPSCond8=${Me.CombatState.Equal[COMBAT]} && ${Me.PctHPs} < 85
DPS9=Dire Testimony|98
DPSCond9=${Me.CombatState.Equal[COMBAT]} && ${Me.PctHPs} < 95
DPS10=Touch of T`Vem|98
DPSCond10=${Me.CombatState.Equal[COMBAT]} && ${Me.PctHPs} < 90


Seems to work very well.
 
I put my Life taps in the DPS section.



DPS8=Dichotomic Fang|99
DPS9=Dire Testimony|98
DPS10=Touch of T`Vem|98



DPS8=Dichotomic Fang|99
DPSCond8=${Me.CombatState.Equal[COMBAT]} && ${Me.PctHPs} < 85
DPS9=Dire Testimony|98
DPSCond9=${Me.CombatState.Equal[COMBAT]} && ${Me.PctHPs} < 95
DPS10=Touch of T`Vem|98
DPSCond10=${Me.CombatState.Equal[COMBAT]} && ${Me.PctHPs} < 90


Seems to work very well.

interesting, wasnt an issue for me before =P ty
 
Problem - MQ2 String.Replace function issues?

Users who are viewing this thread

Back
Top
Cart