• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Problem - MQ2 String.Replace function issues?

WhoDunIt

New member
Joined
Mar 4, 2018
RedCents
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