Share
View previous topicGo downView next topic
avatar
Posts : 4
Reputation : 1
Join date : 2017-12-22
View user profile

New example module

on Thu Jan 04, 2018 2:22 am
Yo after reading the docs I think i have some improvements to the example on the getting started page (https://dev.somiibo.com/docs/getting-started/).

i think mine follows the rest of the docs better

Let me know what you think

Code:

//my settings
var userSettings =
{
  "textbox1": {
    "input": {"type": "text", "default": "https://google.com", "title": "Enter a website", "placeholder": "include the http"}
  }
}

//my variables
var myFirstVariable = 42;
var userWebsite;

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

  if (bot.getProtocol() == 'init') {
    userWebsite = bot.getSetting('bot', 'bot_custom_main_textbox1')
    bot.setProtocol('main')
  }

  if (bot.getProtocol() == 'main') {
    await bot.navigateUrl(userWebsite)
    if (bot.getProperty('urlLoaded') == true) {
      bot.alertBox({title: 'Made it!', text: 'Successfully navigated to '+userWebsite, type: 'success', confirmButtonText: 'Ok'})
    } else {
      bot.alertBox({title: 'Oops!', text: 'We never got to '+userWebsite, type: 'warning', confirmButtonText: 'Ok'})
    }
    bot.end();
  }

  setTimeout(function () { run() }, bot.getRunDelay());
}
avatar
Admin
Posts : 21
Reputation : 7
Join date : 2017-09-13
View user profilehttps://somiibo.com

Re: New example module

on Thu Jan 04, 2018 7:07 pm
Dude this is excellent, thank you for taking the time to help us with the Docs.

I sent you a PM about getting Somiibo Premium for free, let me know if you want this as a thank you from the entire Somiibo team
View previous topicBack to topView next topic
Permissions in this forum:
You cannot reply to topics in this forum