Jump to content

cdub1990

Members
  • Posts

    7
  • Joined

  • Last visited

Reputation Activity

  1. Like
    cdub1990 reacted to iMod in Mage Portal bot   
    You need to write a plugin for it. There is still one that reacts at chat messages, you could take a look at it.
    It should be not that complicated.
    1. Trade can be detected by event + name filter
    2. A text parser(Regex) should do the rest

    Here is a sample how i did it in one of my projects.
    public void Pulse(WaitChatCommand task) { // Log Log.WriteDebug($"Waiting for chat command \"{task.ChatCommand}\" from {task.UserName}."); // Create channel Channel chat = new Channel(); // Proceed until we have a match bool match = false; while (!match) { try { // Read chat while (chat.ActuelRead != Channel.GetMsgActuelInWow && Products.IsStarted) { // Get message Channel.Message message = chat.ReadMsg(); if (!string.IsNullOrWhiteSpace(message.Msg) && message.Channel == task.ChatType && message.UserName == task.UserName ) { // Is a known command? if (message.Msg == task.ChatCommand) { // Set match = true; } } // Wait Thread.Sleep(100); } } catch (Exception e) { // Log Logging.WriteError("[DungeonRobotActionCommand]: " + e); } } } I also took the existing one from @Droidz as sample.

    About the invite.
    public void Pulse(InviteToParty task) { // Still in the party? if (Party.GetParty().Any(p => p.Name == task.UserName)) { // Log Log.WriteDebug($"Skip invite player, because {task.UserName} is in the party."); return; } if ((Party.IsInGroup() && Party.CurrentPlayerIsLeader()) || !Party.IsInGroup()) { // Log Log.WriteDebug($"Invite {task.UserName} into the party."); // Invite player Lua.LuaDoString($"InviteUnit(\"{task.UserName}\");"); } else { // Log Log.WriteDebug($"Skip invite player, because we are not the leader."); return; } // Log Log.WriteDebug($"Wait until {task.UserName} is in the party."); // Wait until the player is in the party while (!Party.GetParty().Any(p => p.Name == task.UserName)) { // Wait Thread.Sleep(3000); // Invite player Lua.LuaDoString($"InviteUnit(\"{task.UserName}\");"); } } There is some more stuff in it that you don't need but its just an example and I was to lazy and just copied some of my code 
    Hope that helps a bit.
×
×
  • Create New...