SkulkrinBait
Morkin Admin
Haxx0rs == Suxx0rs! v4
Posts: 6,680
|
Post by SkulkrinBait on Aug 13, 2005 13:49:41 GMT
As you may know I am coding a database for all spying reports.
I've had a few ideas of little extra touches to add to it, let me know what you think and any more ideas. If my coding abilities are up to it I will add new features, time permitting.
I will add a feature which adds up the total defensive value of any spied islands, if I can work out the formula I will also add in a combat calculator routine so you can enter your army and it will give you a % chance of winning.
I want to also add a distance calculator which will also give you an answer tellling you how long it would take to get to the island at 4/5/6 kts.
I might make it so you need to register for security and also enter you islands home coordinates when you do so, then it could automatically tell you how far away each island was. Not great if you have more than one island but a start.
|
|
SkulkrinBait
Morkin Admin
Haxx0rs == Suxx0rs! v4
Posts: 6,680
|
Post by SkulkrinBait on Aug 13, 2005 20:24:17 GMT
Could someone post the images used for archers and catapults please, I can't find them.
Thanks.
|
|
Raven
Public Area Guest
Posts: 410
|
Post by Raven on Aug 13, 2005 20:51:02 GMT
|
|
SkulkrinBait
Morkin Admin
Haxx0rs == Suxx0rs! v4
Posts: 6,680
|
Post by SkulkrinBait on Aug 13, 2005 22:04:36 GMT
Why?
|
|
SkulkrinBait
Morkin Admin
Haxx0rs == Suxx0rs! v4
Posts: 6,680
|
Post by SkulkrinBait on Aug 13, 2005 22:04:59 GMT
Ah yes, I get it now, thanks!
|
|
SkulkrinBait
Morkin Admin
Haxx0rs == Suxx0rs! v4
Posts: 6,680
|
Post by SkulkrinBait on Aug 13, 2005 22:25:37 GMT
Another idea for a little feature, where the totals are shown for gold, stone and lumber, I could also show how much is plunderable and not based on the size of storehouse.
|
|
SkulkrinBait
Morkin Admin
Haxx0rs == Suxx0rs! v4
Posts: 6,680
|
Post by SkulkrinBait on Aug 13, 2005 23:07:03 GMT
It's done, very rough and ready but I can enhance it as time goes by. www.speedworx.org/ik/view.phpLet me know stuff! Bugs and ideas welcomed. One idea I do have (that's me, full of ideas and other stuff!) is to work out the score for each island (or have a field so you can enter it) so you can see if an isle is inactive. If a score doesn't change for a few weeks it is likely inactive.
|
|
|
Post by Old Shendemiar on Aug 14, 2005 0:36:16 GMT
It works!
But it's hardly usable.... (Sorry) Too many input slots.
Make a system where is two pages, input and query. On inputpage there is one big multiline textbox, and a submit button. Everyone can paste the whole spy report there, and hit submit.
Just the string and an autoincrease id is stored in the database.
Query page would ask for coordinates, and return all rows that have the coordinates string in the record, sorted descending by the id, so latest would come first. (so as a benetfit, It could do search with any string)
Simple and rather effective.
|
|
SkulkrinBait
Morkin Admin
Haxx0rs == Suxx0rs! v4
Posts: 6,680
|
Post by SkulkrinBait on Aug 14, 2005 8:42:55 GMT
OK, will change it.
|
|
SkulkrinBait
Morkin Admin
Haxx0rs == Suxx0rs! v4
Posts: 6,680
|
Post by SkulkrinBait on Aug 14, 2005 13:04:17 GMT
Ideally I want it so you can cut and paste the report and the script would then find the variables from that bit of text and assign them out to mine level whatever etc etc.
I assume that's possible with php, anyone got any ideas how?
|
|
|
Post by Old Shendemiar on Aug 14, 2005 16:37:36 GMT
Ideally I want it so you can cut and paste the report and the script would then find the variables from that bit of text and assign them out to mine level whatever etc etc. I assume that's possible with php, anyone got any ideas how? It surely is. Just store the whole string, and on the view/query page have php chew the stuff for you. You could read about string search functions, or the regexp regular expression search, i'd the the earlier. Go to php's manual pages and browse through string functions section. You could make it search for string like "Gold mine level:" then learn the position where that finding was found, and calculate the place where the following ":11 lvl" is found, and then extract it.
|
|
soiram
Morkin Member
Morkin Godfather
Posts: 1,125
|
Post by soiram on Aug 14, 2005 17:59:42 GMT
Nice and useful David!
I have a spreadsheet of some spying reports, so I will enter details when I get back from holidays.
One thing I noticed is that when entering island coordinated on the first page, if I press enter on the keyboard it does not have the same effect as clicking on the button you provide, rather it seems to be clearing the text box and I need to enter coords again.
|
|
SkulkrinBait
Morkin Admin
Haxx0rs == Suxx0rs! v4
Posts: 6,680
|
Post by SkulkrinBait on Aug 14, 2005 19:59:29 GMT
I've updated it so you can just cut and paste the reports, but the problem is when retrieving them the formatting is crap. I suppose this is because the whitespace isn't being stored, just the characters. Any ideas how I can improve this, I've tried using CSS to make the details in a narrow window but it's not really working.
It will suffice for now, still gives the data but not as easy to read as I'd hoped.
Will people use it? If not then I'll stop now, if they would then I will continue enhancing it.
|
|
|
Post by Old Shendemiar on Aug 14, 2005 21:08:46 GMT
Please continue, i think i'll be very usefull when it's polished.
When you lear how to extract each part of the data (as i described earlier) you can make the output look just like you want.
|
|
|
Post by Old Shendemiar on Aug 15, 2005 5:17:10 GMT
Function extractfromspyreport($needle, $ansverlenght $haystack) { $found_position = strpos($haystack, $needle); $needle_lenght = strlen($needle); if($found_position AND $needle_lenght) $ansver = substr($haystack, $found_posistion, $ansverlenght); else $ansver = "Not found";
return $ansver; }
$haystack is "report blaah blaah logs:5050484 gold mine: 5 Lvl some nuts"
echo extractfromspyreport("gold mine:", 5, $haystack)
would print " 5 Lv"
Someone check this dont have php with me.
Then you would have the pleasure to set it to extract all the needed data!
|
|