Jump to content
UBot Underground

Help with birthday logic


Recommended Posts

Let's say a bot needed to go to multiple sites and fill in birthday info as entered by user in the UI. The problem is, each site uses slightly different formats for each. For example, some site use:

1

2

3

4

 

Others use:

Jan

Feb

Mar

 

Others:

January

Febuary

March

 

Is it possible to have User enter their birthday info once (day, date, year) and have ubot be able to select the correct choices from drop down menus, without having to use if/then statements for every possible choice?

 

Thanks a lot...

Link to post
Share on other sites

 

Is it possible to have User enter their birthday info once (day, date, year) and have ubot be able to select the correct choices from drop down menus, without having to use if/then statements for every possible choice?

 

Thanks a lot...

 

If I were approaching this I'd write a sub that convert the numeric month to the full word and and another that returned the abbreviated month name. In your script you'd just have to scrape the attribute into a list and read the first one (January), then pop in if conditions based on if its January, if its Jan or else it must be numeric. In either of the two word cases call the appropriate sub to get the data to fill in into a variable and then fill the value with the contents of that variable.

 

Andy

  • Like 2
Link to post
Share on other sites

If I were approaching this I'd write a sub that convert the numeric month to the full word and and another that returned the abbreviated month name. In your script you'd just have to scrape the attribute into a list and read the first one (January), then pop in if conditions based on if its January, if its Jan or else it must be numeric. In either of the two word cases call the appropriate sub to get the data to fill in into a variable and then fill the value with the contents of that variable.

 

Andy

I believe this is the most correct approach at the moment.

  • Like 1
Link to post
Share on other sites

Thanks guys,

 

I'm not a great programmer and can't get the suggestion to work. I'm not sure how to convert the number to the word.

 

I've been trying the following logic but can't get it to work either:

 

UI = Dropdown box with 12 months listed - User selects a month

 

If (evaluate) #month = Jan

 

Then (select) (item 1) from dropdown (month)

 

But this isn't working...Any ideas?

 

http://www.dombom.com/UbotSelectMonth.jpg

Link to post
Share on other sites

Can you go just normally choose by attribute cbMonth and then select from drop down 1?

 

Yes, ubot can correctly:

"selet from dropdown"

Item: 1

Name: cbMonth

 

Here's a random sample page I'm using to try to work this out:

https://www.baskinrobbins.com/bdayclub/RegisterInfo1.aspx

 

Ubot will fill out every form on the page, except the month which I can't figure out how to let the User input the month and have Ubot select it for this site (and then other sites).

 

Again, Ubot will select the month if I specifically tell it which one to select, but can't get it to work with UI.

 

Thanks a lot...

  • Like 1
Link to post
Share on other sites

I have included an include file that I use in my bots for processing dates. Checkout the different formats. If there is a format you would lie to see let me know and I will add it to this bot.

 

Buddy

 

Hey Buddy,

 

Thanks a lot, I appreciate it. It's a little too complicated for me at this point. I got my way I posted above to work (not sure what was wrong) and I'll use that, but even though I don't understand your ubot exactly, I can see how it makes things easier than what I'm doing. Thanks again...

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...