-
Posts
67 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Subtixx's Achievements
Snitch (10/54)
5
Reputation
-
As code editor you can now use Visual Studio Code with my extension over 6000 people have downloaded it already! https://marketplace.visualstudio.com/items?itemName=subtixx.mtasa-lua
-
Subtixx changed their profile photo
-
My plugin has nothing to do with Sublime Text. It is a Visual Studio Code extension: https://code.visualstudio.com/ and you can install it via the internal extension system in visual studio code.
-
MTASA wiki - offline copies / online mirrors
Subtixx replied to MX_Master's topic in Site/Forum/Discord/Mantis/Wiki related
Since CiBeR's link is for some reason down. I took the time and wrote 2 Scripts in C# to export the MTA wiki. This will download all page names to a file called pages.txt using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Net; namespace Rextester { public class Program { public static string DownloadPage(int iteration, string url) { using(WebClient wc = new WebClient()) { Console.WriteLine("Requesting page: " + System.Web.HttpUtility.HtmlDecode(url)); Uri uri = new Uri("https://wiki.multitheftauto.com" + System.Web.HttpUtility.HtmlDecode(url)); string page = wc.DownloadString(uri); //System.IO.File.WriteAllText(iteration + ".txt", page); try { Regex regexObj = new Regex("<li><a href=\".*?\" title=\".*?\">(.*?)</a></li>"); Match matchResults = regexObj.Match(page); while (matchResults.Success) { System.IO.File.AppendAllText("pages.txt", matchResults.Groups[1].Value+Environment.NewLine); // matched text: matchResults.Value // match start: matchResults.Index // match length: matchResults.Length matchResults = matchResults.NextMatch(); } } catch (ArgumentException ex) { // Syntax error in the regular expression } Match match = Regex.Match(page, "<a href=\".*?\" title=\"Special:AllPages\">Previous page .*?</a> \\| <a href=\"(.*?)\" title=\"Special:AllPages\">Next page .*?</a>"); if(match.Success) { Console.WriteLine("Got next page: " + match.Groups[1].Captures[0].Value); return match.Groups[1].Captures[0].Value; }else{ Console.WriteLine("Failed to download or last page (" + url + ")!"); } return ""; } } public static void Main(string[] args) { using(WebClient wc = new WebClient()) { string indexPage = wc.DownloadString("https://wiki.multitheftauto.com/index.php?title=Special:AllPages"); Match match = Regex.Match(indexPage, "<a href=\"(.*?)\" title=\"Special:AllPages\">Next page .*?</a>"); if(match.Success) { string nextPage = match.Groups[1].Captures[0].Value; int iteration = 0; while(nextPage != "") { string prev = nextPage; nextPage = DownloadPage(iteration, nextPage); Console.WriteLine("Got: " + nextPage + " | PrevPage: " + prev); iteration++; } }else{ Console.WriteLine("Failed to download index page!"); Console.WriteLine(indexPage); } } } } } This will parse the pages.txt and download a file called export.xml which can be re-imported into a mediawiki: using System; using System.Text; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Net.Http; using System.Net.Http.Headers; using System.Threading; using System.Threading.Tasks; namespace Rextester { public class MyFormUrlEncodedContent : ByteArrayContent { public MyFormUrlEncodedContent(IEnumerable<KeyValuePair<string, string>> nameValueCollection) : base(MyFormUrlEncodedContent.GetContentByteArray(nameValueCollection)) { base.Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded"); } private static byte[] GetContentByteArray(IEnumerable<KeyValuePair<string, string>> nameValueCollection) { if (nameValueCollection == null) { throw new ArgumentNullException("nameValueCollection"); } StringBuilder stringBuilder = new StringBuilder(); foreach (KeyValuePair<string, string> current in nameValueCollection) { if (stringBuilder.Length > 0) { stringBuilder.Append('&'); } stringBuilder.Append(MyFormUrlEncodedContent.Encode(current.Key)); stringBuilder.Append('='); stringBuilder.Append(MyFormUrlEncodedContent.Encode(current.Value)); } return Encoding.Default.GetBytes(stringBuilder.ToString()); } private static string Encode(string data) { if (string.IsNullOrEmpty(data)) { return string.Empty; } return System.Net.WebUtility.UrlEncode(data).Replace("%20", "+"); } } public class Program { public static void Main(string[] args) { Task.Run(async () => { using (var client = new HttpClient()) { string text = System.IO.File.ReadAllText("pages.txt"); var values = new Dictionary<string, string> { {"catname", ""}, {"pages", text}, {"curonly", "1"}, {"templates", "1"}, {"wpDownload", "1"}, {"wpEditToken", "%2B%5C"}, {"title", "Special%3AExport"} }; var content = new MyFormUrlEncodedContent(values); var response = await client.PostAsync("https://wiki.multitheftauto.com/wiki/Special:Export", content); var responseString = await response.Content.ReadAsStringAsync(); System.IO.File.WriteAllText("exported.xml", responseString); } }).GetAwaiter().GetResult(); } } } To convert the xml to sql you can use mwdumper like this: java -jar mwdumper.jar --format=sql:1.5 exported.xml > sql.sql -
So because the Installer won't install the Editor anymore I extracted the resources from the Installer for you guys : http://www.xup.to/dl,63448374/INSTDIR.rar/
-
Is there a good not complex way to evaluate noises? like the player runs -> 100 points. the player is crouchwalking -> 10 points i have the complex way using these function TOGETHER: getPedTask + getPedControlState + getPedMoveState Is there an easier way to do this? (it should be used to check if an zombie can hear you XX yards away from the player)
-
yes i mean my server players
-
Thanks Towncivilian. Works . But i have a question: can i post crashslogs from my users?
-
@Phat Looser Es gibt dafür jetzt die funktion createSWATRope
-
MTADiag: http://pastebin.com/xF7b5NG4
-
Can't download files..
-
Nice. But your server is offline..
-
rolling11 i've send you 2 PM's. 1. 28 March 2. 27 April Why i do not have a dl link?
-
Don't trust. Fake. viewtopic.php?f=108&t=41560&p=422992#p422992
-
https://community.multitheftauto.com/index.php?p= ... ls&id=4417 -- Shader from Shader examples