using System;
using System.Windows.Forms;
using System.Threading;
using System.Collections.Generic;
using ArcheBuddy.Bot.Classes;
namespace RelogNamespace
{
public class RelogClass : Core
{
public void PluginRun()
{
while (true)
{
if (gameState == GameState.ServerSelect)
{
//Find our game world
var myWorld = getWorlds().Find(w => w.name == "Orchidna");
if (myWorld == null || (myWorld != null && !myWorld.EnterGameServer()))
{
Log("Invalid game world name or error while we try to enter game server!");
return;
}
//Wait while we enter game world
while (gameState != GameState.CharacterSelect)
Thread.Sleep(500);
//Get our character (in this example first character from all that you have on this game world
var chararcters = myWorld.getCharacters();
if (chararcters.Count == 0 || (chararcters.Count > 0 && !chararcters[0].EnterGame()))
{
Log("No characters on this world or error while we try to enter game!");
return;
}
}
Thread.Sleep(1000);
}
}
}
}