Jump to content
UBot Underground

Get bot to pause after certain date?


Recommended Posts

I thought I could use the date constant and just set a variable that if today's date is greater than whatever date I could command the bot to pause...but it's not working.

 

Is this even possible? and if so what am I doing wrong? (attaching bot)

date.ubot

Link to post
Share on other sites

I thought I could use the date constant and just set a variable that if today's date is greater than whatever date I could command the bot to pause...but it's not working.

 

Is this even possible? and if so what am I doing wrong? (attaching bot)

The problem with what you're trying to is that ubot currently treats the date as a string object, so when you're comparing the dates, you're just comparing strings. You could use this to compare equality, but you won't be able to see if its less or greater than.

 

Luckily, javascript's Date() object supports comparison ;)

 

Here's a snippet that should work:

post-7-12614158409345_thumb.png

Link to post
Share on other sites

The problem with what you're trying to is that ubot currently treats the date as a string object, so when you're comparing the dates, you're just comparing strings. You could use this to compare equality, but you won't be able to see if its less or greater than.

 

Luckily, javascript's Date() object supports comparison ;)

 

Here's a snippet that should work:

post-7-12614158409345_thumb.png

 

 

Wow. I would have never come up with that. Thanks, I'll give that a try.

 

edit: worked perfectly, of course! Thanks again Jim.

Link to post
Share on other sites
  • 1 year later...

Hey,

 

I have date in format "DD.MM.YYYY" and I cant find the easy way to do this job. Can you please give me a tip? I also have problem inserting variable instead of "12/20/2009". I need to check if scraped date already past or not...

 

Thanks for helping.

Link to post
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.

Loading...
×
×
  • Create New...