// ==UserScript==
// @name        NewJob1$
// @namespace   AutoMessage
// @include     https://acs.projectdublin.com/conversation.html?conversation_id=*
// @require     http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @grant       GM_xmlhttpRequest
// @connect     harinionlinejobs.in
// ==/UserScript==

// https://uinames.com/api/?region=United%20States

var FullName = '';
var Address = '';
var Phone = '';
var PhoneNumber ='';
var Email ='';
var EmailAddress='';
var PolicyClaim='';

var WelcomeMsg='';
var Name='';
var MakeModel='';
var Year='';

if(document.getElementById('conversation-input-text'))
{
  GM_xmlhttpRequest ( {
    method: 'GET',
    url: 'https://icebob.stdlib.com/fake/',
    onload: function (responseDetails) {
    //alert(responseDetails.responseText);

    $data=JSON.parse(responseDetails.responseText);

    FullName = $data.result.lastName+" "+$data.result.firstName;
    PhoneNumber = $data.result.phone;
    EmailAddress = $data.result.email;
     }
} );

//alert(getRandomNum9(9));
//alert(randomString3(3));
//alert(Math.floor((Math.random()*5)+1));
callgm();




}

function callgm() {

setTimeout(function(){ callgm(); }, 3000);

// welcom Message //
if ( document.getElementById("message-container").lastElementChild.innerText.indexOf(' you today') !=-1) {
if (WelcomeMsg=='') { 
		if ( document.getElementById('user-instructions').innerHTML.indexOf('fixing the screen') !=-1 ) { 
			WelcomeMsg ='1';
			document.getElementById('conversation-input-text').value = 'Hi, Good Morning. This is '+ FullName + '. My iPhone screen was just cracked.';
			}
		if ( document.getElementById('user-instructions').innerHTML.indexOf('insurance for one of your') !=-1 ) { 
			WelcomeMsg ='1';
			document.getElementById('conversation-input-text').value = 'Hi, Good Morning. This is '+ FullName + '. I need a insurance copy of my car.';
			}
		if ( document.getElementById('user-instructions').innerHTML.indexOf('status of your claim') !=-1 ) { 
			WelcomeMsg ='1';
			document.getElementById('conversation-input-text').value = 'Hi, Good Morning. This is '+ FullName + '. I wants to know about my claim.';
			}
}
}

// ***************************** //
if ( document.getElementById("message-container").lastElementChild.innerText.indexOf('phone ') !=-1) {
if (phone=='') { 
	phone='1';
			document.getElementById('conversation-input-text').value = PhoneNumber;
}
}
// ***************************** //
if ( document.getElementById("message-container").lastElementChild.innerText.indexOf('email address') !=-1) {
if (Email=='') { 
	Email='1';
			document.getElementById('conversation-input-text').value = EmailAddress;
}
}
// ***************************** //
if ( document.getElementById("message-container").lastElementChild.innerText.indexOf('policy') !=-1 || document.getElementById("message-container").lastElementChild.innerText.indexOf('claim') !=-1) {
if (PolicyClaim=='') { 
	PolicyClaim='1';

			document.getElementById('conversation-input-text').value = 'Policy Number : '+randomString3(3)+getRandomNum9(9) ' & ' + 'Claim Number : '+randomString3(3)+getRandomNum9(3);
}
}


// ***************************** //
if ( document.getElementById("message-container").lastElementChild.innerText.indexOf('make') !=-1 && document.getElementById("message-container").lastElementChild.innerText.indexOf('model') !=-1) {
if (MakeModel=='') { 
	MakeModel='1';

var OrdList1 = new Array("Make : Maruti Suzuki, Model :  Swift, Year Manufactured : 2014",
"Make : Tata, Model : Tiago, Year Manufactured : 2015",
"Make : Mahindra, Model : Bolero, Year Manufactured : 2015",
"Make : Renault, Model : Kwid, Year Manufactured : 2016",
"Make : Hyundai, Model : i20, Year Manufactured : 2014",
"Make : Mahindra, Model : Scorpio, Year Manufactured : 2010",
"Make : Toyota, Model : Fortuner, Year Manufactured : 2011",
"Make : Maruti Suzuki, Model :  Swift, Year Manufactured : 2014",
"Make : Tata, Model : Tiago, Year Manufactured : 2015",
"Make : Mahindra, Model : Bolero, Year Manufactured : 2015",
"Make : Renault, Model : Kwid, Year Manufactured : 2016",
"Make : Hyundai, Model : i20, Year Manufactured : 2014",
"Make : Mahindra, Model : Scorpio, Year Manufactured : 2010",
"Make : Toyota, Model : Fortuner, Year Manufactured : 2011",
"Make : Maruti Suzuki, Model : Baleno, Year Manufactured : 2015",
"Make : Hyundai, Model : Creta, Year Manufactured : 2015",
"Make : Tata, Model : Nexon, Year Manufactured : 2011",
"Make : Ford, Model : Freestyle, Year Manufactured : 2010",
"Make : Honda, Model : Amaze, Year Manufactured : 2011",
"Make : Volvo, Model : XC40, Year Manufactured : 2015",
"Make : Hyundai, Model : Grand i10, Year Manufactured : 2014",
"Make : Mahindra, Model : TUV300 Plus, Year Manufactured : 2010",
"Make : Renault, Model : Duster, Year Manufactured : 2015",
"Make : Ford, Model : EcoSport, Year Manufactured : 2010",
"Make : Volkswagen, Model : Polo, Year Manufactured : 2012",
"Make : Ford, Model : Endeavour, Year Manufactured : 2010",
"Make : Audi, Model : R8, Year Manufactured : 2016",
"Make : Maruti Suzuki, Model : Baleno, Year Manufactured : 2015");

var Order1 = OrdList1[Math.floor( Math.random() * OrdList1.length )];
			document.getElementById('conversation-input-text').value = Order1;
}
}




}

