Go down
Posts : 1
Reputation : 0
Join date : 2018-03-11
Location : Frankfurt am Main, Deutschland
View user profile

Happy Birthday Bot

on Sun Mar 11, 2018 1:15 pm
Hi I am trying to write a bot to say happy Birthday on Facebook... oh yes thats so personal... Very Happy
all I get is a reloading page. What do I misunderstand?

//my settings
var userSettings = {}

//my variables
var birthdayText = 'Alles Gute zum Geburtstag!';
var startSite = 'h*ttps:/*/ww*w.fa*cebook.c*om/events/birthdays/*New members are not allowed to post external links or emails for 7 days*';

//my bot script
async function run(currentTab) {

  if (bot.getProtocol() == 'init') {

  if (bot.getProtocol() == 'main') {
    await bot.navigateUrl(startSite)

  if (bot.getProtocol() == 'check_birthdays') {
      if (bot.selectElement({querySelector: textarea.uiTextareaAutogrow, indexOffset: 'first'}) == false) {
        bot.consoleLog('FINISHED: Keine Geburtstage gefunden.')
      } else {
        bot.consoleLog('Geburtstag gefunden: Es wird gratuliert.')

  if (bot.getProtocol() == 'happy_birthday') {
      // B. selecting an element: takes a stardard js querySelectorAll argument
      await bot.selectElement({querySelector: textarea.uiTextareaAutogrow, indexOffset: 'first'})
      // C. mouseClick on selected element
      await bot.mouseClick({selectedElement: true})
      await bot.wait(500, 100)
      // D. typing a string, and then pressing the enter key
      await bot.keyboardType({string: birthdayText})
      await bot.keyboardType({special: 'enter'})
      // E. when clicking a page-changing button, it's wise to wait for the URL to load before continuing
      await bot.wait(2000, 100)
      await bot.waitForCondition({
        property: 'urlLoaded', equator: 'equals', condition: true,
        timeout: 20000

  setTimeout(function () { run() }, bot.getRunDelay());
Posts : 67
Reputation : 15
Join date : 2017-09-13
View user profile

Re: Happy Birthday Bot

on Mon Mar 12, 2018 12:35 am
Message reputation : 100% (1 vote)
Hey Tian!

I'm excited you're looking into making a custom module! You're one of the few who has expressed interest in checking it out so I apologize in advance if it's still a little buggy. I'll take a look at your module and see if I can figure out what's wrong and get back to you ASAP
Back to top
Permissions in this forum:
You cannot reply to topics in this forum