SRL Archive - Senior Scripts and Snippets

Monster Database


Boreas

2008-12-21 20:37:19

Have you ever wanted to know all the monsters between 30-60 cmb that always drop bones and are weak against magic? I do. So I wrote a script (attached below) to dump most of the data in the RuneHQ database into an INI (also attached below, take off the '.scar'). Now you can search it to find the best place to train. Have fun.


Edit:
Example of searching
program New;
var tmpstr:string;
count,time:integer;
begin
time:=getsystemtime;
for count:=0 to 586 do
begin
tmpstr:=ReadINI(inttostr(count),'100% Drop',AppPath+'\MonsterDB.ini');
if pos('bones',lowercase(tmpstr))>0 then
begin
tmpstr:=ReadINI(inttostr(count),'Combat Level',AppPath+'\MonsterDB.ini');
if strtoint(tmpstr)<70 then
begin
if strtoint(tmpstr)>20 then
begin
tmpstr:=ReadINI(inttostr(count),'Weakness',AppPath+'\MonsterDB.ini');
if pos('mag',lowercase(tmpstr))>0 then
begin
writeln(inttostr(count)+' '+ReadINI(inttostr(count),'ID',AppPath+'\MonsterDB.ini'));
end;
end;
end;
end;
end;
writeln(inttostr(getsystemtime-time));
end.
Took 2094 ms.

Mr.Klean

2008-12-21 20:48:14

Hmm. Looks interesting. Although why did you have it drop into a .ini?

Isn't it just a configuration file type?

Boreas

2008-12-21 21:11:39

Yea, could be whatever you want, I'm just used to INI.

Mr.Klean

2008-12-21 21:47:09

Oh, I thought you may have had a reader for it or something that made it a bit more formatted.
It's still sweet though.

Method

2008-12-21 22:24:46

Looks nice. Thanks Boreas!

Boreas

2008-12-21 22:25:35

The formatting is just SCARs ReadINI/WriteINI.

BTW, add this line
OpenWebPage('http://runehq.com/database.php?type=monster&id='+ReadINI(inttostr(count),'ID',AppPath+'\MonsterDB.ini'));
after the last If in the searcher. Just make sure you don't have like 100 results, or firefox will go crazy :p

Edit: Thanks Method.

Freddy1990

2008-12-22 14:02:27

I wrote a program a couple of years ago that dumped the runehq monsterdatabase to an ini file, but it seems yours has a few html tags left in there =/

Boreas

2008-12-22 22:19:32

Still got it somewhere? Yea I put the html removing loop in the weakness section, but forgot to put it everywhere else. Doesn't really matter though as pos>0 works anyway.

Freddy1990

2008-12-23 14:32:11

From: Boreas
Still got it somewhere? Yea I put the html removing loop in the weakness section, but forgot to put it everywhere else. Doesn't really matter though as pos>0 works anyway.


It was several years ago, so I dunno if it's still compatible anymore at all, it's in VB, I'll try to find it, but I can't promise anything… If I still have it it's burried somewhere in my backups

EDIT: Found it http://freddy1990.com/files2/MonsterGen.rar
Note that the code is a mess, seeing it's over 2 years old from back when I still used VB, lol, dunno if'd still work though… I wrote it for a new version of my Fredd-e-scape client which I never finished…

Boreas

2008-12-23 15:19:40

What was Fredd-e-scape going to be?

Freddy1990

2008-12-23 17:48:35

From: Boreas
What was Fredd-e-scape going to be?


It was Fredd-e-scape Revolution or something like that, the follower of Fredd-e-scape Reloaded which was the follower of Fredd-e-scape which was one of the things that are at the base of my reputation… Fredd-e-scape was a VB-based RS webclient: http://freddy1990.com/wiki/index.php?title=Fredd-e-scape Haven't gotten around to writing the wiki page though, but the logo and screenshot are in there… The screenshot explains it better than I could :)