function getRandomNum9(length) {
    var randomNum = 
        (Math.pow(10,length).toString().slice(length-1) + 
        Math.floor((Math.random()*Math.pow(10,length))+1).toString()).slice(-length);
    return randomNum;
}

function randomString3(length) {
  if (length < 3) length = 3;
  if (length > 8) length = 8;
  var text = '';
  var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  for (var i = 0; i < length; i++) {
    text += possible[Math.floor(Math.random() * possible.length)];
  }
  return text;
}
// ==UserScript==
// @name        NewJob1$
// @namespace   AutoMessage
// @include     https://acs.projectdublin.com/conversation.html?conversation_id=*
// @require     http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @grant       GM_xmlhttpRequest
// @connect     harinionlinejobs.in
// ==/UserScript==

// https://uinames.com/api/?region=United%20States

var FullName = '';
var Address = '';
var Phone = '';
var PhoneNumber ='';
var Email ='';
var EmailAddress='';
var PolicyClaim='';

var WelcomeMsg='';
var Name='';
var MakeModel='';
var Year='';

if(document.getElementById('conversation-input-text'))
{
  GM_xmlhttpRequest ( {
    method: 'GET',
    url: 'https://icebob.stdlib.com/fake/',
    onload: function (responseDetails) {
    //alert(responseDetails.responseText);

    $data=JSON.parse(responseDetails.responseText);

    FullName = $data.result.lastName+" "+$data.result.firstName;
    PhoneNumber = $data.result.phone;
    EmailAddress = $data.result.email;
     }
} );

//alert(getRandomNum9(9));
//alert(randomString3(3));
//alert(Math.floor((Math.random()*5)+1));
callgm();




}

