Jump to content

Mastermosley

Members
  • Posts

    17
  • Joined

  • Last visited

Posts posted by Mastermosley

  1. Just recently got back into Runescape...once again, and my previous clan has disappeared off the map. I am looking for an active, organized, and well developed clan. Depending on my mood i might be into pking or skilling and what not so being in a clan that offers a multitude of activities would be a plus. I created my account way back in the day when Runescape first came out, when you were able to choose your own class and I have played off and on since. Having some old school members would be another plus haha. I can say in all of the previous clans I have been in in my runescape life I have never missed a well advertised event without reason, and never missed a war.

     

    Stats

    Combat - 96

    Attack - 75

    Defense - 75

    Strength - 84

    Constitution - 79

    Pray - 51

     

    Fishing - 70

    Cooking - 70

    Slayer - 72

    Summoning - 1

    Cheers

  2. its not actually grabbing the highscores yet just grabbing each user. from this

    http://services.runescape.com/m=hiscore/overall.ws?rank=1&table=0&scroll=true&category_type=0 every 22 usernames that are processed a global variable which starts at 1 goes up by 22 and the

    link changes respectively: "http://services.runescape.com/m=hiscore/overall.ws?rank=" + globalvariable + "&table=0&scroll=true&category_type=0" which downloads the next source. About the banning, I dont no I haven't been yet anyway. What I am going to do is download each username into an xml database a new one every 100k which will end me up with 20 of these 100k databases. Then my new program will be multithreaded (20 threads) which will grab the highscores similtaniously hopefully making this faster.

     

    I made a mistake when I said it will double when I access the highscores it will probobly slow down by *22 times :( and the final database should be around 3gigs

  3. Okay I am just grabbing the users and adding them to a database at this point, but basically with my code which is below I can process 1000 users a minute meaning its

    going to take 33 hours to get all of the users :P And it will probobly double when I have to grab each members stats, Im stoked to test this out.

     

    Runs on a seperate thread gives me the total amount of usernames processed and the time elapsed.

     

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Threading;
    
    namespace RSGrab
    {
       public partial class Form1 : Form
       {
           int CurrentPageList = 1;
           int usernamec = 0;
           System.Diagnostics.Stopwatch wat = new System.Diagnostics.Stopwatch();
           public delegate void UpdateForm(string text);
           public Form1()
           {
               InitializeComponent();
           }
    
           private void kryptonButton1_Click(object sender, EventArgs e)
           {
    
               wat.Start();
               timer1.Start();
               Thread ms = new Thread(MainStuff);
               ms.Start();
    
    
           }
           private void MainStuff()
           {
               DateTime eventtime1 = DateTime.Now;
               while (CurrentPageList < 1000000)
               {
                   string aData = getPageSource(getCurrentUrl()); //Grab the source
                   aData = StripTagsCharArray(aData); //Gets Rid of <html> tags
                   aData.Trim(); //Trim all whitespaces beginning end end
                   string[] bData = getActualData(aData); //Takes only the data needed
                   //Now that I have the data I need I will parse it for each person
                   int count = 0;
                   int line = 1;
                   while (count < 88)
                   {
                       string name = ""; //Account Name - Only grabbing the Username because I will grab the
                       //entire highscores for each member.
                       if (line == 1)
                       {
                           count++;
                           line++;
                       }
                       if (line == 2)
                       {
                           name = bData[count];
                           count++;
                           line++;
                       }
                       if (line == 3)
                       {
                           count++;
                           line++;
                       }
                       if (line == 4)
                       {
                           ListBox1.Invoke(new UpdateForm(this.AddUserNameXml), new object[] { name });
                           count++;
                           line = 1;
                       }
                   }
    
                   CurrentPageList = CurrentPageList + 22;
               }
               DateTime eventtime2 = DateTime.Now;
               TimeSpan elapsed = eventtime1 - eventtime2;
               MessageBox.Show(elapsed.ToString());
           }
    
           private void AddUserNameXml(string username)
           {
               usernamec++;
               label2.Text = usernamec.ToString();
           }
           private string[] getActualData(string data)
           {
               string[] aData = data.Split('\r', '\n');
               string bData = "";
               int count = 0;
               while (count < aData.Length)
               {
                   if (aData[count].Trim() != "")
                   {
                       bData += aData[count].ToString() + "%";
                   }
                   count++;
               }
               bData.Trim();
               string[] cData = bData.Split('%');
               int newcount = 122;
               int newcount2 = 0;
               string[] final = new string[89];
               while (newcount <= 209)
               {
                   final[newcount2] = cData[newcount];
                   newcount++;
                   newcount2++;
               }
               return final;
    
           }
           private string getCurrentUrl()
           {
               string url = "http://services.runescape.com/m=hiscore/overall.ws?rank=" + CurrentPageList.ToString() + "&table=0&scroll=true&category_type=0";
               return url;
           }
           private string getPageSource(string url)
           {
               System.Net.WebClient wb = new System.Net.WebClient();
               string strSource = wb.DownloadString(url);
               wb.Dispose();
               return strSource;
           }
           private static string StripTagsCharArray(string source)
           {
               char[] array = new char[source.Length];
               int arrayIndex = 0;
               bool inside = false;
    
               for (int i = 0; i < source.Length; i++)
               {
                   char let = source[i];
                   if (let == '<')
                   {
                       inside = true;
                       continue;
                   }
                   if (let == '>')
                   {
                       inside = false;
                       continue;
                   }
                   if (!inside)
                   {
                       array[arrayIndex] = let;
                       arrayIndex++;
                   }
               }
               return new string(array, 0, arrayIndex);
           }
    
           private void timer1_Tick(object sender, EventArgs e)
           {
               label4.Text = Math.Round((decimal)wat.Elapsed.TotalMinutes, 2).ToString();
           }
    
    
       }
    }
    
    

  4. This is what I used for the highscores lookup might help with your api. Taken from RS Regent Toolkit http://www.rsregent.net

    WebClient stats = new WebClient();
                   Stream statstream = stats.OpenRead("http://hiscore.runescape.com/index_lite.ws?player=" + RSN);
                   StreamReader statread = new StreamReader(statstream);
                   string sockread = null, sockline = null;
                   int aa = 0;
                   while ((sockread = statread.ReadLine()) != null)
                   {
                       string[] bb = sockread.Split(new string[] { "," }, StringSplitOptions.None);
                       if (bb.Length == 3)
                       {
                           if (bb[0] != "-1")
                           {
                               int r = int.Parse(bb[0]), l = int.Parse(bb[1]), f = int.Parse(bb[2]);
                               string rank = String.Format("{0:0,0}", r), level = String.Format("{0:0,0}", l), exp = String.Format("{0:0,0}", e);
                               // sockline = SkillsArray[aa] + " " + "Rank: " + rank + " Level: " + level + " Exp: " + exp; aa++; Console.WriteLine(sockline);
                               hst[aa].Text = rank;
                               gst[aa].Text = level;
                               aa++;
                           }
                           else { aa++; }
                       }
                       else
                       {
                           if (bb[0] != "-1")
                           {
                               int r = int.Parse(bb[0]), l = int.Parse(bb[1]);
                               string rank = String.Format("{0:0,0}", r), level = String.Format("{0:0,0}", l);
                               // sockline = SkillsArray[aa] + " " + "Rank: " + rank + " Score: " + level; aa++; Console.WriteLine(sockline);
                               hst[aa].Text = rank;
                               gst[aa].Text = level;
                               aa++;
                           }
                           else { aa++; }
                       }
    
                   }
    
                   statstream.Close();
               }
    
           }
    

     

    I have labels for Rank and Level Referenced in order hst = highscorestext, gst = level. Grabs the highscores lite data and splits it into separate strings and goes from there. Any questions I can probobly help you out.

  5. Hey fellow coders... over the years I've self-taught myself many languages of code, and I'd like to consider myself very skilled. However, my problem is, I only know web and engine-based languages - ex. php, Javascript, and random engine-specific codes. That's great if I want to build a sweet website, or mod a custom gun into a game - but I want to do more.

     

    What I'd like to do is learn a 'program' programming code (C++/Python/Java) so that I can design and develop personal projects that run on systems... not web browsers or with-in other programs. I want to be able to make personal chat clients, widgets, games, and so on. I'm assuming most of you have already grasped what I'm asking, because I've read up on the 'What are your current projects?' thread in this subforum.

     

    So, what do I do? I know a bit about the aforementioned codes but I don't know which one(s) I should learn... my friend recommends Python, but that has to run through an interpreter all the time, doesn't it? - So I wouldn't be able to compile my projects and distrubte them to friends (or so I think).

     

    Thanks for your help and time in advance,

    - Skilly

     

    If you want to learn a programming language that can be utilized on multiple platforms I would suggest C++ because it seems it will never go away and every platform supports it. There is tons of documentations and ebooks avaialble to teach you how and with you knowledge of php and javascript the syntax's are very similiar. Microsoft Visual Studio is by far the best IDE to work with in my opinion. C++ is very complex and will require modivations. Now my personal favorite C# is an awesome language if you want to program for Windows. (Also MONO is available which allows you to run C# programs on other platforms). Its similiar to c++ but much easier to understand. C# is a very powerfull language and you can do just about anything in it as well. Visual Studio Website

  6. I agree it should be legalized. Although it may or may not help the economy depending on where you live. I live in British Columbia, Canada, we produce some of the worlds

    best pot, legalizing it here would be a major boost to our economy because the government would tax that [cabbage] out of it bringing more tax dollars to us, and maby lowering taxes on other things.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.