{"id":1093,"date":"2018-10-24T20:42:59","date_gmt":"2018-10-24T20:42:59","guid":{"rendered":"https:\/\/lab.florianschwarz.net\/PennController\/?post_type=yada_wiki&#038;p=1093"},"modified":"2018-10-24T20:42:59","modified_gmt":"2018-10-24T20:42:59","slug":"function-call","status":"publish","type":"yada_wiki","link":"https:\/\/lab.florianschwarz.net\/PennController\/wiki\/function-call\/","title":{"rendered":"function.call"},"content":{"rendered":"<p class='command-format'><code>getFunction(id).call()<\/code><\/p>\n<p>Executes the function.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<p>[js try=&#8221;true&#8221; highlight=&#8221;12-13&#8243;]<br \/>\nnewFunction(&#8220;setKeyTime&#8221;, function(){ this.keyTime = Date.now(); }),<br \/>\nnewFunction(&#8220;keyTimerDelay&#8221;, function(){ return Date.now() &#8211; this.keyTime &gt; 10; }),<br \/>\nnewButton(&#8220;Start&#8221;, &#8220;Start&#8221;)<br \/>\n    .print()<br \/>\n    .wait(),<br \/>\nnewText(&#8220;instrutions&#8221;, &#8220;Quick, you have one second to press the T key!&#8221;)<br \/>\n    .print(),<br \/>\nnewTimer(&#8220;quick&#8221;, 1010)<br \/>\n    .start(),<br \/>\nnewKey(&#8220;t&#8221;, &#8220;T&#8221;)<br \/>\n    .wait(),<br \/>\ngetFunction(&#8220;setKeyTime&#8221;)<br \/>\n    .call(),<br \/>\ngetTimer(&#8220;quick&#8221;)<br \/>\n    .wait(&#8220;first&#8221;),<br \/>\ngetFunction(&#8220;keyTimerDelay&#8221;)<br \/>\n    .test.is(true)<br \/>\n    .success(<br \/>\n        newText(&#8220;success&#8221;, &#8220;Good job!&#8221;)<br \/>\n            .print()<br \/>\n    )<br \/>\n    .failure(<br \/>\n        newText(&#8220;failure&#8221;, &#8220;Too slow&#8230;&#8221;)<br \/>\n            .print()<br \/>\n    ),<br \/>\ngetButton(&#8220;Start&#8221;)<br \/>\n    .wait()<br \/>\n[\/js]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"wiki_cats":[11,13,5,4,19],"wiki_tags":[],"class_list":["post-1093","yada_wiki","type-yada_wiki","status-publish","hentry","wiki_cats-action-command","wiki_cats-command","wiki_cats-documentation","wiki_cats-element","wiki_cats-function-element"],"_links":{"self":[{"href":"https:\/\/lab.florianschwarz.net\/PennController\/wp-json\/wp\/v2\/yada_wiki\/1093","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab.florianschwarz.net\/PennController\/wp-json\/wp\/v2\/yada_wiki"}],"about":[{"href":"https:\/\/lab.florianschwarz.net\/PennController\/wp-json\/wp\/v2\/types\/yada_wiki"}],"author":[{"embeddable":true,"href":"https:\/\/lab.florianschwarz.net\/PennController\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/lab.florianschwarz.net\/PennController\/wp-json\/wp\/v2\/comments?post=1093"}],"version-history":[{"count":1,"href":"https:\/\/lab.florianschwarz.net\/PennController\/wp-json\/wp\/v2\/yada_wiki\/1093\/revisions"}],"predecessor-version":[{"id":1094,"href":"https:\/\/lab.florianschwarz.net\/PennController\/wp-json\/wp\/v2\/yada_wiki\/1093\/revisions\/1094"}],"wp:attachment":[{"href":"https:\/\/lab.florianschwarz.net\/PennController\/wp-json\/wp\/v2\/media?parent=1093"}],"wp:term":[{"taxonomy":"wiki_cats","embeddable":true,"href":"https:\/\/lab.florianschwarz.net\/PennController\/wp-json\/wp\/v2\/wiki_cats?post=1093"},{"taxonomy":"wiki_tags","embeddable":true,"href":"https:\/\/lab.florianschwarz.net\/PennController\/wp-json\/wp\/v2\/wiki_tags?post=1093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}