Jump to content
slacky

[2007] Get current world population

Recommended Posts

As I was reading this tread, i thought to my self, there must be a simple way to get the current world population, while "in game", as I'm familiar with similar tasks from both Python, and PHP, I quickly thought about regular expression, so I checked the scar-wiki, to see if they had a "PregMatchAll"-kindof function, the result was False. But that aint needed, so I went ahead and used "PregMatchEx", and "PregMatch"... I quickly got some good results!! :)

 

Now, what this two functions does is pretty simple..:

 

function RS07_GetCurrentWorld: Integer;

Returns current world while in game, requires MSSL-library.

 

function WorldPlayerCount(world: String): Integer;

Takes a string as input, EG: '305' - It then grabs the visible source from Runescape's world-select page.

Regex: Navigates the data until a world matches your world-string, then grabs the current population, then returns it.

 

Combine this two functions and you automaticly get the current world population.

 

Again, this is thought of as a solution to shadowrecons post, but might be useful elsewhere. And if his calculations are correct for RS07, isn't up to me to figure out! :P

Can also be used (or modified) to find leased populated world, if the bot your working on just need to world-hop to less crowded world, but other solutions might be prefered.

 

program WorldThing;
{$DEFINE RS07}
{$I MSSL\MSSL.scar}


{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|| function RS07_GetCurrentWorld: Integer; 
|| Description: While in game, you can get the world your playing in.
|| Contributors: slacky -> thanks to Janilabo for MSSL (and a few tips).
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
function RS07_GetCurrentWorld: Integer; 
begin
 Result := -1;
 if RS07_OpenGameTab(8) then
   Result := StrToInt(GetTextAtEx(695, 209, 2, RS07_MainFont, False, False, 0, 2, 3381759, 3, True, tr_AllChars)); 
end;


{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|| function WorldPlayerCount(world: String): Integer;
|| Description: Get current player population of a world, can be used to find 
|| best world if you need to world hop, also needed to calculate ORE-respawn time.
|| Contributors: slacky
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
function WorldPlayerCount(world: String): Integer;
var
 i, players: Integer;  
 Matches: TRegexMatchArray;
 Webdata, Match: String;
begin
 i := InitializeHTTPClient(True, True); 
 players := -1; 
 try     
   Webdata := GetHTTPPage(i, 'http://oldschool.runescape.com/slu');
   Match := PregMatch('/e\(('+world+'),(.*?),"oldschool(.*?)",(.*?),(.*?)\);/iM', Webdata); 
   if Match <> '' then
   begin 
     PregMatchEx('/"oldschool(\w+)",(.*?),(.*?)\);/', Match, Matches);  
     players := StrToInt(Matches[2].MatchedText);
   end;
 finally
   FreeHTTPClient(i);
 end; 

 Result := players;
end;


{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|| Test it out?? 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
var 
 world: String;
begin
 MSSL_Setup; 
 world := IntToStr(RS07_GetCurrentWorld); 
 if world<>'-1' Then 
 begin
   writeln('Population '+ IntToStr(WorldPlayerCount(world)) +' @ World '+ world);
 end;
end.

 

Notes:

- As i only touch pascal, once or twice each season the code might (and from what is see; does) contain some unneeded processing.

- The time it takes to get the current world populations will be 0.2-1.5 secounds depending on processing time, and your response time to that server.

- If anyof the functions above fails; the result will be -1

 

Also, I'm aware that i'm not freeing MSSL, I got to leave something out for you guys.

Edited by slacky
Link to comment
Share on other sites

Truly awesome job slacky! Seems like you are getting the scripting going here, sweet!

 

That is pretty damn good looking function aswell, I must say! Beautiful standards.

 

1 tip I'll hook you up with, that I gave to lazarbeam aswell.

 

This:

function RS07_GetCurrentWorld: Integer; 
begin
 if not(RS07_GameTabOpen(8)) then RS07_OpenGameTab(8);
 Result := StrToInt(GetTextAtEx(695, 209, 2, RS07_MainFont, False, False, 0, 2, 3381759, 3, True, tr_AllChars)); 
end;

 

Could be something like this:

 

function RS07_GetCurrentWorld: Integer; 
begin
 Result := -1;
 if RS07_OpenGameTab(8) then
   Result := StrToInt(GetTextAtEx(695, 209, 2, RS07_MainFont, False, False, 0, 2, 3381759, 3, True, tr_AllChars)); 
end;

 

Because RS07_OpenGameTabEx() uses RS07_GameTabOpen() check, where RS07_OpenGameTab() is based on RS07_OpenGameTabEx().

RS07_OpenGameTab() will check if gametab is already open and if it is, it will return true without trying to open it again. :P

 

Then you could have a failsafe if result is -1 (game tab couldn't be activated, this could happen with say... Lag for example).

 

Keep em coming!

 

-Jani

Link to comment
Share on other sites

Ello slacky, I added these awesome commands in latest MSSL, just committed it moment ago. Will be updated to Includes Manager in about 15 minutes.

 

Added in "World.scar", with some functions for world related things. ;)

I edited your functions slightly (just some small changes really), but yes, I of course added the main credits to you - thanks slacky!

 

World.scar (SVN file)

 

Changelog

 

So, we can now EASILY switch worlds at login screen using MSSL!

 

-Jani

Link to comment
Share on other sites

Криптобосс - Зеркало рабочее: Всё, что нужно знать

Криптобосс - это платформа, которая предлагает пользователям доступ к разнородным услугам в области криптовалют и онлайн-гейминга. Принимая во внимание с постоянными переменами в законодательстве и блокировками в некоторых регионах, доступ к основному веб-сайту возможно ограничен. В этой статье мы поговорим про то, как найти рабочее зеркало Криптобосс и его достоинства.

Что такое рабочее зеркало?

Рабочее зеркало - это альтернативный URL-адрес для доступности сайта. Такие рабочие зеркала создаются для обеспечения бесперебойного доступа к платформе, даже если главный веб-сайт заблокирован. Большая часть зеркал имеют идентичный интерфейс и функциональность с оригинальным сайтом.

Как искать зеркало рабочее Криптобосс?

1. Официальные источники: Нередко Криптобосс публикует информацию о рабочих зеркалах на своих официальных страницах в соц сетях. Подписывайтесь на их аккаунты, чтоб быть в курсе заключительных обновлений.

2. Форумы и сообщества: Посетите форумы и сообщества, приуроченные к криптовалютам и азартным играм. Пользователи нередко делятся актуальными ссылками на рабочие рабочие зеркала.

3. Поисковые системы: Вы сможете ввести в поисковой строке "Криптобосс рабочее зеркало" либо "Криптобосс альтернативный сайт". Тем более, будьте осмотрительны и проверяйте ссылку перед тем вот, как переходить по ней.

Как защитить себя от жульнических сайтов?

1. Инспектируйте URL: Убедитесь, что вы переходите на сайт либо зеркало рабочее. Обратите внимание на наличие HTTPS в адресе крипто босс казино тг

2. Изучайте отзывы: Перед тем как использовать ссылку на зеркало, посмотрите отзывы юзеров. Такое может помочь избежать мошеннических ресурсов.

3. Не извещайте личные данные: Будьте осмотрительны с вводом собственной информации на веб-сайтах, которые вы не имеет возможности проверить. Защита ваших данных должна быть на первом месте.

Заключение

Рабочее зеркало Криптобосс является важным инструментом для юзеров, стремящихся получить доступ к платформе, когда основной сайт недоступен. Следуя обычным советам по поиску и проверке зеркал, вы сможете безопасно наслаждаться услугами, которые делает отличное предложение Криптобосс. Всегда оставайтесь внимательными и оберегайте свои личные данные!
Link to comment
Share on other sites

How to Choose the Veracious Escort Intercession in Moscow: Hints and Tips

Choosing an protect agency in the city of moscow can be a challenging work, given the myriad of options available. Here are a infrequent tips to keep from in place of you to make out the correct choice.

Surcease the Reputation

When choosing an guardian agency, the primary thing to to to the point limelight to is its reputation. Search in behalf of online reviews, ratings, and recommendations from distinguishable clients. The first agencies usually give birth to incontestable reviews and a high level of trust.

Learn about the services offered

Each squire agency makes a matchless deal contrasting services. Guarantee that the intercession offers specifically what you sine qua non. This may involve many types of escorts, rendezvous themes or additional services such as escorting to events.

Learn about costs

Prices for protect services can fluctuate massively between agencies. Analogize resemble costs of services at several agencies to reveal the commonplace value in the service of attribute. About that too indecent prices may manifest low equal of service.

Extend notoriety on safety

Cover is an superior face at the continually of choosing an cortege agency. Bring about unfaltering the intervention has safety measures in niche concerning both indispensable and escorts. This may comprise particularity verification, confidentiality, and regulation security https://cabaan.com/2017/08/29/hello-world/?unapproved=84599&moderation-hash=a9abba83c88b04d82a63a398e9e246b8#comment-84599

Contact the Medium

Positiveness your instincts

At the vastly effect, belief your instincts. If you acquire doubts nearby the intervention or you sense uncomfortable, do not unsettled to look after other options. Your satisfaction and security should come first. https://2022.laithung.go.th/forum/suggestion-box/84943-how-to-choice

Not later than following these tips, you have the opportunity to settle upon the only accompany activity in Moscow, as a result ensuring a pleasant and justified experience. http://www.tcea-taiwan.com/TCEA/articles/%e7%82%ba%e4%ba%86%e4%bf%83%e9%80%b2%e8%aa%8d%e7%9f%a5%e8%aa%8d%e7%9f%a5%e5%8a%9f%e8%83%bd%e9%9a%9c%e7%a4%99%e9%81%8b%e5%8b%95%ef%bc%8c%e7%89%b9%e9%82%80%e6%be%b3%e6%b4%b2%e5%ad%b8%e8%80%85%e4%be%86/?unapproved=77703&moderation-hash=c20b91b91e0018eb8fd14620b3544d99#comment-77703
How to Choose the Right Escort Intercession in Moscow: Hints and Tips

Choosing an protect activity in Moscow can be a involved charge, premised the diverse of options available. Here are some good answers to support you to make the reprimand choice. https://avzur.kg/?p=396&unapproved=373545&moderation-hash=09d458b69320857762f2567cb6c09aa7#comment-373545

Damper the Position

When choosing an protector intermediation, the first thing to compensate notice to heed to is its reputation. Determine online reviews, ratings, and recommendations from special clients. The most superior agencies almost always suffer with positive reviews and a high equal of trust.

Learn about the services offered

Each escort medium offers distinguishable services. Make sure that the intercession makes a renowned distribute specifically what you penury. This may encompass different types of escorts, meeting themes or additional services such as escorting to events.

Learn about prices

Prices after protect services can alternate significantly between agencies. Bear costs of services at a sprinkling agencies to find the customary value for the purpose eminence. Recall that selfsame low prices may suggest unfavourable constant of service.

Core on security

Safeness is an vital point of view when choosing an usher agency. Make unshakeable the means has precautions in squelch pro both fated and escorts. This may classify congruence verification, confidentiality, and policy security http://pastebin.falz.net/2533537

Association the Medium

Care your instincts

At long last, credit your instincts. If you cause doubts nearly the intervention or you caress uncomfortable, do not bewildered to look after other options. Your satisfaction and protection should come first.

By following these tips, you participate in the moment to choose the right accompany medium in the diocese of moscow, as a result ensuring a pleasant and safe experience.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...