I FINALLY GOT THE ASSET FIXER FIXED.

This commit is contained in:
Bitl 2022-10-29 15:44:45 -07:00
parent 82eea50273
commit 296f09fe92
7 changed files with 122 additions and 36 deletions

View File

@ -112,6 +112,7 @@ public class GlobalPaths
public static readonly string ConsoleHelpFileName = "consolehelp.txt";
public static readonly string ClientScriptDocumentationFileName = "documentation.txt";
public static readonly string AddonLoaderFileName = "AddonLoader.lua";
public static readonly string AssetFixerPatternFileName = "assetfixer_pattern.txt";
#endregion
}
#endregion

View File

@ -275,7 +275,14 @@ public class NovetusFuncs
.Replace(baseurl + "/item.aspx?id=", str2);
//...because scripts mess it up.
string id = fixedUrl.After("id=");
if (id.Contains("&version="))
{
string ver = id.After("&version=");
id = id.Replace("&version=" + ver, "");
}
string fixedID = Regex.Replace(id, "[^0-9]", "");
//really fucking hacky.

View File

@ -202,58 +202,64 @@ public partial class AssetFixer : Form
{
//https://stackoverflow.com/questions/10576686/c-sharp-regex-pattern-to-extract-urls-from-given-string-not-full-html-urls-but
List<string> links = new List<string>();
var linkParser = new Regex(@"https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=;\[\]]*)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
foreach (Match m in linkParser.Matches(line))
if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.AssetFixerPatternFileName))
{
string link = m.Value;
links.Add(link);
}
string pattern = File.ReadAllText(GlobalPaths.ConfigDir + "\\" + GlobalPaths.AssetFixerPatternFileName);
foreach (string link in links)
{
if (link.Contains(".png") || link.Contains(".jpg") || link.Contains(".jpeg"))
var linkParser = new Regex(pattern, RegexOptions.Compiled | RegexOptions.IgnoreCase);
foreach (Match m in linkParser.Matches(line))
{
continue;
string link = m.Value;
links.Add(link);
}
if (link.Contains("my-roblox-character-item"))
foreach (string link in links)
{
continue;
}
if (link.Contains(".png") || link.Contains(".jpg") || link.Contains(".jpeg"))
{
continue;
}
string urlFixed = "";
if (link.Contains("my-roblox-character-item"))
{
continue;
}
if (useURLs)
{
string oldurl = line;
urlFixed = NovetusFuncs.FixURLString(oldurl, url);
}
else
{
string newurl = ((!link.Contains("http://") || !link.Contains("https://")) ? "https://" : "")
+ "assetdelivery.roblox.com/v1/asset/?id=";
string urlReplaced = newurl.Contains("https://") ? link.Replace("http://", "").Replace("https://", "") : link.Replace("http://", "https://");
urlFixed = NovetusFuncs.FixURLString(urlReplaced, newurl);
}
string urlFixed = "";
string peram = "id=";
if (urlFixed.Contains(peram))
{
if (useURLs)
{
file[index - 1] = file[index - 1].Replace(link, urlFixed);
string oldurl = line;
urlFixed = NovetusFuncs.FixURLString(oldurl, url);
}
else
{
string IDVal = urlFixed.After(peram);
RobloxXML.DownloadFilesFromNode(urlFixed, savefilepath, "", IDVal);
file[index - 1] = file[index - 1].Replace(link, inGameDir + IDVal);
string newurl = ((!link.Contains("http://") || !link.Contains("https://")) ? "https://" : "")
+ "assetdelivery.roblox.com/v1/asset/?id=";
string urlReplaced = newurl.Contains("https://") ? link.Replace("http://", "").Replace("https://", "") : link.Replace("http://", "https://");
urlFixed = NovetusFuncs.FixURLString(urlReplaced, newurl);
}
string peram = "id=";
if (urlFixed.Contains(peram))
{
if (useURLs)
{
file[index - 1] = file[index - 1].Replace(link, urlFixed);
}
else
{
string IDVal = urlFixed.After(peram);
RobloxXML.DownloadFilesFromNode(urlFixed, savefilepath, "", IDVal);
file[index - 1] = file[index - 1].Replace(link, inGameDir + IDVal);
}
}
}
}
ProgressChangedEvent();
ProgressChangedEvent();
}
}
else
{

View File

@ -1,3 +1,12 @@
1.3 Snapshot v22.8337.28204.1
Enhancements:
- Added the following Place Contest (Halloween 2022) entries:
- Atomic - Spooking Out
- The Asset Fixer's Regex pattern is now accessible in config/assetfixer_pattern.txt.
Fixes:
- Fixed the Asset Fixer incorrectly removing end quotes in scripts. (&quot;)
----------------------------------------------------------------------------
1.3 Snapshot v22.8327.19048.1
Notes:
- Cut 2012M temporarily to focus on fixing bugs for the next update's release.

View File

@ -0,0 +1,61 @@
-- link - single quote
'https://assetdelivery.roblox.com/v1/asset?id=1818'
-- link - double quote
"https://assetdelivery.roblox.com/v1/asset?id=1818"
-- xml
<lol=lol><blah>https://assetdelivery.roblox.com/v1/asset?id=1818</blah></lol>
-- link - single quote, w/ space
'https://assetdelivery.roblox.com/v1/asset?id=1818 '
-- link - double quote, w/ space
"https://assetdelivery.roblox.com/v1/asset?id=1818 "
-- xml, w/ space
<lol=lol><blah>https://assetdelivery.roblox.com/v1/asset?id=1818 </blah></lol>
--just the link. no spaces.
https://assetdelivery.roblox.com/v1/asset?id=1818
--a variation of a roblox link
http://www.roblox.com/asset/?version=1&amp;id=1818
--another variation of a roblox link
http://www.roblox.com/asset/?version=1&id=1818
--another possible variation
http://www.roblox.com/asset/?id=1818&amp;version=1
--another one
http://www.roblox.com/asset/?id=1818&version=1
--quotation link
"http://www.roblox.com/asset/?id=[ID]"
-- script snippet
game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id="..images[m])
l.Image = "http://www.roblox.com/asset/?id="..images[m]
--spooking out snippet
{&quot;Boing&quot;, &quot;http://novetus.me/asset?id=12222124&quot;, 2.509},--2
--recreated menderman snippet
mesh7.MeshId = &quot;http://www.roblox.com/asset/?id=17659272&quot;
mesh7.MeshId = "http://www.roblox.com/asset/?id=17659272"
--snippet from survive the spheres
Badges = {[0] = 30058718, [100] = 29890585, [200] = 29918752, [400] = 30057939}
Playing = {}
Tutorial = {&quot;http://www.roblox.com/asset/?id=30093873&quot;, &quot;http://www.roblox.com/asset/?id=30093900&quot;, &quot;http://www.roblox.com/asset/?id=30093954&quot;, &quot;http://www.roblox.com/asset/?id=30094010&quot;, &quot;http://www.roblox.com/asset/?id=30094028&quot;, &quot;http://www.roblox.com/asset/?id=30094049&quot;}
BallName = &quot;bawlz&quot;
Base = workspace.Base
CountDownTime = 15
Siz = 8
Size = Vector3.new(Siz, Siz, Siz)
Multiplier = 1
SuckSpeed = 1.5
SuckSoundId = &quot;http://www.roblox.com/asset/?id=10722059&quot;
TickSoundId = &quot;rbxasset://sounds\\clickfast.wav&quot;
PingSoundId = &quot;http://www.roblox.com/asset/?id=13114759&quot;
HorrorSoundId = &quot;http://www.roblox.com/asset/?id=2767085&quot;
LostSoundId = &quot;http://www.roblox.com/asset/?id=13378571&quot;
WonSoundId = &quot;http://www.roblox.com/asset/?id=15632562&quot;
EatTime = 2
BallMass = 15000
copyrate = 15
Powerups = {}
Lobby = script.Parent.Lobby
VipId = 28197859

View File

@ -146,6 +146,7 @@ XCOPY "%cd%\clean_junk.bat" "%scriptsdir%\batch" /y
XCOPY "%cd%\github_sync.bat" "%scriptsdir%\batch" /y
XCOPY "%cd%\create_lite.bat" "%scriptsdir%\batch" /y
XCOPY "%cd%\liteexclude.txt" "%scriptsdir%\batch" /y
XCOPY "%cd%\assetfixer_gauntlet.lua" "%scriptsdir%" /y
XCOPY "%cd%\Novetus\Novetus_dependency_installer.bat" "%scriptsdir%\batch" /y
XCOPY "%cd%\litefiles\Novetus_dependency_installer.bat" "%scriptsdir%\batch\Novetus_dependency_installer_lite.bat*" /y
XCOPY "%cd%\Novetus\Novetus_launcher_legacy.bat" "%scriptsdir%\batch" /y

View File

@ -238,4 +238,5 @@ Everything is possible with Lava Gang.
Don't fence me in!
Pick it Up!|Ima Say Ma Namowa
Put it Down!|Ima Say Ma Namowa
Down with Monogon!
Down with Monogon!
allows the user to use W...