function callgm() {

setTimeout(function(){ callgm(); }, 3000);

// welcom Message //
if ( document.getElementById("message-container").lastElementChild.innerText.indexOf(' you today') !=-1) {
if (WelcomeMsg=='') { 
		if ( document.getElementById('user-instructions').innerHTML.indexOf('fixing the screen') !=-1 ) { 
			WelcomeMsg ='1';
			document.getElementById('conversation-input-text').value = 'Hi, Good Morning. This is '+ FullName + '. My iPhone screen was just cracked.';
			}
		if ( document.getElementById('user-instructions').innerHTML.indexOf('insurance for one of your') !=-1 ) { 
			WelcomeMsg ='1';
			document.getElementById('conversation-input-text').value = 'Hi, Good Morning. This is '+ FullName + '. I need a insurance copy of my car.';
			}
		if ( document.getElementById('user-instructions').innerHTML.indexOf('status of your claim') !=-1 ) { 
			WelcomeMsg ='1';
			document.getElementById('conversation-input-text').value = 'Hi, Good Morning. This is '+ FullName + '. I wants to know about my claim.';
			}
}
}

// ***************************** //
if ( document.getElementById("message-container").lastElementChild.innerText.indexOf('phone ') !=-1) {
if (phone=='') { 
	phone='1';
			document.getElementById('conversation-input-text').value = PhoneNumber;
}
}
// ***************************** //
if ( document.getElementById("message-container").lastElementChild.innerText.indexOf('email address') !=-1) {
if (Email=='') { 
	Email='1';
			document.getElementById('conversation-input-text').value = EmailAddress;
}
}
// ***************************** //
if ( document.getElementById("message-container").lastElementChild.innerText.indexOf('policy') !=-1 || document.getElementById("message-container").lastElementChild.innerText.indexOf('claim') !=-1) {
if (PolicyClaim=='') { 
	PolicyClaim='1';

			document.getElementById('conversation-input-text').value = 'Policy Number : '+randomString3(3)+getRandomNum9(9) ' & ' + 'Claim Number : '+randomString3(3)+getRandomNum9(3);
}
}


// ***************************** //
if ( document.getElementById("message-container").lastElementChild.innerText.indexOf('make') !=-1 && document.getElementById("message-container").lastElementChild.innerText.indexOf('model') !=-1) {
if (MakeModel=='') { 
	MakeModel='1';

var OrdList1 = new Array("Make : Maruti Suzuki, Model :  Swift, Year Manufactured : 2014",
"Make : Tata, Model : Tiago, Year Manufactured : 2015",
"Make : Mahindra, Model : Bolero, Year Manufactured : 2015",
"Make : Renault, Model : Kwid, Year Manufactured : 2016",
"Make : Hyundai, Model : i20, Year Manufactured : 2014",
"Make : Mahindra, Model : Scorpio, Year Manufactured : 2010",
"Make : Toyota, Model : Fortuner, Year Manufactured : 2011",
"Make : Maruti Suzuki, Model :  Swift, Year Manufactured : 2014",
"Make : Tata, Model : Tiago, Year Manufactured : 2015",
"Make : Mahindra, Model : Bolero, Year Manufactured : 2015",
"Make : Renault, Model : Kwid, Year Manufactured : 2016",
"Make : Hyundai, Model : i20, Year Manufactured : 2014",
"Make : Mahindra, Model : Scorpio, Year Manufactured : 2010",
"Make : Toyota, Model : Fortuner, Year Manufactured : 2011",
"Make : Maruti Suzuki, Model : Baleno, Year Manufactured : 2015",
"Make : Hyundai, Model : Creta, Year Manufactured : 2015",
"Make : Tata, Model : Nexon, Year Manufactured : 2011",
"Make : Ford, Model : Freestyle, Year Manufactured : 2010",
"Make : Honda, Model : Amaze, Year Manufactured : 2011",
"Make : Volvo, Model : XC40, Year Manufactured : 2015",
"Make : Hyundai, Model : Grand i10, Year Manufactured : 2014",
"Make : Mahindra, Model : TUV300 Plus, Year Manufactured : 2010",
"Make : Renault, Model : Duster, Year Manufactured : 2015",
"Make : Ford, Model : EcoSport, Year Manufactured : 2010",
"Make : Volkswagen, Model : Polo, Year Manufactured : 2012",
"Make : Ford, Model : Endeavour, Year Manufactured : 2010",
"Make : Audi, Model : R8, Year Manufactured : 2016",
"Make : Maruti Suzuki, Model : Baleno, Year Manufactured : 2015");

var Order1 = OrdList1[Math.floor( Math.random() * OrdList1.length )];
			document.getElementById('conversation-input-text').value = Order1;
}
}




}

function getRandomNum9(length) {
    var randomNum = 
        (Math.pow(10,length).toString().slice(length-1) + 
        Math.floor((Math.random()*Math.pow(10,length))+1).toString()).slice(-length);
    return randomNum;
}

function randomString3(length) {
  if (length < 3) length = 3;
  if (length > 8) length = 8;
  var text = '';
  var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  for (var i = 0; i < length; i++) {
    text += possible[Math.floor(Math.random() * possible.length)];
  }
  return text;
}
I NEED A COPY OF INSURANCE FOR MY CAR 




