Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005705opensim[REGION] OpenSim Corepublic2011-09-23 08:412011-09-23 08:41
ReporterQuin3y 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Versionmaster (dev code) 
Target VersionFixed in Version 
Summary0005705: Bot AutoPilot() Issue
DescriptionI tried to move the bot to a specific position using AutoPilot() function, however it seems to be problematic. The bot can move towards the right direction but never stops until it reaches the bound of the region. I adjusted the z value in moveTo() function by commenting out the line z -= 2, the bot flies to the right direction and continues flying to the bound. Actually the moveto command in TestClient.exe has the same problem. I'm using libomv 0.9.0. How to fix this bug?

If you want to test my code, just use your own bot's account to log in to your own region and set a start location startLoc, it should work. The function moveTo(100, 100, 24) means to move the bot to position (100, 100, 24).
Additional Information// Need to add the following References if using VC# 2010:
// OpenMetaverse, OpenMetaverseTypes
// These can be found in your opensim\bin folder

using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using OpenMetaverse;
using OpenMetaverse.Packets;

namespace PetBot
{
    class PetBot
    {
        public static GridClient client = new GridClient();
        public static System.Timers.Timer updateTimer;

        // login
        private static string firstName = BOT'S FIRST NAME;
        private static string lastName = BOT'S LAST NAME;
        private static string password = PASSWORD;
        private static string userAgent = "test";
        private static string version = "1.0";
        private static string URI = "http://127.0.0.1:9000/"; [^]
        public static Vector3 startLoc = new Vector3(135, 135, 24);
        private static string startRegion = YOUR REGION;


        public static void Main()
        {
            client.Settings.SEND_AGENT_UPDATES = true;

            string startLocation = NetworkManager.StartLocation(startRegion, (int)startLoc.X, (int)startLoc.Y, (int)startLoc.Z);
            LoginParams loginParams = client.Network.DefaultLoginParams(firstName, lastName, password, userAgent, version);
            loginParams.URI = URI;
            loginParams.Start = startLocation;

            client.Network.LoginProgress += new EventHandler<LoginProgressEventArgs>(Network_LoginProgress);

            if (client.Network.Login(loginParams))
            {
                Console.WriteLine("Bot Login Message: " + client.Network.LoginMessage);
                client.Self.Chat("Hello World!", 0, ChatType.Normal);
                Thread.Sleep(8000);

                moveTo(100, 100, 24);
            }
            else
            {
                Console.WriteLine("Login failed: {0}", client.Network.LoginMessage);
            }
        }

        public static void Network_LoginProgress(object sender, LoginProgressEventArgs e)
        {
            if (e.Status == LoginStatus.Success)
            {
                Console.WriteLine("Yeahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh!");
            }
        }

        public static void moveTo(double x, double y, double z)
        {
            uint regionX, regionY;
            Utils.LongToUInts(client.Network.CurrentSim.Handle, out regionX, out regionY);

            x += (double)regionX;
            y += (double)regionY;
            z -= 2;
            client.Self.Chat("Moving to", 0, ChatType.Normal);
            client.Self.AutoPilot(x, y, z);
        }
    }
}
TagsNo tags attached.
Git Revision or version number41616ca 2011-09-22 01:11:19 +0100
Run ModeStandalone (1 Region)
Physics EngineBasicPhysics
Script Engine
EnvironmentMono / Windows
Mono Versiontrunk
ViewerSecond Life 3.0.3
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2011-09-23 08:41 Quin3y New Issue
2011-09-23 08:41 Quin3y Git Revision => 41616ca 2011-09-22 01:11:19 +0100
2011-09-23 08:41 Quin3y Run Mode => Standalone (1 Region)
2011-09-23 08:41 Quin3y Physics Engine => BasicPhysics
2011-09-23 08:41 Quin3y Environment => Mono / Windows
2011-09-23 08:41 Quin3y Mono Version => trunk
2011-09-23 08:41 Quin3y Viewer => Second Life 3.0.3


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker