View Full Version : Daily Info
icon315
05-23-2010, 08:10 PM
This script shows you the daily information such as:
The things that Moons effects, and how they are effected
Shows Prices from Coldfront Marketplace
Stat Day
Daily Dungeon: Shows Rooms
Hermit: How many are in stock
Familiar Arena: Familiar info
Bounty Hunter Hunter: What the hunts are
Chez Snootée: Items Available
Micromicrobrewery: ' '
Current Prices on Certain Items
Birthdays
New Messages
Store Log
Version 6.11
Requires:
DATELIB.ASH (http://kolmafia.us/showthread.php?4242-DateLib-a-way-to-predict-future-moon-phases)
HTMLFORM.ASH (http://kolmafia.us/showthread.php?3842-Form-of...HTML)
ONE OF THE LATEST DAILY BUILDS (http://builds.kolmafia.us/)
"My script extracts information from other sites, So you don't have to"
SNAPSHOT (http://i56.tinypic.com/awqbtf.jpg)
Updates:
1.1 - Added Mr A Prices
1.2 - No longer needs Datelib.ash, made simpler
1.3 - Separated sections for easier customization
1.3.1 - Fixed Formula
2.0 - New Look (thanks to Heeheehee) now tells you future info, tells you the stat day of that date
2.1 - Added Birthdays
2.2 - A few edits
3.0 - using the coldfront marketplace instead of item.ofloathing....which in turn changed the look a little
4.0 - added raffle items
4.1 - Improved item Checker
5.0 - New Marketplace Use
6.0 - Seperated sections into different pages, Added \"New messages" and Store log to the Events tab, Instead of aborting when you have an older version, it just Gives you a message, Added the picture of the current moons to the moon page
6.1 - Retrieves the items for price checking from .txt file, Added a submit field for new items, I Opted out "New messages" and Store log to the Events tab for the time being, Added a message to the 0 meat items.
6.11 - Fixed the code
Winterbay
05-24-2010, 11:49 AM
Nice! Works perfectly (today at least :) ).
Could be useful when I do not want to go everywhere else to check out all the info.
Muhandes
05-24-2010, 01:45 PM
Very nice, and an instant classic for me. Thanks!
WarrantyVoid
05-25-2010, 03:07 AM
I like this a lot. Good work Icon!
icon315
05-25-2010, 05:06 AM
UPDATE!
It will now show you the Current Price (or close to it) of a Mr A!
heeheehee
05-25-2010, 05:18 AM
Wait, before you go off and report the miniature antler thingy as a bug, it's actually a slight error in your code.
write ("Miniature antlers: +"+ ceil( 1 + ( Light / 2) + Ham)+" Familiar Weight<br>");
I'm not entirely sure why you're using the call to the minimoon light, since that's already factored into moon_light(). It should just be
write ("Miniature antlers: +"+ ceil( 1 + ( Light / 2))+" Familiar Weight<br>");
Also, even if it were necessary to call the minimoon light, it would have to be
write ("Miniature antlers: +"+ ceil( 1 + ( Light + Ham) / 2)+" Familiar Weight<br>");
Also, I'm not entirely sure why datelib is needed. Wouldn't a call to numeric_modifier() suffice?
peacy
05-25-2010, 05:25 AM
Nice One!
Might want to whack in something like this:
NO = NO.replace_string("clovers.html\"","http://www.noblesse-oblige.org/calendar/clovers.html\" target=\"_blank\"");
icon315
05-25-2010, 05:53 AM
Thanks for the input, going to fix now
DONE! redownload, no longer requires datelib.ash
forgot my password
05-25-2010, 01:39 PM
It's very nice. I'd like it if you cut the n.o. html file into pieces so we could rearrange and delete them. Here (http://kolmafia.us/showthread.php?3549-manageprices.ash-Quick-mall-management!)'s an example of how to do that with substring.
I'd also like if it showed clovers on the starting screen, with yellow exclamation points, above the kingdom of loathing bar.
icon315
05-25-2010, 08:46 PM
i think i can do the seperate sections thing. but i think that the exclamation point thing would need another script. maybe you can make mafia open up Daily INfo on start up
DONE! PLEASE REDOWNLOAD
heeheehee
05-25-2010, 11:46 PM
Erm, I don't think that
int Dark = 9 - Light; is correct in all instances. As mentioned, it'd probably be a better idea to use numeric_modifier(), as such:
int Dark = numeric_modifier("depleted grimacite grappling hook", "adventures");
This way, there's also less chance of getting the formula wrong ('cause if it's wrong, you can blame it on Mafia, not your script. :) )
icon315
05-25-2010, 11:56 PM
Yeah oK ;D
Done, GO DOWNLOAD
icon315
05-31-2010, 03:45 PM
I had an idea, to add Tomorrows Info to the script. This would include The Moon info (and something else if i can think of it). The only downside is that it would require you to download DateLib.ash. I would like to know your opinion, Vote Now!
Winterbay
05-31-2010, 09:17 PM
I would have no problem with that as I already have datelib downloaded :)
Getting information on upcoming things could be interesting, especially if you want to use yoru grue or check for stat days.
peacy
05-31-2010, 09:28 PM
Yaay gogo! tomorrow would be lovely :-)
heeheehee
05-31-2010, 09:31 PM
Erm, by the way, I totally missed a pretty big bug in datelib, so you'd all have to redownload it.
In other news, I got bored, so I modified this script so you can supply a date, and it'll output all information available.
Requires DateLib and HTMLform.
icon315
05-31-2010, 09:56 PM
Thanks, :D i will download and check it out
UPDATE!
Now tells you what stat day it is. Please Go download, if you want a preview check out the snapshot
darlic
06-05-2010, 03:33 AM
Keep Doing what you do Icon! you rock at scripting
icon315
06-05-2010, 03:36 AM
Thanks.
NEW UPDATE:
Now shows the birthdays from that day.
Nossidge
06-05-2010, 05:30 AM
This is excellent; really, really good! I've just got two ideas for improvement:
Any chance it could auto-populate the info for today's date, without having to click Submit each time?
How about having it in the same font as the rest of KoL, which is "font-family: Arial, Helvetica, sans-serif;"?
icon315
06-05-2010, 05:43 AM
i'll try to do these things
How does the HTML for the Font work?
I got the whole show the info automatically part down. I will post it as soon as i get the whole font info
UPDATE!
OK done...posting it now
Also if you would like some older versions just Pm me and i will see what i can do
Camber
07-15-2010, 02:58 PM
Today, running v8541 i received the following error when running relay_Daily_Info.ash:
Begin index -1 out of bounds (relay_Daily_Info.ash, line 43)
After i commented out the few lines looking up the Mr. prices, it ran fine. Then i see it uses items.ofloathing.org for prices. You should probably either change the url or remove the option. Thanks for a great script!
icon315
07-27-2010, 11:10 PM
once again there is a new update....now you can add more things to the price checker...check line 55 for the settings
SnapShot-http://i32.tinypic.com/2v99bg9.jpg
Theraze
07-28-2010, 10:10 PM
Not sure if it's just me, but the prices were returning blank for me today.
Current Prices:
Item Today's Quantity Sold Today's PPU PPU Difference from Yesterday % Change
Mr. Accessory 0 0 0
twinkly wad 0 0 0
Travoltan trousers 0 0 0 -1%
heeheehee
07-28-2010, 10:15 PM
Erm, yeah. Meant to post yesterday that it seems like the Coldfront Marketplace is down, but I apparently never actually submitted it. (Also somewhat evident in your snapshot. =P) Maybe a check to see if visit_url("http://kol.coldfront.net/market/kolmarket.html") returns the empty string, at which point stop attempting to render the market data?
Theraze
07-28-2010, 10:24 PM
Yeah... after I noted it being down, I checked his screenshot, blinked a few times, and pondered whether that was behaviour as designed or just not noticed. I'd thought it was working before. :) Good to know I'm not just crazy. Though it can still be a contribuiting factor.
icon315
07-28-2010, 10:30 PM
The marketplace is not in fact down, the snapshot was taken right after rollover so the prices where not up. i used the marketplace because that was the only thing available. i am only displaying the information from the place. it isn't really my fault that for some reason the marketplace resets
Theraze
07-29-2010, 01:02 AM
Maybe it isn't down... but RIGHT NOW the marketplace is still giving me the same 0 0 0 results that I posted getting a few hours back. It hasn't been giving results for a minimum of 3 hours, if not all day. What heeheehee suggested is that if the marketplace site doesn't give data for whatever reason, just skip displaying the blank information. :)
icon315
07-29-2010, 02:40 AM
OOOOOOH I SEE.
The Marketplace resets after rollover. it does not update til someone buys an item. so if no one has bought that item that day it does no update....here is a new
SNAPSHOT (http://i28.tinypic.com/552zjd.jpg)
tOaDeR
08-10-2010, 11:50 AM
i'm a bit confused as to how this works. how do i get to that page you keep showing snapshots of?
Winterbay
08-10-2010, 11:57 AM
i'm a bit confused as to how this works. how do i get to that page you keep showing snapshots of?
1) Download the script in the first post to the "relay" folder in your mafia installation folder
2) Launch mafia and log in
3) Open up the relay browser
4) Pick DailyInfo from the drop down menu in the top corner
icon315
08-10-2010, 02:11 PM
While i have your attention, here is a minor fix to the %Changes thing not displaying.
Replace this, on lines 55-66
foreach i in $items[ 194, 1450, 1792] {
string Mall = visit_url ("http://kol.coldfront.net/index.php/content/view/245?search="+i+"&action=Search");
string Prices = substring ( Mall, index_of ( Mall , "% Change" ) , index_of ( Mall , "</STRONG>" ) );
Prices = Prices.replace_string ("/images/arrowdown.gif", "http://kol.coldfront.net/images/arrowdown.gif");
Prices = Prices.replace_string ("/images/arrowup.gif", "http://kol.coldfront.net/images/arrowup.gif");
Prices = Prices.replace_string ("/images/arrowsame.gif", "http://kol.coldfront.net/images/arrowsame.gif");
Prices = Prices.replace_string ("% Change", "");
write ("<br>"+Prices);
}
}
write("</STRONG></TD><TD class='sectiontableentry1' ALIGN=RIGHT>-1%</TD></TR></TABLE></CENTER>");
with this
foreach i in $items[ 194, 1450, 1792] {
string Mall = visit_url ("http://kol.coldfront.net/index.php/content/view/245?search="+i+"&action=Search");
string Prices = substring ( Mall, index_of ( Mall , "% Change" ) , index_of ( Mall , "</TD></TR></TABLE></CENTER>" ) );
Prices = Prices.replace_string ("/images/arrowdown.gif", "http://kol.coldfront.net/images/arrowdown.gif");
Prices = Prices.replace_string ("/images/arrowup.gif", "http://kol.coldfront.net/images/arrowup.gif");
Prices = Prices.replace_string ("/images/arrowsame.gif", "http://kol.coldfront.net/images/arrowsame.gif");
Prices = Prices.replace_string ("% Change", "");
write ("<br>"+Prices);
}
}
write("</TR></TABLE></CENTER>");
tOaDeR
08-10-2010, 08:15 PM
1) Download the script in the first post to the "relay" folder in your mafia installation folder
2) Launch mafia and log in
3) Open up the relay browser
4) Pick DailyInfo from the drop down menu in the top corner
thanks very much for this information. i had no idea i was supposed to move it there
Theraze
08-10-2010, 11:00 PM
Just wondering, is
print("http://kol.coldfront.net/index.php/content/view/245?search="+i+"&action=Search"); actually useful? Commenting it out appears to not affect the display: everything's showing 0/0/0 for me right now... stupid fail-buy days. Heh...
It's causing an additional server hit per item, without actually being processed in any way, if I understand it properly?
icon315
08-10-2010, 11:13 PM
err woops meant to remove that...put that there for testing
also the whole 0% thing isn't really my problem, my script just bring the information in from other locations
Theraze
08-11-2010, 03:59 AM
Yeah, I know that's their site not getting anything bought yet today. :) Eventually I'll come up with some way of making it display NO DATA or (better) skipping those entries entirely. But I haven't cared about it enough to work through it yet. :)
icon315
08-11-2010, 04:18 AM
Well if looking at the page uses a server hit, we might as well print on the page....i was going to make it so that you can Toggle the sections
Theraze
08-11-2010, 06:42 AM
Yes/no? If it's just displaying 0 as its data, that's not accurate... The actual prices of the items hasn't dropped 100%, it's just displaying that there was a lack of accurate information. If that's the case, printing NO DATA or NO SALES TODAY or even skipping those entries gives a more accurate look to someone who isn't aware (as I wasn't) of how the Coldfront's KoL marketplace tracking apparently works. :D
Winterbay
08-11-2010, 06:58 AM
If you enter a valid item-ID, but one that isn't in the Coldfront marketplace system yet for whatever reason (the frisbee -ITOM for example) the script stops the print-out at the prior item and the rest of the information isn't shown (i.e. raffle prizes and food items and so on).
Would it be possible to add some kind of error handling for this case so that the script doesn't abort? The error message printed in the CLI-window said something similar to "Index out of bounds" (shall check more specifically later on today).
icon315
08-11-2010, 06:18 PM
I don't think i should edit it, because The Marketplace is going to be upgraded soon
Theraze
08-11-2010, 08:01 PM
By missing frisbee iotm, do you mean the glowing frisbee, found at http://kol.coldfront.net/newmarket/itemgraph.php?itemid=4619×pan=1&noanim=1 and seeming to work, if not have a major trading volume?
icon315
08-11-2010, 08:10 PM
Wow, they updated the marketplace already? that means i need to update my script
Theraze
08-11-2010, 08:23 PM
Yeah... unfortunately, for me at least, actually picking an item from the dropdown doesn't work properly... but manually replacing the number in one of the links works wonderfully. Even better now that I finally noticed the ability to see Kolmafia's internal number database. :)
icon315
08-11-2010, 08:31 PM
UPDATE
Now uses the fancy new Marketplace...looks way better, no more 0's
SNAPSHOT (http://i35.tinypic.com/28r2y5x.jpg)
Theraze
08-11-2010, 09:20 PM
Added a few entries to the parsing code to make it be a bit less wordy and more similar to the old categories... added these:
Prices = Prices.replace_string ("CURRENT AVG PRICE", "PPU");
Prices = Prices.replace_string ("# BOUGHT THIS TIMESPAN", "Quantity");
Prices = Prices.replace_string ("Latest Price Change", "Change");
Prices = Prices.replace_string ("Timespan Price Trend", "Trend");
Prices = Prices.replace_string (".0", "");
Basically, the very wordy items get replaced with single word descriptors, and if a number is .0, strip it so I don't have to stare at useless decimals. :)
Also, thanks so much for all your work on this. :) I enjoy it and stare at it because of that. :D
icon315
08-11-2010, 09:25 PM
Ok, just going to change out the script since not many people have downloaded it.....no Version change
icon315
12-17-2010, 01:22 AM
UPDATE. NEW VERSION!
Yeah i know it has been a while, but finally it is here\
Version 6.0
Changes:
Seperated sections into different pages
Added \"New messages" and Store log to the Events tab
Instead of aborting when you have an older version, it just Gives you a message
Added the picture of the current moons to the moon page
Please Report any problems
Have anything you want to add to it? just tell me and i might do so
roippi
12-17-2010, 05:15 AM
Big fan of the tabbed interface. As you already know :cool:
icon315
12-19-2010, 02:59 AM
Yeah. it makes it easier to get to what you are looking for. I just wish i could add more stuff. It seems sort of blank.
coaster3000
12-19-2010, 07:32 PM
I have a feature request. Can you make the item lookup for the market place thing with a zlib variable instead... if you need help i am willing to look into it myself :) As long as i can get to it. Currently working on school stuff. so may take a while before i even get started if you need my help for it..
Yeah. it makes it easier to get to what you are looking for. I just wish i could add more stuff. It seems sort of blank.
My feature requests would cover that so it makes it easier for it to get prices and such..
icon315
12-23-2010, 06:51 PM
UPDATE. NEW VERSION!
Version 6.1
Changes:
1. Retrieves the items for price checking from .txt file
2. Added a submit field for new items.
3. I Opted out "New messages" and Store log to the Events tab for the time being.
4. Added a message to the 0 meat items.
EDIT:
Version 6.11
fixed code
Please Report any problems
Have anything you want to add to it? just tell me and i might do so.
AlbinoRhino
12-24-2010, 12:05 AM
Seems to work fine when adding items. Both the "Events" and the "Market Prices" tabs appear to display the item info. Also, the CLI keeps showing the following :
true
Your item was saved successfully.
Begin index -1 out of bounds (relay_Daily_Info.ash, line 144)
false
Begin index -1 out of bounds (relay_Daily_Info.ash, line 144)
true
Your item was saved successfully.
Begin index -1 out of bounds (relay_Daily_Info.ash, line 144)
false
Begin index -1 out of bounds (relay_Daily_Info.ash, line 144)
false
Begin index -1 out of bounds (relay_Daily_Info.ash, line 144)
false
Begin index -1 out of bounds (relay_Daily_Info.ash, line 144)
The lines:
false
Begin index ... etc.
appear to show up whenever the "Events" or "Market Prices" tabs are clicked.
icon315
12-24-2010, 01:11 AM
Fixed, re-download
i accidentally left some code there that i used to de-bug. also the error was given do to a small miscode. I also meant to remove (more like hide) the events tab, til i figure out how to make it better. You can easily add it back in by removing the /* */ around the code
AlbinoRhino
12-24-2010, 01:37 AM
Everything working beautifully now. Thanks for the script !
Darzil
01-13-2011, 11:35 AM
Just updated (think I had an old version that seemed to stop working recently), and works lovely, other than that if I put in a different date and click submit, nothing happens. Was wanting to check on future holiday dates (which clearly I can do in other ways).
Also getting Begin index -1 out of bounds (relay_Daily_Info.ash, line 144) each time it loads. This is running Mafia Build 8902.
The above submit does nothing is on Internet Explorer. On Firefox it does submit, but defaults to the Item page after submit, with the above error in the CLI, and if you transfer to another page resets the date to today.
Any ideas ?
wrldwzrd89
01-13-2011, 05:28 PM
Begin index -1 out of bounds (relay_Daily_Info.ash, line 144)
I keep getting that message. Script seems to work just fine, though.
I'm using r8902.
Theraze
01-13-2011, 05:39 PM
Line 144 is parsing the marketplace... if it's down for some reason, I'd expect that error.
However, http://kol.coldfront.net/newmarket/itemgraph.php?itemid=194×pan=1&noanim=1 does load for me, so...
AlbinoRhino
01-13-2011, 05:41 PM
I was having the same issue and I looked at the My_Items.txt file in the data folder, which is basically a numbered list of item ID's, and there was a "-1" on the first line. I deleted that line and the error stopped appearing.
Theraze
01-13-2011, 05:43 PM
Yeah, my My_Items.txt file just has Mr. Accessory and the twinkly wad... no -1 broken bit, but that would make sense as a break point.
wrldwzrd89
01-13-2011, 05:57 PM
Where does the My_Items.txt file go? The instructions don't say where to put it...
AlbinoRhino
01-13-2011, 05:58 PM
On Firefox it does submit, but defaults to the Item page after submit, with the above error in the CLI, and if you transfer to another page resets the date to today.
Having the same issue in Firefox, just without the CLI error (see above). Set the date, submit and it returns to the items page.
AlbinoRhino
01-13-2011, 05:59 PM
Where does the My_Items.txt file go? The instructions don't say where to put it...
In the data folder.
EDIT: A little more playing around shows that when I try to change the date on the calendar page, a line is added to the My_Items.txt file, with an item ID of "0" and then the script starts throwing the out of bounds error. Deleting the line with the item ID "0" fixes it until you try to change the date again.
icon315
01-13-2011, 08:24 PM
I see, it is because technically, i have 2 submit fields in one page....gotta fix it...somehow
also it seems to add an extra blank line...ugh
EDIT:I can fix it if there is a way to make the default page, the current, or last opened page
Powered by vBulletin® Version 4.2.0 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.