diff options
Diffstat (limited to '')
6 files changed, 82 insertions, 3 deletions
diff --git a/OpenSim/Tools/pCampBot/Behaviours/AbstractBehaviour.cs b/OpenSim/Tools/pCampBot/Behaviours/AbstractBehaviour.cs index 9a9371d..9bc8512 100644 --- a/OpenSim/Tools/pCampBot/Behaviours/AbstractBehaviour.cs +++ b/OpenSim/Tools/pCampBot/Behaviours/AbstractBehaviour.cs | |||
@@ -35,6 +35,11 @@ namespace pCampBot | |||
35 | { | 35 | { |
36 | public class AbstractBehaviour : IBehaviour | 36 | public class AbstractBehaviour : IBehaviour |
37 | { | 37 | { |
38 | /// <summary> | ||
39 | /// Abbreviated name of this behaviour. | ||
40 | /// </summary> | ||
41 | public string AbbreviatedName { get; protected set; } | ||
42 | |||
38 | public string Name { get; protected set; } | 43 | public string Name { get; protected set; } |
39 | 44 | ||
40 | public Bot Bot { get; protected set; } | 45 | public Bot Bot { get; protected set; } |
@@ -45,5 +50,7 @@ namespace pCampBot | |||
45 | { | 50 | { |
46 | Bot = bot; | 51 | Bot = bot; |
47 | } | 52 | } |
53 | |||
54 | public virtual void Close() {} | ||
48 | } | 55 | } |
49 | } | 56 | } |
diff --git a/OpenSim/Tools/pCampBot/Behaviours/CrossBehaviour.cs b/OpenSim/Tools/pCampBot/Behaviours/CrossBehaviour.cs index 1e01c64..4d806fc 100644 --- a/OpenSim/Tools/pCampBot/Behaviours/CrossBehaviour.cs +++ b/OpenSim/Tools/pCampBot/Behaviours/CrossBehaviour.cs | |||
@@ -47,7 +47,11 @@ namespace pCampBot | |||
47 | 47 | ||
48 | public const int m_regionCrossingTimeout = 1000 * 60; | 48 | public const int m_regionCrossingTimeout = 1000 * 60; |
49 | 49 | ||
50 | public CrossBehaviour() { Name = "Cross"; } | 50 | public CrossBehaviour() |
51 | { | ||
52 | AbbreviatedName = "c"; | ||
53 | Name = "Cross"; | ||
54 | } | ||
51 | 55 | ||
52 | public override void Action() | 56 | public override void Action() |
53 | { | 57 | { |
diff --git a/OpenSim/Tools/pCampBot/Behaviours/GrabbingBehaviour.cs b/OpenSim/Tools/pCampBot/Behaviours/GrabbingBehaviour.cs index 66a336a..59f6244 100644 --- a/OpenSim/Tools/pCampBot/Behaviours/GrabbingBehaviour.cs +++ b/OpenSim/Tools/pCampBot/Behaviours/GrabbingBehaviour.cs | |||
@@ -29,6 +29,7 @@ using OpenMetaverse; | |||
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Linq; | 31 | using System.Linq; |
32 | using System.Threading; | ||
32 | using pCampBot.Interfaces; | 33 | using pCampBot.Interfaces; |
33 | 34 | ||
34 | namespace pCampBot | 35 | namespace pCampBot |
@@ -41,7 +42,11 @@ namespace pCampBot | |||
41 | /// </remarks> | 42 | /// </remarks> |
42 | public class GrabbingBehaviour : AbstractBehaviour | 43 | public class GrabbingBehaviour : AbstractBehaviour |
43 | { | 44 | { |
44 | public GrabbingBehaviour() { Name = "Grabbing"; } | 45 | public GrabbingBehaviour() |
46 | { | ||
47 | AbbreviatedName = "g"; | ||
48 | Name = "Grabbing"; | ||
49 | } | ||
45 | 50 | ||
46 | public override void Action() | 51 | public override void Action() |
47 | { | 52 | { |
@@ -56,6 +61,8 @@ namespace pCampBot | |||
56 | Bot.Client.Self.Grab(prim.LocalID); | 61 | Bot.Client.Self.Grab(prim.LocalID); |
57 | Bot.Client.Self.GrabUpdate(prim.ID, Vector3.Zero); | 62 | Bot.Client.Self.GrabUpdate(prim.ID, Vector3.Zero); |
58 | Bot.Client.Self.DeGrab(prim.LocalID); | 63 | Bot.Client.Self.DeGrab(prim.LocalID); |
64 | |||
65 | Thread.Sleep(1000); | ||
59 | } | 66 | } |
60 | } | 67 | } |
61 | } \ No newline at end of file | 68 | } \ No newline at end of file |
diff --git a/OpenSim/Tools/pCampBot/Behaviours/NoneBehaviour.cs b/OpenSim/Tools/pCampBot/Behaviours/NoneBehaviour.cs new file mode 100644 index 0000000..9a3075c --- /dev/null +++ b/OpenSim/Tools/pCampBot/Behaviours/NoneBehaviour.cs | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using OpenMetaverse; | ||
29 | using System; | ||
30 | using System.Collections.Generic; | ||
31 | using System.Linq; | ||
32 | using pCampBot.Interfaces; | ||
33 | |||
34 | namespace pCampBot | ||
35 | { | ||
36 | /// <summary> | ||
37 | /// Do nothing | ||
38 | /// </summary> | ||
39 | public class NoneBehaviour : AbstractBehaviour | ||
40 | { | ||
41 | public NoneBehaviour() | ||
42 | { | ||
43 | AbbreviatedName = "n"; | ||
44 | Name = "None"; | ||
45 | } | ||
46 | } | ||
47 | } \ No newline at end of file | ||
diff --git a/OpenSim/Tools/pCampBot/Behaviours/PhysicsBehaviour.cs b/OpenSim/Tools/pCampBot/Behaviours/PhysicsBehaviour.cs index daa7485..6fd2b7c 100644 --- a/OpenSim/Tools/pCampBot/Behaviours/PhysicsBehaviour.cs +++ b/OpenSim/Tools/pCampBot/Behaviours/PhysicsBehaviour.cs | |||
@@ -46,6 +46,7 @@ namespace pCampBot | |||
46 | 46 | ||
47 | public PhysicsBehaviour() | 47 | public PhysicsBehaviour() |
48 | { | 48 | { |
49 | AbbreviatedName = "p"; | ||
49 | Name = "Physics"; | 50 | Name = "Physics"; |
50 | talkarray = readexcuses(); | 51 | talkarray = readexcuses(); |
51 | } | 52 | } |
@@ -77,6 +78,12 @@ namespace pCampBot | |||
77 | Bot.Client.Self.Chat(randomf, 0, ChatType.Normal); | 78 | Bot.Client.Self.Chat(randomf, 0, ChatType.Normal); |
78 | } | 79 | } |
79 | 80 | ||
81 | public override void Close() | ||
82 | { | ||
83 | if (Bot.ConnectionState == ConnectionState.Connected) | ||
84 | Bot.Client.Self.Jump(false); | ||
85 | } | ||
86 | |||
80 | private string[] readexcuses() | 87 | private string[] readexcuses() |
81 | { | 88 | { |
82 | string allexcuses = ""; | 89 | string allexcuses = ""; |
diff --git a/OpenSim/Tools/pCampBot/Behaviours/TeleportBehaviour.cs b/OpenSim/Tools/pCampBot/Behaviours/TeleportBehaviour.cs index fbb4e96..81f250d 100644 --- a/OpenSim/Tools/pCampBot/Behaviours/TeleportBehaviour.cs +++ b/OpenSim/Tools/pCampBot/Behaviours/TeleportBehaviour.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Linq; | 30 | using System.Linq; |
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using System.Threading; | ||
32 | using log4net; | 33 | using log4net; |
33 | using OpenMetaverse; | 34 | using OpenMetaverse; |
34 | using pCampBot.Interfaces; | 35 | using pCampBot.Interfaces; |
@@ -42,7 +43,11 @@ namespace pCampBot | |||
42 | { | 43 | { |
43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
44 | 45 | ||
45 | public TeleportBehaviour() { Name = "Teleport"; } | 46 | public TeleportBehaviour() |
47 | { | ||
48 | AbbreviatedName = "t"; | ||
49 | Name = "Teleport"; | ||
50 | } | ||
46 | 51 | ||
47 | public override void Action() | 52 | public override void Action() |
48 | { | 53 | { |
@@ -70,6 +75,8 @@ namespace pCampBot | |||
70 | Bot.Name, sourceRegion.Name, Bot.Client.Self.SimPosition, destRegion.Name, destPosition); | 75 | Bot.Name, sourceRegion.Name, Bot.Client.Self.SimPosition, destRegion.Name, destPosition); |
71 | 76 | ||
72 | Bot.Client.Self.Teleport(destRegion.RegionHandle, destPosition); | 77 | Bot.Client.Self.Teleport(destRegion.RegionHandle, destPosition); |
78 | |||
79 | Thread.Sleep(Bot.Random.Next(3000, 10000)); | ||
73 | } | 80 | } |
74 | } | 81 | } |
75 | } \ No newline at end of file | 82 | } \ No newline at end of file |