Source:
http://www.multiupload.com/1MUYOKAMNZ
Ads are shown if the browser is big enough to show them:
Ads are hidden if the browser is too small:
Right when you load it:
If you get an error like licenses.lx or something is missing just go into the properties folder and remove it.
Just download my source and it will work fine, if you try and copy paste into your project I'm not going to help you.
Code:
private void Form1_Resize(object sender, EventArgs e)
{
panel1.Height = this.Height - 44; // calculate the main left panel's height
panel1.Width = this.Width - panel2.Width - 30; // calculate the correct width
panel3.Height = panel1.Height - panel4.Height - 6; // calculate the right height for the runescape panel
panel2.Left = panel1.Width + 3; // just move this to the right location
panel2.Height = this.Height - 44; // resize this to go with the whole client's height
try
{
if (webBrowser1.Url.AbsoluteUri.Contains("world") && webBrowser1.Url.AbsoluteUri.Contains("runescape.com"))
{
webBrowser1.Document.Window.ScrollTo(0, 128); // stupid ads, scrolls down if it needs to. it won't scroll if there is enough room for ads
}
}
catch (Exception ex)
{
// lol errorzorz, the client doesn't exist yet!!
}
}
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
webBrowser1.Document.Body.Style = "border-style: none; border-width: 0px;"; // get rid of border around webbrowser1
if (webBrowser1.Url.AbsoluteUri.Contains("game.ws") && webBrowser1.Url.AbsoluteUri.Contains("runescape.com"))
{
webBrowser1.ScrollBarsEnabled = false; // we will scroll automatically
HtmlElement he = webBrowser1.Document.GetElementsByTagName("frame")[0]; // when you load game.ws it makes a frame with the world page in it
webBrowser1.Navigate(he.GetAttribute("src")); // go to the real url, then we can get rid of the borders and stuff
}
else if (webBrowser1.Url.AbsoluteUri.Contains("world") && webBrowser1.Url.AbsoluteUri.Contains("runescape.com"))
{
webBrowser1.ScrollBarsEnabled = false; // we will scroll automatically
webBrowser1.Document.Window.ScrollTo(0, 128); // stupid ads
}
else
{
webBrowser1.ScrollBarsEnabled = true; // re-enable the scroll bars since we aren't viewing the game page anymore
}
}
private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
if (webBrowser1.Url.AbsoluteUri.Contains("game.ws") && webBrowser1.Url.AbsoluteUri.Contains("runescape.com"))
{
webBrowser1.ScrollBarsEnabled = false; // we will scroll automatically
HtmlElement he = webBrowser1.Document.GetElementsByTagName("frame")[0]; // when you load game.ws it makes a frame with the world page in it
webBrowser1.Navigate(he.GetAttribute("src")); // go to the real url, then we can get rid of the borders and stuff
}
else if (webBrowser1.Url.AbsoluteUri.Contains("world") && webBrowser1.Url.AbsoluteUri.Contains("runescape.com"))
{
webBrowser1.ScrollBarsEnabled = false; // we will scroll automatically
webBrowser1.Document.Window.ScrollTo(0, 128); // stupid ads
}
else
{
webBrowser1.ScrollBarsEnabled = true; // re-enable the scroll bars since we aren't viewing the game page anymore
}
}