Blockland Forums > Modification Help

Detecting Larger Center Print

Pages: << < (3/4) > >>

jes00:


--- Quote from: Treynolds416 on June 16, 2012, 02:52:09 PM ---That would replace every instance of the size with 64

--- End quote ---
Well how do I only replace it if the size is larger than 64?

Port:


--- Quote from: jes00 on June 17, 2012, 06:15:06 AM ---Well how do I only replace it if the size is larger than 64?

--- End quote ---

No offense, but is there something wrong with your brain or do you just not know what you are even doing yourself?

jes00:


--- Quote from: Port on June 17, 2012, 06:26:10 AM ---No offense, but is there something wrong with your brain or do you just not know what you are even doing yourself?

--- End quote ---
I just don't even know myself what I'm doing.

Treynolds416:


--- Quote from: jes00 on June 17, 2012, 06:15:06 AM ---Well how do I only replace it if the size is larger than 64?

--- End quote ---
Use my code

Greek2me:

You can use my custom TML parser for this.

I set it up for you to do what you need:

--- Code: ---function parseML(%flag)
{
for(%i=0; %i < strLen(%flag); %i++)
{
%char = getSubStr(%flag,%i,1);

if(%char $= "<")
%start = %i;

if(%char $= ">" && %start !$= "")
{
%end = %i;

%full = getSubStr(%flag,%start,%end-%start+1);
%contents = getSubStr(%full,1,strLen(%full) - 2);

%search = %contents;
%pos = -1;
%numValues = 0;
while(strPos(%search,":") >= 0)
{
%search = getSubStr(%search,%pos+1,strLen(%search));

%pos = strPos(%search,":");
if(%pos >= 0)
{
%value[%numValues] = getSubStr(%search,0,%pos);
}
else
{
%value[%numValues] = %search;
}
%numValues ++;
}

if(%numValues <= 0)
{
if(%contents !$= "")
{
%value[0] = %contents;
%numValues = 1;
}
}

%replace = parseMLReplace(%value0,%value1,%value2,%value3,%value4,%value5,%value6,%value7,%value8,%value9,%value10,%value11,%value12,%value13,%value14,%value15);

if(%replace !$= "")
{
%flag = strReplace(%flag,%full,%replace);
%i = %start-1;
}

%start = "";
%end = "";
%full = "";
%contents = "";
%search = "";
%replace = "";
for(%e=0; %e < %numValues; %e++)
%value[%e] = "";
%numValues = "";
}
}

return %flag;
}

function parseMLReplace(%value0,%value1,%value2,%value3,%value4,%value5,%value6,%value7,%value8,%value9,%value10,%value11,%value12,%value13,%value14,%value15)
{
switch$(%value[0])
{
case "font":
if(%value[2] > 64)
{
%replace = "<font:" @ %value[1] @ ":64>";
}
}

return %replace;
}
--- End code ---


Pages: << < (3/4) > >>

Go to full version