Hi,
me again with yet another Plugin, which i needed for myself.
The bot ignored all the raid/group invites while questing(using AutoExp Plugin), which could come in handy to finish quests faster and also make you look less bottish, because you atleast respond to those invites.
This plugin will check for raid/party invites and accepts them if the person who invited you is nearby.
Once in a party it will check if the bot is still near the invitation position and also check if there are any party members in range.
If one of those checks fail, the bot will leave the party.
Tested it for 2 hours now and had no issues yet.
Feel free to post suggestions:
me again with yet another Plugin, which i needed for myself.
The bot ignored all the raid/group invites while questing(using AutoExp Plugin), which could come in handy to finish quests faster and also make you look less bottish, because you atleast respond to those invites.
This plugin will check for raid/party invites and accepts them if the person who invited you is nearby.
Once in a party it will check if the bot is still near the invitation position and also check if there are any party members in range.
If one of those checks fail, the bot will leave the party.
Tested it for 2 hours now and had no issues yet.
Feel free to post suggestions:
Code:
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using ArcheBuddy.Bot.Classes;
namespace AutoAcceptInvite{
public class AutoAcceptInvite : Core
{
public static string GetPluginAuthor()
{
return "2face";
}
public static string GetPluginVersion()
{
return "1.0.0.0";
}
public static string GetPluginDescription()
{
return "AutoAcceptInvite Plugin";
}
private Double _invitePosX = 0;
private Double _invitePosY = 0;
private Double _invitePosZ = 0;
private Double _inviteDist = 100.0;
//Call on plugin start
public void PluginRun()
{
onPartyInvite += partyInvite;
onRaidInvite += raidInvite;
Log("Start");
while (true){
Thread.Sleep(1000);
if(isInParty()){
if(!validParty()){
Log("Leaving party");
LeaveFromParty();
}
}
}
}
public bool validParty(){
if(partyInRange(140, false) <= 0){
Log("No party members nearby");
return false;
}else if(me.dist(_invitePosX, _invitePosY, _invitePosZ) >= 300){
Log("Too far away from invite position");
return false;
}
return true;
}
public void handleInvite(String name, String type){
Log("Incoming " + type + " invite from player: " + name);
System.Random RandNum = new System.Random();
int waitTime = RandNum.Next(2000, 8000);
Thread.Sleep(waitTime);
if(isPlayerNearby(name)){
acceptInvites(type);
}else{
declineInvites(type);
}
}
public void acceptInvites(String type){
Log("Accepting invite");
_invitePosX = me.X;
_invitePosY = me.Y;
_invitePosZ = me.Z;
if(type == "raid"){
RaidInviteAnswer(true);
}else{
PartyInviteAnswer(true);
}
}
public void declineInvites(String type){
Log("Declining invite");
if(type == "raid"){
RaidInviteAnswer(false);
}else{
PartyInviteAnswer(false);
}
}
public bool isPlayerNearby(String name){
List<Creature> list = getCreatures();
foreach(var cr in list){
if(cr.name.Equals(name)){
if(me.dist(cr) <= _inviteDist) return true;
}
}
return false;
}
public void partyInvite(String nick)
{
handleInvite(nick, "party");
}
public void raidInvite(String nick)
{
handleInvite(nick, "raid");
}
//Call on plugin stop
public void PluginStop()
{
}
}
}