2021-03-07 21:02:38 +01:00
|
|
|
console.log('SCRIPT LAUNCHED');
|
|
|
|
WA.sendChatMessage('Hi, my name is Poly and I repeat what you say!', 'Poly Parrot');
|
|
|
|
|
|
|
|
|
|
|
|
WA.onChatMessage((message => {
|
|
|
|
console.log('CHAT MESSAGE RECEIVED BY SCRIPT');
|
|
|
|
WA.sendChatMessage('Poly Parrot says: "'+message+'"', 'Poly Parrot');
|
|
|
|
}));
|
2021-03-08 18:57:59 +01:00
|
|
|
|
|
|
|
WA.onEnterZone('myTrigger', () => {
|
|
|
|
WA.sendChatMessage("Don't step on my carpet!", 'Poly Parrot');
|
|
|
|
})
|
|
|
|
|
|
|
|
WA.onLeaveZone('myTrigger', () => {
|
|
|
|
WA.sendChatMessage("Thanks!", 'Poly Parrot');
|
|
|
|
})
|
|
|
|
|
|
|
|
WA.onEnterZone('notExist', () => {
|
|
|
|
WA.sendChatMessage("YOU SHOULD NEVER SEE THIS", 'Poly Parrot');
|
|
|
|
})
|
2021-03-09 16:21:14 +01:00
|
|
|
|
|
|
|
WA.onEnterZone('popupZone', () => {
|
2021-03-09 18:51:30 +01:00
|
|
|
WA.openPopup('foobar', 'This is a test message. Hi!', [
|
2021-03-09 16:21:14 +01:00
|
|
|
{
|
|
|
|
label: "Close",
|
|
|
|
className: "normal",
|
|
|
|
closeOnClick: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: "Next",
|
|
|
|
className: "success",
|
2021-03-09 18:51:30 +01:00
|
|
|
callback: (popup) => {
|
|
|
|
popup.close();
|
2021-03-09 16:21:14 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
])
|
|
|
|
})
|
|
|
|
|
|
|
|
/*WA.onLeaveZone('popupZone', () => {
|
|
|
|
WA.sendChatMessage("Thanks!", 'Poly Parrot');
|
|
|
|
})*/
|