Niv

WoW Anti AFK script

58 posts in this topic

#1 ·  Posted (edited)

Been making a World of Warcraft AutoIt script. What this script basicly does is spam SPACE every 2-4 minutes. First it goes into a standby mode (infinitely loops). Then when I press the PAUSE key it initiates the anti afk routine and hits space every 2-4 minutes. Up to this part it works. Now when I hit PAUSE it does pause as I want it to. Now the problem is, when I hit PAUSE again to resume it, it doesn't. Why?

I'd like it to be able to pause and resume. I can start, I can pause, but then I can't resume it. No idea why ;)

Know any further tricks to improve or shorten my script? Thanks in advance.

Code below:

WinWaitActive("World of Warcraft")

HotKeySet("{pause}","activate")
HotKeySet("!{pause}","inactive")

While 1
$a = 0
inactive()
$a = 0
start()
WEnd


func inactive()
Do
Until $a = 1
EndFunc

func activate()
$a = 1
EndFunc

func start()
Do
Send("{SPACE}")
Sleep(Random(120000,240000))
Until $a = 1
EndFunc

func quit()
Exit
EndFunc
Edited by Niv

Share this post


Link to post
Share on other sites



I also play WoW and I can't think of any good reason why you would want to do this.

Share this post


Link to post
Share on other sites

like this

HotKeySet("{PAUSE}", "TogglePause")


Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

hope that helps...

bty... how does this script help wow?

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

This script helps WoW for a simple reason. I play the European version of WoW and they haven't fixed /afk flag reseting upon joining a battleground instance. What this means is that if I afk for longer than 5 minutes, the /afk flag gets attached to me. I'm sitting in the battleground queue, a spot becomes available, my autojoin addon then autojoins it. Then I get kicked from the battleground because I had the /afk flag. Blizzard said that joining a battleground should reset your /afk but it doesn't. They need to hotfix it, otherwise you get kicked everytime. Queues take about 20-40 minutes and I can assure you I don't feel like coming every 5 minutes to my computer and hitting the space button.

Share this post


Link to post
Share on other sites

This script helps WoW for a simple reason. I play the European version of WoW and they haven't fixed /afk flag reseting upon joining a battleground instance. What this means is that if I afk for longer than 5 minutes, the /afk flag gets attached to me. I'm sitting in the battleground queue, a spot becomes available, my autojoin addon then autojoins it. Then I get kicked from the battleground because I had the /afk flag. Blizzard said that joining a battleground should reset your /afk but it doesn't. They need to hotfix it, otherwise you get kicked everytime. Queues take about 20-40 minutes and I can assure you I don't feel like coming every 5 minutes to my computer and hitting the space button.

one issue you're probably going to run into is key trapping within the WoW application. i know with FFXI in order to enable your own hotkeys etc, you have to be running with a windower program. Depending on the type of feedback you're able to return from the WoW application, you may want to setup another trigger...one thing i've done before was PixelChecksum() for the first 4 characters in the chat box. i could then use a 4 character string typed into chat to trigger the function in an already running script...

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Cameronsdad, fortunately the pause key works well and WoW does not interfere with it.

Valuater, much thanks, your bit of code really helped a lot! I've revised it, I know the code isn't perfect, but most important of all the app works as intended. Clicking pause starts it, clicking pause again stops it, rinse and repeat.

Is there any way to display the ToolTip('AntiAFK started.',0,0) in a smooth manner? Even if I set it to display for 1 or 2 seconds. For those 2 seconds it flashes and blinks very fast, like if there was some problem with the refresh rate or whatever. Is there any way to display the ToolTip smoothly?

Here's the revised code that works:

WinWaitActive("World of Warcraft")

HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("!{PAUSE}","Quit")
Dim $Paused

TogglePause()
While 1
Start()
WEnd

func Start()
ToolTip('AntiAFK started.',0,0)
Sleep(1000)
ToolTip("")
While 1
Send("{SPACE}")
Sleep(Random(120000,240000))
WEnd
EndFunc

Func TogglePause()
$Paused = NOT $Paused
While $Paused
WEnd
Start()
EndFunc

func Quit()
Exit
EndFunc

Share this post


Link to post
Share on other sites

maybe this... cant test it

WinWaitActive("World of Warcraft")

HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("!{PAUSE}","Quit")
Dim $Paused

TogglePause()
While 1
;Start()
Sleep(20)
WEnd

func Start()
ToolTip('AntiAFK started.',0,0)
Sleep(2000)
ToolTip("")
While 1
Send("{SPACE}")
Sleep(Random(120000,240000))
WEnd
EndFunc

