What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

[Plugin] AutoAcceptInvite (makes you look less bottish while questing)

2face

New Member
Joined
Feb 1, 2014
Messages
27
Reaction score
3
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:

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()
        {
        }
    }
}
 
  • Like
Reactions: Out
Love your work. You kinda "steal" my ideas :D thought about this yesterday, when I watched my Requiem level with the "questing" bot :P
Nice work, keep posting plugins ;)
 
Feel free to join me :) Got plenty of other stuff i would like to pump out.
 
I would love to, but I am afraid I am no where near your skill of coding. So far I just got myself a little AutoCombat skript, based on OUT's example code, that I modified for my class. nothing too fancy.
 
Haha. Thanks. I will try to keep up the speed of releasing some small neat plugins. The next one will be out tonight. I think it is something everyone is looking forward to.
 
Haha. Thanks. I will try to keep up the speed of releasing some small neat plugins. The next one will be out tonight. I think it is something everyone is looking forward to.


Stable servers without queue?
 
Is it possible to pick up one phrase from one *.txt and random send one of the messages that is inside it, to party and/or whisper and/or say chat?!
 
EDIT: Sorry just realized this post was necro'd and will probably not be seen by 2face

Very nice plugin.

If I may make a request though could you make a plugin that can log the player out to char select based on certain criteria set by the user for a time period set by the user. All times should be able to be randomized to avoid any pattern detection.

Some examples of when someone might want to log out

-player detected- within a certain radius

What should happen - log out for time set by user then relog and continue what the bot was doing before. This can be broken down further to only log out on being targeted (toggleable) and only log out based on the time (set by user) another player is near and within range set by the user.

-break taker- takes a timed (set by user) break

What should happen - log your char out for a time set by the user then relog and continue last used plugin

-Whisper detected-

What should happen - char logs out on a set number of whispers then relogs after a time set by the user

Thanks for reading
-Nate
 
Last edited:
Back
Top