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);
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
Link:https://github.com/pcottle/emotiface/blob/master/backend/sta...