Func TogglePause()
$Paused = NOT $Paused
While $Paused
    Sleep(20)
WEnd
Start()
EndFunc

func Quit()
Exit
EndFunc

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Nope, the text box still blinks to hell and back for 1-2 sec if not shorter. ;) When I increase the sleep time to 5000, it gives the same effect. But the script itself works well.

Share this post


Link to post
Share on other sites

do you want the tip to show ALL the time that the start function is running??

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

No, I want it to be shown for only 1-2 seconds. Right now it blinks very fast for that 1 second or so.

Even if you set the tooltip to display infinitely it will keep on blinking all the time. My ideal would be that it stays there smoothly and does not blink/distort.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

not on mine ( win Xp )

it does not blink ... just shows for 2 secs and gone

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

Oh, you misunderstood me then. It does display smoothly on the Windows Xp desktop of course. However it blinks and distorts when I'm in World of Warcraft full screen mode (1280x1024 85Hz 24bits). It must be some kind of synchronisation display problem, any way to counter it?

Share this post


Link to post
Share on other sites

It must be some kind of synchronisation display problem, any way to counter it?

I Seriously doubt it

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

It must be some kind of synchronisation display problem, any way to counter it?

Not with World of Warcraft in fullscreen mode.

Share this post


Link to post
Share on other sites

I changed it around a little, it works perfect.

WinWaitActive("World of Warcraft")
                 
          
HotKeySet("{PAUSE}", "Start")
HotKeySet("!{PAUSE}","Quit")

TogglePause()
                   
func Start()
HotKeySet("{PAUSE}")
HotKeySet("{PAUSE}", "TogglePause")
ToolTip('AntiAFK started.',0,0)
While 1
Send("{SPACE}")
Sleep(Random(120000,240000))
WEnd
EndFunc

Func TogglePause()
ToolTip('AntiAFK Stopped.',0,0)
HotKeySet("{PAUSE}")
HotKeySet("{PAUSE}", "Start")
While 1
sleep(100)
WEnd
EndFunc

func Quit()
Exit
EndFunc

Share this post


Link to post
Share on other sites

Hey, how do you get this to work, i downloaded autoit script, can you tell me what the steps are to running the script, i have the same problem as you, thank you.

Hey, I have the same problem as you do, can you tell me how to run this script, I got autoit script but do not know the next steps.

Share this post


Link to post
Share on other sites

If you want the tooltip to show, use WOW in maximized window mode.

Share this post


Link to post
Share on other sites

I changed it around a little, it works perfect.

WinWaitActive("World of Warcraft")
                 
          
HotKeySet("{PAUSE}", "Start")
HotKeySet("!{PAUSE}","Quit")

TogglePause()
                   
func Start()
HotKeySet("{PAUSE}")
HotKeySet("{PAUSE}", "TogglePause")
ToolTip('AntiAFK started.',0,0)
While 1
Send("{SPACE}")
Sleep(Random(120000,240000))
WEnd
EndFunc

Func TogglePause()
ToolTip('AntiAFK Stopped.',0,0)
HotKeySet("{PAUSE}")
HotKeySet("{PAUSE}", "Start")
While 1
sleep(100)
WEnd
EndFunc

func Quit()
Exit
EndFunc
Hiho!

I am completely new in this terrain, but that's what I am searching for.

How can I get it to work, that means, what do I have to do with this script?

Share this post


Link to post
Share on other sites

Hi thanks for your script, I have saved it and compiled it into an exe, and it seems to be OK.

BUT I dont think it is working. I have this little new icon showing up in the process line, but pressing "pause" doesn't alter anything. And I'm not getting any pop-up window neither in WoW or on the desktop when I'm pressing pause.

I have been leaving the cursor on a page in Notepad, and I would imagine that this script would randomly put in Space in the text (as this script is suposed to generate "space" randomly. But no space commands seems to be send?

So basicly I need help.

Steen

Share this post


Link to post
Share on other sites

Hi thanks for your script, I have saved it and compiled it into an exe, and it seems to be OK.

BUT I dont think it is working. I have this little new icon showing up in the process line, but pressing "pause" doesn't alter anything. And I'm not getting any pop-up window neither in WoW or on the desktop when I'm pressing pause.

I have been leaving the cursor on a page in Notepad, and I would imagine that this script would randomly put in Space in the text (as this script is suposed to generate "space" randomly. But no space commands seems to be send?

So basicly I need help.

Steen

WinWaitActive("World of Warcraft")

this line makes it that it only sends the keystrokes into WoW only when WoW is active(in front of any other aplication) thats why it doessnt send keystrokes to notepad ;)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.