3 ms·
Sure! It's as simple as running the system command "osascript" and passing in the file here: https://github.com/pcottle/emotiface/blob/master/backend/keystroke
by xxbondsxx 15y ago
Sure! It's as simple as running the system command "osascript" and passing in the file here:
https://github.com/pcottle/emotiface/blob/master/backend/keystroke.app https://github.com/pcottle/emotiface/blob/master/backend/key...
As you can see, it just keeps hitting return 20 times (for 20 packets). The JS does the majority of the heavy lifting. It continually checks the chat textarea and waits for it to empty (when a keydown happens). When that happens, it loads the next packet and waits again. Code snippet:
//check if it's nothing
console.log('waiting for next return key');
var theVal = $j('.fbNubFlyoutInner').find('textarea').val();
console.log(theVal);
if(theVal)
{
//need to wait
var timeoutStr = "keydownCheck('" + filename + "'," + String(numPacket) + ");";
setTimeout(timeoutStr,keydownSleep);
return;
}
//actually put the next packet in
var packetText = JSON.stringify(files[filename].packetMap[numPacket]);
$j('.fbNubFlyoutInner').find('textarea').val(packetText);
Link:
https://github.com/pcottle/emotiface/blob/master/backend/static/thejs.js https://github.com/pcottle/emotiface/blob/master/backend/sta...
- geuis 15y agoThanks, this will help out with a hackety thing I've been wanting to do.