2013-01-13 26 views
0

我就像一个MMORPG游戏中的GM。我们的工作是报告使用作弊并将他们送入监狱的人。但离开那个监狱区并不是很难,所以我们必须一次又一次地发送它们。我有一个懒惰的昵称列表(我有大约400个昵称要重复报告),所以它真的很无聊。是否可以使用AHK创建一个宏?

我想问的是,我对AHK一无所知。如果这种宏观是可能的,我会做一个懒散的研究来创造这个宏。但如果这是不可能的,我甚至不会去尝试。

我需要的是;宏将按下“输入”来激活聊天模式。然后将编写“/ report -cheater nickname-”并记住存在400多个昵称,因此我需要为不同的昵称重复该宏。写完“/ report -cheater nickname-”后,宏将按回车。然后会弹出一个小聊天框。宏将点击框,将写入报告原因,然后点击确认。那么会弹出另一个聊天框,以表示“您的报告已收到”。而宏也会点击确认。并且会以400多种不同的理由为400多个昵称做到这一点。这实际上可以做到吗?只是想知道。不要求你创建这个宏。如果你回答这个问题,我会尝试自己做:D

谢谢。

+0

听起来可能,名单和原因来自哪里?'Send'和'ControlClick'命令应该完成大部分工作。 http://www.autohotkey.com/docs/commands/Send.htm http://www.autohotkey.com/docs/commands/ControlClick.htm –

回答

0

此脚本将在Google上执行一系列搜索。搜索字符串存储在一个文本文件中,然后读入一个数组,然后基于点击{Tab}键(您可以自动重复)来逐个执行它们。

当脚本中断时,您可以再次启动它并为其指定一个(新)起始号码,或指示它再次从1开始。

不完全是你在找什么,但它给了你很多的出发点。

#Persistent 
#SingleInstance Force 
#installKeybdHook 
SetWorkingDir %A_ScriptDir% 
TempDir = C:\Temp 
Menu, Tray, Icon , %A_AhkPath%, 2, 1 
TrayTip, JobSearch, Started, 1 
SetTitleMatchMode, 2 
TextCounter = 0 
Return 

+Launch_App1:: 
Run, Notepad %TempDir%\Google.txt 
Return 

Launch_App1:: ; vacatures Job Search 
+CapsLock:: 
Restart: 
MouseGetPos, XPos2, YPos2 
XPos3 := 50 
YPos3 := 100 
IniRead, TextCounter, %TempDir%\GoogleCounter.ini, Counter, Nr 

ArrayCount = 0 
Loop, Read, %TempDir%\Google.txt ; This loop retrieves each line from the file, one at a time. 
{ 
    ArrayCount += 1 ; Keep track of how many items are in the array. 
    Array%ArrayCount% := A_LoopReadLine ; Store this line in the next array element. 
} 
MaxSearchCount = %ArrayCount% 
TextCounter += 1 
If (TextCounter > 1) 
InputBox, TextCounter , Start, Number (1..%MaxSearchCount%),,,,,,,10,%TextCounter% ; InputBox, OutputVar [, Title, Prompt, HIDE, Width, Height, X, Y, Font, Timeout, Default] 
TextCounter += 0 
IniWrite, %TextCounter%, %TempDir%\GoogleCounter.ini, Counter, Nr 
SearchText:=Array%TextCounter% 
MouseClick, left 
gosub, SendNewSearch 
Return 

;======================================================================================================================================= 
Browser_Favorites:: ; Search for next Vacature string (Vacatures) 
CapsLock:: 
If (TextCounter = 0) ; Restart with previous script if Textcounter is set to 0 
{ 
    GoSub, Restart 
    Exit 
} 
IniRead, TextCounter, %TempDir%\GoogleCounter.ini, Counter, Nr 
TextCounter += 1 
IniWrite, %TextCounter%, %TempDir%\GoogleCounter.ini, Counter, Nr 
SearchText:=Array%TextCounter% 
If (SearchText = "") 
{ 
    TextCounter := 0 
    IniWrite, %TextCounter%, %TempDir%\GoogleCounter.ini, Counter, Nr 
    Send, ^{F4} 
    SplashTextOff 
    ExitApp 
} 

Sleep, 200 
Send, {Home 2} 
Sleep, 700 
Send, {WheelUp 10} 
Sleep, 400 
gosub, SendNewSearch 
Exit 

SendNewSearch: 
    MouseGetPos, XPos3 ,YPos3 
    SetTitleMatchMode, 2 
    IfWinActive, Chrome 
    { 
    while (A_Cursor = "AppStarting") 
     Sleep, 200 ; Continue 

    Sleep, 100 
    SplashTextOff 
    MouseClick, left, %XPos2%,%YPos2% 
    WinGetTitle, this_title, A 
    IfInString, this_title, Google 
    { 
     Send, {Home}+{End}{DEL}%SearchText%{Enter} 
    } 
    ToolTip, Waiting.... 
    DisplayText = Nr%TextCounter% %SearchText% 
    Sleep, 500 
    SplashTextOn, 200, 0,%DisplayText% 
    WinMove, %DisplayText%, , 800, 25 
    ToolTip 
    ;MouseMove,(50),(500) 
    MouseMove,%XPos3%,%YPos3% 
    ClipBoard = %SearchText% 
    } 
Exit 
Exit 

+Browser_Favorites:: 
run, %TempDir%\Google.txt 
Return 
+0

1.最好的解决方案是解决根本原因。即使系统更健壮并防止“电源战争”,因为用户可以编写scipt来重新启用他们的帐户。我假设你没有400个理由,但只有一个手。我将创建一个txt文件,其中包含用户标识+理由标识和第二个包含原因标识和扩展文本的文件。这样,您不必重复400次原因文本,只需要修改原因文本一次即可。 –

0

这是可能的。您可以创建两个包含+400个用户名和+400个不同原因的txt文件。宏可以一行一行读取行,并可以使所有东西,你想要的,超过400次。

您需要this loop在一个function在指定的像素与PixelGetColor检查预期的颜色从写入TXT文件线阵列,一个循环(http://www.autohotkey.com/docs/commands/PixelGetColor。 htm)用于检测按钮。您也可以使用PixelGetColor命令或AutoIt3 Window Spy(将与一起安装)来查看按钮的颜色。最后,你可以从这里开始编码(http://www.autohotkey.com/docs/)。

PS。对不起,网站不允许使用超过2个超链接。

0

基本上你正在试图编写一个类型输入的脚本,然后再输入一个字符列表?

的东西很简单,你可以做的是创建一个包含你想让它键入(不包括进入,除了线之间)的一切.txt文件,并创建这样一个宏:

#n:: 
Loop, Read, inputFile.txt 
{ 
    Send {Enter}%A_LoopReadLine%{Enter} 
} 
return 

基本上你运行宏并打开游戏,你可以开始输入回车,字符信息,输入,但按下Windows键和'n'键。然后,宏将循环遍历“inputFile.txt”的每一行,并激励输入enter,行,然后输入。

相关问题