addamroy 36 Posted January 9, 2011 Report Share Posted January 9, 2011 Anybody know how I can incorporate the usage of the current time and date within a ubot script in this format: Wednesday, November 17, 2010 11:00 AM Ubot has a system feature for 'date' but it doesn't incorporate time, and the date format the way I need it to be. I couldn't even find a website to scrape this data from, although I'd hate to have to navigate to a site and scrape data just to implement a time and date stamp as shown. Anyway to do this with javascript or something else? The time and date should be current no matter when the bot is run. However I don't mind having the time and date being limited to one time zone, like EST for example. No need to incorporate all time zones, just some way to utilize a date and time stamp as ubot runs, to be utilized as a variable or whatever. Quote Link to post Share on other sites
UBotBuddy 331 Posted January 9, 2011 Report Share Posted January 9, 2011 Have you tried using the Shell command? I would execute the date command and redirect the output to a text file date > datetime.txttime >> datetime.txt Then I would Read it in. The $date node gives it all to you. I would avoid placing that in a ui stat monitor as it will cause you problems. You can use Javascript or you can use the Text commands and strip out what you need as an alternative path. Quote Link to post Share on other sites
addamroy 36 Posted January 9, 2011 Author Report Share Posted January 9, 2011 Can you go into a bit more detail as to how to do that? I understand the concept you're saying, but I don't know how to do it, no idea at all really. And you said the $date node gives everything, it doesn't. It gives me 1/24/10 16:35:30 format. I need the format to be exactly as I showed above. Except the year part can be two or four characters. Quote Link to post Share on other sites
Guerrilla 19 Posted January 10, 2011 Report Share Posted January 10, 2011 Or you could use a $eval and use javascript - http://www.quackit.com/javascript/javascript_date_and_time_functions.cfm Quote Link to post Share on other sites
addamroy 36 Posted January 10, 2011 Author Report Share Posted January 10, 2011 How do I make Ubot utilize return values generated by the javascript? From my understanding, javascript returns numerical values, example 1-7 for day of the week. So how do I tell ubot for example, that if the javascript returns value 1, to set variable to 'sunday'. ? Quote Link to post Share on other sites
JohnB 255 Posted January 10, 2011 Report Share Posted January 10, 2011 http://www.timeanddate.com/worldclock/city.html?n=198 Quote Link to post Share on other sites
UBotBuddy 331 Posted January 10, 2011 Report Share Posted January 10, 2011 Study this bot I threw together. The txt file you will need to change the filename to datetime.cmd for it to work. Make sure the cmd file is in the same folder where you save the bot.date-n-time.ubotdatetime-change-to-cmd-file.txt Quote Link to post Share on other sites
addamroy 36 Posted January 10, 2011 Author Report Share Posted January 10, 2011 Study this bot I threw together. The txt file you will need to change the filename to datetime.cmd for it to work. Make sure the cmd file is in the same folder where you save the bot. Thanks for that, helped a bit. Especially the subtext command, I didn't know about that, easily using only pieces of the $date results. What about the day of the week part? For the most part, I could probably pull apart what I need from the existing $date command, except for the day of the week. PS - Only the first script works in the example bot. I changed the filename as you said and put it in the same folder as the bot and I'm getting an error in the third node 'add to list' in the 2nd and 3rd scripts. Quote Link to post Share on other sites
addamroy 36 Posted January 10, 2011 Author Report Share Posted January 10, 2011 Study this bot I threw together. The txt file you will need to change the filename to datetime.cmd for it to work. Make sure the cmd file is in the same folder where you save the bot. Anyway you could try and whip up an example bot that can produce the time and date in this format, Wednesday, November 17, 2010 11:00 AM? Quote Link to post Share on other sites
UBotBuddy 331 Posted January 10, 2011 Report Share Posted January 10, 2011 I would if I had time. I gave you enough info why don't you get it a try? Quote Link to post Share on other sites
UBotBuddy 331 Posted January 10, 2011 Report Share Posted January 10, 2011 As to the error you are getting. I just got back to my office and my computer just booted up. The script is still running correctly so I am not sure what the problem is on your end. Quote Link to post Share on other sites
addamroy 36 Posted January 11, 2011 Author Report Share Posted January 11, 2011 As to the error you are getting. I just got back to my office and my computer just booted up. The script is still running correctly so I am not sure what the problem is on your end. I can't figure out why I can't run those 2 scripts. What do the 2nd and 3rd scripts accomplish exactly? Maybe that's where the info is that I need. I can't figure out anyway to automatically display the day of week, or pm-am style time. 1:30pm etc. Quote Link to post Share on other sites
addamroy 36 Posted January 11, 2011 Author Report Share Posted January 11, 2011 I'll paypal somebody $20 bucks if they can make me a short ubot script that can generate a time and date in the format I need it in! Seriously this is driving me crazy. Such a simple thing but I'm completely stumped. Quote Link to post Share on other sites
addamroy 36 Posted January 11, 2011 Author Report Share Posted January 11, 2011 I'll paypal somebody $20 bucks if they can make me a short ubot script that can generate a time and date in the format I need it in! Seriously this is driving me crazy. EDIT - offer taken. Quote Link to post Share on other sites
daddydanimal 2 Posted January 11, 2011 Report Share Posted January 11, 2011 i know its probably not the best solution but you can scrape it from http://www.todaysdate.com/orhttp://www.time.gov/http://www.time.gov/timezone.cgi?Eastern/d/-5/java i hope this helps i don't know java that well but you might be able to borrow some of the java code onhttp://www.todaysdate.com/ Quote Link to post Share on other sites
Guerrilla 19 Posted January 11, 2011 Report Share Posted January 11, 2011 OK, beer money appreciated. I will create bot that makes date in that format using javascript. Quote Link to post Share on other sites
Guerrilla 19 Posted January 11, 2011 Report Share Posted January 11, 2011 Bot sent via PM Quote Link to post Share on other sites
Guerrilla 19 Posted January 11, 2011 Report Share Posted January 11, 2011 OP welched so posting publicly.date and time.ubot Quote Link to post Share on other sites
addamroy 36 Posted January 11, 2011 Author Report Share Posted January 11, 2011 OP welched so posting publicly. What do you mean by welched exactly? If you're talking about the fact that someone is already doing this for me, then you must be joking. Thanks though I appreciate the sample. Quote Link to post Share on other sites
Guerrilla 19 Posted January 11, 2011 Report Share Posted January 11, 2011 Welched as in not paying for the work. If you were paying I wouldnt have posted publicly. Your attitude sucks to be honest. Just take the bot and be happy. Your welcome by the way. Quote Link to post Share on other sites
Guerrilla 19 Posted January 11, 2011 Report Share Posted January 11, 2011 Hmm.. edited your post to add in a "thank you" after. No worries, good luck with your bot Quote Link to post Share on other sites
addamroy 36 Posted January 11, 2011 Author Report Share Posted January 11, 2011 Welched as in not paying for the work. If you were paying I wouldnt have posted publicly. Your attitude sucks to be honest. Just take the bot and be happy. Your welcome by the way. I said thank you above in case you didn't see that. And FYI BotBuddy sent me a PM and said he would do it for $20 before you did. Therefore, the HONEST guy that I am, I'm going to pay him $20 for it. Make sense? It would make sense to say "hey, is anybody doing this for you yet? If not, I'd like to make this for you." But instead you just whip it up, send me your paypal ID, and post here like a jerk, say i 'welched' that my attitude sucks and all that. You're nuts. Thanks for the bot though. Quote Link to post Share on other sites
Guerrilla 19 Posted January 11, 2011 Report Share Posted January 11, 2011 Your post didnt have "thank you" in it when i made that post. You added it after. You should have posted that someone was doing the work in the thread. Anyway, I am not bothered about the cash, I help people here a lot for free. The manner in which you replied to me was what I didn't like. Anyway, best of luck to you. Quote Link to post Share on other sites
addamroy 36 Posted January 11, 2011 Author Report Share Posted January 11, 2011 Your post didnt have "thank you" in it when i made that post. You added it after. You should have posted that someone was doing the work in the thread. Anyway, I am not bothered about the cash, I help people here a lot for free. The manner in which you replied to me was what I didn't like. Anyway, best of luck to you. Whatever man. Thanks. Quote Link to post Share on other sites
daddydanimal 2 Posted January 13, 2011 Report Share Posted January 13, 2011 you two are funny chop it up as a misunderstanding as that is what is seems to be no need to let it get to you @Guerrilla thanks for the example bot I'm sure it will be useful to a lot of people i downloaded it and added it to my collection just in case i ever need it @addamroy I'm glade to see you are a honest person and stick with the deals you makemost of the time you can find the info you need on the forum if not usely someone will share it for free eventually but $20.00 is pretty cheep for if you need the info right away and to my understand BotBuddy is good so $20.00 to a good uboter is cheep P.S. not trying to offend anyone so please don't take it that way Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.