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

[HELP]Auto Open Coinpurse AFK!

Spartan37

New Member
Joined
Oct 22, 2014
Messages
43
Reaction score
0
I'm trying to make a Auto open coinspurse while afk but I don't know why it doesn't open coinpurses. Can someone help me please?
Here is the code:
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 YourNamespace {
    public class DefaultClass: Core {
        public void PluginRun() {
            
	while (true) {
                //get Labor points 
                int labor = me.laborPoints;


                //if Labor > 10
                if (labor > 10) {
					UseItem(34007); //Use Merchant's Coinpurse
					Log("Opening");
                    //if Labor < 10 wait 
                } else {
                    Log("Labor under 10, waiting to regen");
					System.Random RandNum = new System.Random();
					int waitTime;
					
					waitTime = RandNum.Next((1000*60)*1, (1000*60)*2);
					Log("Waiting for " + waitTime / 1000 + "seconds");
					Thread.Sleep(waitTime);
					UpdateNoAfkState();
					Turn(0.5);
                }

            }
        }
    }
}
 
Iso: That is not good for AFK.. it will just pop them one after the other

Edit: Made it standalone for you ... it might not work as is as i didnt test it, but any corrections should be minor

my routine is:
Code:
using System.Drawing;
using System.Windows.Forms;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using ArcheBuddy.Bot.Classes;



namespace YourNamespace {
    public class DefaultClass: Core {
            
	
        private List<uint> _coinpursesList = new List<uint>
        {
            29203, 29204, 29205, 29206, 29207
        };

        public void PluginRun() {
             foreach (
                Item i in
                    me.getItems()
                        .Where(
                            i =>
                                i.place == ItemPlace.Bag && _coinpursesList.Contains(i.id)))
                                //(i.id == 29203 || i.id == 29204 || i.id == 29205 || i.id == 29206 || i.id == 29207)))
            {
                try
                {
                    if (i == null) continue;
                    while (i.count > 0 && me.opPoints > 150 && me.isAlive())
                    {
                        Thread.Sleep(150);
                        i.UseItem();
                        MyWait(200000, 240000);
                        }
                }
                catch (Exception ex)
                {
                    Log("!!## Processinventory", "GhRider");
                    //LogEx(ex);
                }
            }
        private static void MySleep(int frm, int to)
        {
            var rnd = new Random();
            var wait = rnd.Next(frm, to);
            Thread.Sleep(wait);
        }        
}

MySleep is a function that Sleeps a random time between the 2 parameters. For AFK ... you could use 120000 and 240000 (2 mins and 4 mins)
 
Last edited:
Iso: That is not good for AFK.. it will just pop them one after the other

His code indicates he failed to read item description, not looking for stay_online_while_afk method:
Code:
waitTime = RandNum.Next((1000*60)*1, (1000*60)*2);
 
True lol ... i didnt see that it did 1 every 1 to 2 secs

good catch...

So +1 on Shift-RClick
 
I think someone made one allready. Check plugin section
 
You guys know that if you fill up your inventory space, and shift+right click on a coinpurse you never go AFK, this without the need to run AB or any macro software?
Can even minimize the client and put a hefty FPS limit on it. Been doing it for ages already ^^
 
Back
Top