Jump to content

WoW Anti AFK script


Niv
 Share

Recommended Posts

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
Link to comment
Share on other sites

  • Replies 57
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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.

Link to comment
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...
Link to comment
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
Link to comment
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

Link to comment
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.

Link to comment
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?

Link to comment
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
Link to comment
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.

Link to comment
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?

Link to comment
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

Link to comment
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 ;)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...