corrade-lsl-templates – Diff between revs 32 and 36

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 32 Rev 36
Line 389... Line 389...
389 } 389 }
390 } 390 }
Line 391... Line 391...
391   391  
392 state stop_pilot { 392 state stop_pilot {
393 state_entry() { -  
394 // DEBUG -  
395 llOwnerSay("Stopping autopilot for flight..."); -  
396 llRegionSayTo( -  
397 (key)wasKeyValueGet( -  
398 "corrade", -  
399 configuration -  
400 ), -  
401 0, -  
402 wasKeyValueEncode( 393 state_entry() {
403 [ -  
404 "command", "autopilot", -  
405 "group", wasURLEscape( -  
406 wasKeyValueGet( -  
407 "group", -  
408 configuration -  
409 ) -  
410 ), -  
411 "password", wasURLEscape( -  
412 wasKeyValueGet( -  
413 "password", -  
414 configuration -  
415 ) -  
416 ), -  
417 // move in a radius around the current primitive. -  
418 "position", llGetPos() + wasCirclePoint( -  
419 (integer)wasURLEscape( -  
420 wasKeyValueGet( -  
421 "range", -  
422 configuration -  
423 ) -  
424 ) -  
425 ), -  
426 "action", "stop", -  
427 "callback", wasURLEscape(callback) -  
428 ] -  
429 ) -  
430 ); 394 state fly;
431 llSetTimerEvent(60); 395 llSetTimerEvent(60);
432 } 396 }
433 timer() { 397 timer() {
434 state on; 398 state on;
435 } 399 }
436 touch_end(integer num) { 400 touch_end(integer num) {
437 llSetColor(<.5,0,0>, ALL_SIDES); 401 llSetColor(<.5,0,0>, ALL_SIDES);
438 llResetScript(); 402 llResetScript();
439 } -  
440 http_request(key id, string method, string body) { -  
441 llHTTPResponse(id, 200, "OK"); -  
442 if(wasKeyValueGet("command", body) != "autopilot" || -  
443 wasKeyValueGet("success", body) != "True") { -  
444 // DEBUG -  
445 llOwnerSay("Failed to stop autopilot..."); -  
446 state on; -  
447 } -  
448 state fly; -  
449 } 403 }
450 attach(key id) { 404 attach(key id) {
451 llResetScript(); 405 llResetScript();
452 } 406 }
453 on_rez(integer num) { 407 on_rez(integer num) {
Line 634... Line 588...
634 configuration 588 configuration
635 ), 589 ),
636 0, 590 0,
637 wasKeyValueEncode( 591 wasKeyValueEncode(
638 [ 592 [
639 "command", "autopilot", 593 "command", "walkto",
640 "group", wasURLEscape( 594 "group", wasURLEscape(
641 wasKeyValueGet( 595 wasKeyValueGet(
642 "group", 596 "group",
643 configuration 597 configuration
644 ) 598 )
Line 656... Line 610...
656 "range", 610 "range",
657 configuration 611 configuration
658 ) 612 )
659 ) 613 )
660 ), 614 ),
-   615 "vicinity", wasCirclePoint(
-   616 (integer)wasURLEscape(
-   617 wasKeyValueGet(
-   618 "range",
-   619 configuration
-   620 )
-   621 )
-   622 ),
661 "action", "start", 623 "duration", "2500",
662 "callback", wasURLEscape(callback) 624 "callback", wasURLEscape(callback)
663 ] 625 ]
664 ) 626 )
665 ); 627 );
666 llSetTimerEvent(60); 628 llSetTimerEvent(60);
Line 672... Line 634...
672 llSetColor(<.5,0,0>, ALL_SIDES); 634 llSetColor(<.5,0,0>, ALL_SIDES);
673 llResetScript(); 635 llResetScript();
674 } 636 }
675 http_request(key id, string method, string body) { 637 http_request(key id, string method, string body) {
676 llHTTPResponse(id, 200, "OK"); 638 llHTTPResponse(id, 200, "OK");
677 if(wasKeyValueGet("command", body) != "autopilot" || 639 if(wasKeyValueGet("command", body) != "walkto" ||
678 wasKeyValueGet("success", body) != "True") { 640 wasKeyValueGet("success", body) != "True") {
679 // DEBUG 641 // DEBUG
680 llOwnerSay("Failed to start autopilot..."); 642 llOwnerSay("Failed to start walkto...");
681 state on; 643 state on;
682 } 644 }
683 state select; 645 state select;
684 } 646 }
685 attach(key id) { 647 attach(key id) {