// ==UserScript==
// @name TBN-Macro
// @namespace https://thebot.net/
// @version 0.0.1
// @description Web Automation.
// @author Rastof
// @match http://parsleyjs.org/doc/examples/simple.html
// @grant none
// ==/UserScript==
(function() {
"use strict";var Form=function(){function n(){function n(n,c){var t=document.querySelector(n);null!==t&&(t.value=c)}function c(n,c){var t=document.querySelector(n);null!==t&&(t.checked=c)}function t(n,c){var t=document.querySelector(n);null!==t&&(t.value=c)}function u(n){var c=document.querySelector(n);null!==c&&c.click()}function o(n){var c=document.querySelector(n);null!==c&&c.submit()}function e(n,c){if("function"==typeof c)for(var t in n)n.hasOwnProperty(t)&&c(t,n[t])}function r(n,c){"function"==typeof c&&n.forEach(function(n){c(n)})}return{fill:function(c){e(c,function(c,t){n(c,t)})},check:function(n){e(n,function(n,t){c(n,t)})},select:function(n){e(n,function(n,c){t(n,c)})},click:function(n){r(n,function(n){u(n)})},submit:function(n){o(n)}}}var c;return{create:function(){return c||(c=n()),c}}}(),Click=function(){function n(){function n(n){var c=document.querySelector(n);null!==c&&c.click()}function c(n,c){"function"==typeof c&&n.forEach(function(n){c(n)})}return{click:function(t){c(t,function(c){n(c)})}}}var c;return{create:function(){return c||(c=n()),c}}}();
// Put your code below this line
// create form and click objects.
var form = Form.create();
var links = Click.create();
// fill input fields
form.fill({
'#demo-form > input:nth-child(2)': 'rastof',
'#demo-form > input:nth-child(4)': '[email protected]',
'#message': 'This is some random text to fill the text box.'
});
// select check boxes
form.check({
'#hobby6': true,
'#hobby4': true
});
// select a value from drop down menu
form.select({
'#heard': 'net'
});
// select a radio button
form.click([
'#genderF'
]);
// submit form
links.click(['#demo-form > input.btn.btn-default']);
})();