I decided to make a program that checks traffic on rs worlds(for me and m8s just to go looting whenever clans hop)
i got it work but the string i get from rs world select page changes every time i dl it so can any1 give me a tip how to mach the correct world with players
heres the code
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.Diagnostics;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string inf = ",1";
int counter = 0;
int[] p = new int[60];
int[] w = new int[60];
int[] vahe = new int[60];
int[] ws = new int[60];
string Players = "";
string World = "";
System.Net.WebClient client = new System.Net.WebClient();
private void button1_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
listBox1.Items.Add("World" + " " + "Players");
System.IO.StreamWriter sw = new System.IO.StreamWriter("C:\\world.txt");
string world = client.DownloadString("http://oldschool.runescape.com/slu");
sw.Write(world);
sw.Close();
System.IO.StreamReader sr = new System.IO.StreamReader("C:\\world.txt");
for (int i = 1; i < 681; i++)
{
string l = sr.ReadLine();
if (l.Contains(inf))
{
Players = l.Substring(29, 3);
World = l.Substring(4, 3);
Players = Players.Replace(",", "");
counter++;
if (Players.Length == 2 && World != "316")
{
Players = l.Substring(28, 3);
Players = Players.Replace(",", "");
}
if (World == "317")
{
Players = l.Substring(30, 3);
}
if (World == "302")
{
Players = "1" + Players;
}
p[counter] = Int16.Parse(Players);
listBox1.Items.Add(World + " " + Players);
}
}
sr.Close();
counter = 0;
}
private void button2_Click(object sender, EventArgs e)
{
listBox2.Items.Clear();
listBox2.Items.Add("World" + " " + "Players" + " " + "+/-");
System.IO.StreamWriter sw = new System.IO.StreamWriter("C:\\world.txt");
string world = client.DownloadString("http://oldschool.runescape.com/slu");
sw.Write(world);
sw.Close();
System.IO.StreamReader sr = new System.IO.StreamReader("C:\\world.txt");
for (int i = 1; i < 681; i++)
{
string l = sr.ReadLine();
if (l.Contains(inf))
{
Players = l.Substring(29, 3);
World = l.Substring(4, 3);
Players = Players.Replace(",", "");
counter++;
if (Players.Length == 2 && World != "316")
{
Players = l.Substring(28, 3);
Players = Players.Replace(",", "");
}
if (World == "317")
{
Players = l.Substring(30, 3);
}
if (World == "302")
{
Players = "1" + Players;
}
w[counter] = Int16.Parse(Players);
vahe[counter] = (w[counter] - p[counter]);
listBox2.Items.Add(World + " " + Players + " " + vahe[counter]);
}
}
sr.Close();
counter = 0;
}
private void Form1_Load(object sender, EventArgs e)
{
this.FormBorderStyle = FormBorderStyle.FixedSingle;
}
}
}
its sloppy code cuz i wanted to put it together quickly
btw is C#