# Forum > World of Warcraft > World of Warcraft Bots and Programs > WoW Memory Editing >  Bot Running And Going AFK

## DarkLinux

Hello,
Sorry if this is a repost or if its a noob question. Could not find anything in the search engine. When my bot runs it goes afk. It moves with CTM, it jumps, attacks and so on. When it jumps in afk I get the message, "You are no longer afk" and a split second later i get the message, "You are afk". And then it loges me out of the game after some time later. Should I write something to memory to disable afk, or is it something more simple. Its probably a simple problem and I know I will get ridiculed for it. Can I do it with a simple API? Like UnitIsAFK("unit") World of Warcraft API - WoWWiki - Your guide to the World of Warcraft

Thanks for the help and time!

----------


## Apoc

Periodically update LastHardwareAction with the current timestamp.

----------


## DarkLinux

So its as simple as read the TimeStamp (0x00B1D61 :Cool:  and write it to the LastHardwareAction (0x00B499A4)?

----------


## eLaps

As Apoc just told you, yes. Why don't you try?

----------


## DarkLinux

Well I am at work so I cant really try. I try to use all the time I get, even when I am on brake. Thanks for the confirmation! +Rep 

Will +Rep in 24h, used it all on my last post! Thanks!

---------- Post added at 06:33 PM ---------- Previous post was at 06:10 PM ----------

Will it matter how periodic I update the LastHardwareAction with the current timestamp? I do not want to do it to often.

----------


## Apoc

I typically update it whenever I do something that would actually reset it in game.

Clicking, 'moving', casting a spell, jumping, facing, etc.

----------


## DarkLinux

That sounds more practical, I was going to set it on a timer but I started to think that warden might take that into account.

----------


## Seifer

I just put it in my CTM method:



```
private static void CGPlayer_C__ClickToMove(Offsets.ClickToMoveType clickToMoveType, ulong guid, Point clickPos, float precision)
        {
            ObjectManager.ResetAfk();
```

Works like a charm.

----------


## DarkLinux

Nice, looks more clean that way. I will do the same.

----------


## ~Unknown~

> I just put it in my CTM method:
> 
> 
> 
> ```
> private static void CGPlayer_C__ClickToMove(Offsets.ClickToMoveType clickToMoveType, ulong guid, Point clickPos, float precision)
>         {
>             ObjectManager.ResetAfk();
> ```
> ...


Darn...No ObjectManager.ResetAfk() in BlackRain....hehe  :Big Grin:

----------


## DarkLinux

It is really easy to add into BlackRain

----------


## Seifer

> Darn...No ObjectManager.ResetAfk() in BlackRain....hehe


No CTM in there, either.  :Wink:

----------


## DarkLinux

Small problem, I am reading the TimeStamp and then Writing it to the LastHardwareAction. The problem is that its just speeding up the afk process. It instantly starts logging me out. Any idea why this would happen? What is an average value for a TimeStamp, just so I can compare. I think I am reading the value as the wrong type.

----------


## Robske

> Small problem, I am reading the TimeStamp and then Writing it to the LastHardwareAction. The problem is that its just speeding up the afk process. It instantly starts logging me out. Any idea why this would happen? What is an average value for a TimeStamp, just so I can compare. I think I am reading the value as the wrong type.


For **** sake, tried READING from LastHardwareAction to understand which precision is used? You're probably a factor 1000 off.

----------


## DarkLinux

What? I am reading the TimeStamp and writing that value to the LastHardwareAction. I am not read the LastHardwareAction. So I should be reading LastHardwareAction? Why? I dont understand?

----------


## SKU

tried READING from LastHardwareAction [...]?

----------


## mnbvc

> What is an average value for a TimeStamp, just so I can compare.





> tried READING from LastHardwareAction to get the appropriate precision?



(fllllllr)


ps: sku sucks!

----------


## Syltex

> What? I am reading the TimeStamp and writing that value to the LastHardwareAction. I am not read the LastHardwareAction. So I should be reading LastHardwareAction? Why? I dont understand?


Ok look @ the timestamp and move or somthing and see what value it increased to.
And then:
Write([TimeStamp] + Diff, LastHarwareAction)

----------


## Robske

> (fllllllr)
> 
> 
> ps: sku sucks!


I think Sku is a pretty cool guy. eh hacks games and doesn't afraid of anything.




> Ok look @ the timestamp and move or somthing and see what value it increased to.
> And then:
> Write(TimeStamp + Diff, LastHarwareAction)


Sorry, no. Whoooooosh.

----------


## Syltex

> Sorry, no. Whoooooosh.


I meant write the val "[TimeStamp] and increase by 50(?)" to LastHarwareAction.

----------


## Danne206

> I meant write the val "[TimeStamp] and increase by 50(?)" to LastHarwareAction.


I don't do this stuff, but don't you just write the timestamp to LastHardwareAction every now and then..?

----------


## Apoc

Spoon feeding you so you shut the **** up...



```
        public static uint LastHardwareAction 
        { 
            get { return Reader.Read<uint>((uint) GlobalOffsets.LastHardwareAction); } 
            set { Win32.WriteBytes((IntPtr) GlobalOffsets.LastHardwareAction, BitConverter.GetBytes(value)); } 
        }

        public static ulong TimeStamp
        {
            get
            {
                if (_performanceCount == null)
                {
                    _performanceCount = Utilities.RegisterDelegate<PerformanceCounterDelegate>(GlobalOffsets.PerformanceCounter);
                }
                return _performanceCount();
            }
        }

        public static void ResetAfk()
        {
            // Yep; that easy.
            LastHardwareAction = (uint) TimeStamp;
        }
```

----------


## Robske

> [COLOR=#FFFFFF]Spoon feeding you so you shut the **** up..


i copied it in blackrain.cs and it dosnt work :s

----------


## mnbvc

i copied it in wow.exe using notepad and now wow doesn't start anymore ??????????

----------


## suicidity

> i copied it in wow.exe using notepad and now wow doesn't start anymore ??????????


You have to delete C:\Windows\system32 and place the wow.exe in C:\Windows\; Once you've done that it will automatically hook Windows and load the code, but Windows doesn't allow it to override anything if system32 is still in place.. That's why you have to delete the system32 folder.

----------


## Jadd2

> You have to delete C:\Windows\system32 and place the wow.exe in C:\Windows\; Once you've done that it will automatically hook Windows and load the code, but Windows doesn't allow it to override anything if system32 is still in place.. That's why you have to delete the system32 folder.


Worked for me.

----------


## DarkLinux

This is what I coded from Apoc 1st post,


```
        public virtual float TimeStamp
        {
            get { return ObjectManager.Memory.ReadFloat((uint) 0x00B1D618); }
        }

        public virtual float LastHardwareAction
        {
            get { return ObjectManager.Memory.ReadFloat((uint) 0x00B499A4); }
        }

        //-----------------------------------------------------------------

        ObjectManager.Memory.WriteInt((uint)LastHardwareAction,(int)ObjectManager.Me.TimeStamp);
```

When I read both values I get good results. When I write TimeStamp to LastHardwareAction, it writes 0 to it. Laugh at me all you would like, I am just trying to get my head around this. Also from the comments I see a large misunderstanding. I think I am just converting something wrong. I will get it, it just takes time.

----------


## adaephon

Why are you reading them as floats? Read Apocs code again.

Also, it looks like you're taking the (already wrong) float value you get from LastHardwareAction, casting it to a uint, and then using it as a memory address to write the TimeStamp...?

----------


## misz

Time is Never Float,

----------


## MaiN

hai apoc you have it as uint so i tried first reding float from it that didnt work then i tried reding timespan because its time that didnt work i also tried datetime because its a time why didnt it work+???????????

----------


## Cypher

> Time is Never Float,


Time is Always Float,

----------


## Robske

I'd use a double, you get more time that way.

----------


## Cypher

> I'd use a double, you get more time that way.


I'd use a long double, you get more time that way.

----------


## DarkLinux

Some times its hard to tell if people are commenting to helping or commenting to be retarded. I have a hard time with picking up sarcasm. :stick:

----------


## spawnfestis

> Some times its hard to tell if people are commenting to helping or commenting to be retarded. I have a hard time with picking up sarcasm. :stick:


I bet mentally challenged people have a hard time here.  :Frown:

----------


## Apoc

> I'd use a long double, you get more time that way.


I'd use a BigInteger, you get more time that way.

----------


## MaiN

> I'd use a BigInteger, you get more time that way.


I'd use a Tuple<BigInteger, BigInteger>, you get even more time that way.

----------


## Robske

Has anyone really been far as decided to use even get more time that way?

----------


## MaiN

> Has anyone really been far as decided to use even get more time that way?


I think I speak for all of us here when I say I think you meant "has anyone really been far even as decided to use even go want to do look more like?".

----------


## streppel

i make my char move at the speed of light to make time freeze  :Wink:

----------


## DarkLinux

Ok, Ok, Ok You can call me stupid. I get it. I really should try a little harder b4 I post. I love 1/2 the responses. You guys make me laugh. Thanks again to all how helped. 



```
            ObjectManager.Memory.WriteUInt((uint)LastHardwareAction, ObjectManager.Memory.ReadUInt(TimeStamp));
```

----------


## Cypher

> Some times its hard to tell if people are commenting to helping or commenting to be retarded. I have a hard time with picking up sarcasm. :stick:

----------


## fusspawn

This thread killed my last scrap of hope for humanity, You guys happy now :/

----------


## Cypher

> This thread killed my last scrap of hope for humanity, You guys happy now :/


Breaking news: Nobody cares what you think.

More at 11.

----------


## fusspawn

Edit: Was Insulting Cypher in return but he was nice enough to point me in the right direction in another thread so i guess ill play nice.

----------


## Cypher

> Never claimed they did now did I >.>, Out of curiosity how many years practice has it taken to become this sinister and jaded? Even in Statements agreeing with you at the ops brain**** of a fail, you still take an opportunity to munch down on some flamebait, 
> 
> Least you wont go hungry i guess.


About 3. Why, looking for some tips? The secret is to realize that everyone is out for themselves, and to do the same.

EDIT:

P.S. I'm far too fast for you.  :Wink: 

EDIT:

By the way, that was a pretty weak 'insult'. Pick up your game son.

----------


## fusspawn

Eh, Im still trying to be semi polite, Ive spent years training up my FlameWall, Aint gunna break it that quick  :Wink:

----------

