KennyKiller

Members
  • Content count

    65
  • Joined

  • Last visited

Community Reputation

0 Neutral

About KennyKiller

  • Rank
    Snitch

Details

  • Gang
    Ballas
  1. 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
  2. Unofficial MTA Script Editor 0.3 (4851) RELEASED!

    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/
  3. best way to evaluate noise

    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)
  4. MTA Crash Module: ntdll.dll

    yes i mean my server players
  5. MTA Crash Module: ntdll.dll

    Thanks Towncivilian. Works . But i have a question: can i post crashslogs from my users?
  6. Abseilen Script Rope

    @Phat Looser Es gibt daf├╝r jetzt die funktion createSWATRope
  7. MTA Crash Module: ntdll.dll

    MTADiag: http://pastebin.com/xF7b5NG4
  8. [Show] MG RacePanel

    time out
  9. [Show] MG RacePanel

    Can't download files..
  10. [Show] MG RacePanel

    Nice. But your server is offline..
  11. [REL] Modat Roleplay Ver 1.0 is out!

    rolling11 i've send you 2 PM's. 1. 28 March 2. 27 April Why i do not have a dl link?
  12. [REL] Modat Roleplay Ver 1.0 is out!

    Don't trust. Fake. viewtopic.php?f=108&t=41560&p=422992#p422992
  13. REPORT COMMUNITY CENTER RESOURCES HERE

    http://community.mtasa.com/index.php?p= ... ls&id=4417 -- Shader from Shader examples
  14. REPORT COMMUNITY CENTER RESOURCES HERE

    Veh mods: http://community.mtasa.com/index.php?p= ... ls&id=4440 http://community.mtasa.com/index.php?p= ... ls&id=4441 http://community.mtasa.com/index.php?p= ... ls&id=4442 http://community.mtasa.com/index.php?p= ... ls&id=4444 http://community.mtasa.com/index.php?p= ... ls&id=4446
  15. REPORT COMMUNITY CENTER RESOURCES HERE

    http://community.mtasa.com/index.php?p= ... ls&id=4432 -- Carmod http://community.mtasa.com/index.php?p= ... ls&id=4429 -- ^^ http://community.mtasa.com/index.php?p= ... ls&id=4427 -- ^^ http://community.mtasa.com/index.php?p= ... ls&id=4433 -- ^^ http://community.mtasa.com/index.php?p= ... ls&id=4434 -- ^^