:- consult('plnxt.pl'). start :- nxt_open, nxt_light_LED(activate), thread_create(stroll,_,[detached(true)]). stroll :- nxt_go(200), sleep(1), trigger_create(_,swiatlo,prawo), trigger_create(_,pat,stop), stroll. prawo :- nxt_stop, nxt_rotate(160, -50), stroll. swiatlo :- nxt_light(L,force), L<50. pat :- nxt_touch(Value, force), Value=:=1. stop :- trigger_killall, nxt_stop, nxt_close.