1
0
mirror of https://github.com/oliverbooth/VpSharp synced 2024-11-10 04:55:41 +00:00
VpSharp/Samples/VpSharp.VB_Sample/Program.vb

33 lines
1.0 KiB
VB.net
Raw Normal View History

2022-12-06 19:28:14 +00:00
Imports VpSharp.EventData
Module Program
Private WithEvents _client As VirtualParadiseClient
Public Sub Main(args As String())
MainAsync().GetAwaiter().GetResult()
End Sub
Private Async Function MainAsync() As Task
Dim configuration = new VirtualParadiseConfiguration _
With {
.Username = "YOUR_VP_USERNAME",
.Password = "YOUR_VP_PASSWORD",
.BotName = "Greeter",
.Application = New Application("GreeterBot", "1.0")
}
_client = New VirtualParadiseClient(configuration)
Await _client.ConnectAsync()
Await _client.LoginAsync()
Await _client.EnterAsync("WORLD_NAME")
Await _client.CurrentAvatar.TeleportAsync(Vector3d.Zero)
Await Task.Delay(-1)
End Function
Private Async Sub ClientOnAvatarJoined(sender As Object, args As AvatarJoinedEventArgs) Handles _client.AvatarJoined
Await _client.SendMessageAsync("Hello, " & args.Avatar.Name)
End Sub
End Module