var selectNos=["EE111.04","CSKI1002.01","CS140.01"],e=[];lessonJSONs.forEach(function(o){for(idx in selectNos)if(o.no===selectNos[idx]){e.push(o.id),selectNos.splice(idx,1);break}}),0!==selectNos.length&&console.log("LSS Warning: lessons %s %s",JSON.stringify(selectNos),"not found");var o=0,t=0,n=setInterval(function(){if(0===e.length)return clearInterval(n),void console.log("LSS stoped successfully.");$.ajax({type:"POST",url:"http://eams.shanghaitech.edu.cn/eams/stdElectCourse!batchOperator.action?profileId="+electCourseTable.config.profileId,data:{optype:!0,operator0:e[t]+":true:0"},async:!1,success:function(n){var l=/请不要过快点击|Please DO NOT click too quickly/g,c=(n.match(/.*<\/br>/g)||n.match(l)||[]).map(function(e){return e.replace(/<.*?>/g,"").trim()});o++,null!==(n.match(/失败|Failure/g)||n.match(l))?(console.log("[x] Failed",o,c),t=(t+1)%e.length):(console.log("[√] Succeed",o,c),e.splice(t,1),e.length>0&&(t%=e.length))},error:function(n,l,c){o++,t=(t+1)%e.length,console.log("[x] Error",o,n.statusText,l,c)}})},1500);function stopLSS(){clearInterval(n)}