|
You last visited: Today at 08:47
Advertisement
Need a script...
Discussion on Need a script... within the AutoIt forum part of the Coders Den category.
06/29/2012, 01:22
|
#1
|
elite*gold: 0
Join Date: May 2008
Posts: 14
Received Thanks: 2
|
Need a script...
I need a script that auto press the F1 key non-stop. And a script in which i can select in what window to do that... And the thing is that i want to work when the window is minimized... And i would like to use it in 3-4 windows... The same script  It's hard to make one?:-s Or can u explain to me how to do it?!
|
|
|
06/29/2012, 12:19
|
#2
|
ベトナム警察
elite*gold: 0
Join Date: Jan 2012
Posts: 16,498
Received Thanks: 3,525
|
For the Auto Press you can use the Function Send..
The 2nd Thing i don't know how.
PHP Code:
While 1 Send("{F1}") Sleep(1000) ; 1000 = 1 Sec. Will stop for 1 Sec. than it will repeat and and and WEnd
|
|
|
06/29/2012, 14:08
|
#3
|
elite*gold: 966
Join Date: Apr 2010
Posts: 1,105
Received Thanks: 681
|
See the AutoIt help with the keyword ControlSend. It's all you need.
|
|
|
06/29/2012, 21:21
|
#4
|
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,149
|
Code:
AutoItSetOption("GUIResizeMode", 802)
Dim $bSendKey = False, $nIndex = 1
Dim $GUI_Input[2][13] = [ [1], _ ;Count
[ _
1, _ ;(0): Index
0, _ ;(1) Window: Handle
5, _ ;(2) Window: Left
5, _ ;(3) Top
200, _ ;(4) Window: Width
21, _ ;(5) Height
0, _ ;(6) Key: Handle
0, _ ;(7) Key: Left
35, _ ;(8) Key: Width
0, _ ;(9) Timer: Handle
0, _ ;(10) Timer: Left
45, _ ;(11) Timer: Width
0 _ ;(12) Timer: Timestamp (Handle)
] _
]
$GUI_Input[1][7] = $GUI_Input[1][2] * 2 + $GUI_Input[1][4]
$GUI_Input[1][10] = $GUI_Input[1][2] * 3 + $GUI_Input[1][4] + $GUI_Input[1][8]
$GUI_Form = GUICreate("KDeluxe", $GUI_Input[1][2] * 5 + $GUI_Input[1][4] + $GUI_Input[1][8] + $GUI_Input[1][11] + 25, $GUI_Input[1][3] * 3 + $GUI_Input[1][5] + 25)
$GUI_Input[1][1] = GUICtrlCreateInput("1. Window", $GUI_Input[1][2], $GUI_Input[1][3], $GUI_Input[1][4], $GUI_Input[1][5])
$GUI_Input[1][6] = GUICtrlCreateInput("{F1}", $GUI_Input[1][7], $GUI_Input[1][3], $GUI_Input[1][8], $GUI_Input[1][5])
$GUI_Input[1][9] = GUICtrlCreateInput("250", $GUI_Input[1][10], $GUI_Input[1][3], $GUI_Input[1][11], $GUI_Input[1][5], 0x2080)
$Btn_Add = GUICtrlCreateButton("+", $GUI_Input[1][2] * 4 + $GUI_Input[1][4] + $GUI_Input[1][8] + $GUI_Input[1][11], $GUI_Input[1][3], 25, 21)
$Btn_Delete = GUICtrlCreateButton("-", $GUI_Input[1][2] * 4 + $GUI_Input[1][4] + $GUI_Input[1][8] + $GUI_Input[1][11], $GUI_Input[1][3] - $GUI_Input[1][3] - 25, 25, 21)
$Btn_Start = GUICtrlCreateButton("Start", $GUI_Input[1][2], $GUI_Input[1][3] * 2 + $GUI_Input[1][5], $GUI_Input[1][4], 25)
GUICtrlSetState($Btn_Delete, 128)
GUISetState()
Do
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Btn_Add
$nArraySize = $GUI_Input[0][0] + 1
$GUI_Input[0][0] = $nArraySize
If $nArraySize > 1 Then GUICtrlSetState($Btn_Delete, 64)
ReDim $GUI_Input[$nArraySize + 1][13]
$GUI_Input[$nArraySize][0] = $nArraySize
$GUI_Input[$nArraySize][2] = $GUI_Input[1][2]
$GUI_Input[$nArraySize][3] = $GUI_Input[1][3] * $nArraySize + $GUI_Input[1][5] * ($nArraySize - 1)
$GUI_Input[$nArraySize][4] = $GUI_Input[1][4]
$GUI_Input[$nArraySize][5] = $GUI_Input[1][5]
$GUI_Input[$nArraySize][7] = $GUI_Input[1][2] * 2 + $GUI_Input[1][4]
$GUI_Input[$nArraySize][8] = $GUI_Input[1][8]
$GUI_Input[$nArraySize][10] = $GUI_Input[$nArraySize][7] + $GUI_Input[1][2] + $GUI_Input[1][8]
$GUI_Input[$nArraySize][11] = $GUI_Input[1][11]
$GUI_Input[$nArraySize][1] = GUICtrlCreateInput($nArraySize & ". Window", $GUI_Input[$nArraySize][2], $GUI_Input[$nArraySize][3], $GUI_Input[$nArraySize][4], $GUI_Input[$nArraySize][5])
$GUI_Input[$nArraySize][6] = GUICtrlCreateInput("{F1}", $GUI_Input[$nArraySize][7], $GUI_Input[$nArraySize][3], $GUI_Input[$nArraySize][8], $GUI_Input[$nArraySize][5])
$GUI_Input[$nArraySize][9] = GUICtrlCreateInput("250", $GUI_Input[$nArraySize][10], $GUI_Input[$nArraySize][3], $GUI_Input[$nArraySize][11], $GUI_Input[$nArraySize][5], 0x2080)
GUICtrlSetPos($Btn_Add, $GUI_Input[1][2] * 4 + $GUI_Input[1][4] + $GUI_Input[1][8] + $GUI_Input[1][11], $GUI_Input[$nArraySize][3])
GUICtrlSetPos($Btn_Delete, $GUI_Input[1][2] * 4 + $GUI_Input[1][4] + $GUI_Input[1][8] + $GUI_Input[1][11], $GUI_Input[$nArraySize][3] - $GUI_Input[1][3] - 25)
GUICtrlSetPos($Btn_Start, $GUI_Input[1][2], $GUI_Input[$nArraySize][3] + $GUI_Input[1][3] + $GUI_Input[1][5])
$WinPos = WinGetPos($GUI_Form)
WinMove($GUI_Form, "", Default, Default, Default, $WinPos[3] + $GUI_Input[1][3] + $GUI_Input[1][5])
$GUI_Input[$nArraySize][12] = TimerInit()
Case $Btn_Delete
$nArraySize = $GUI_Input[0][0]
$GUI_Input[0][0] = $nArraySize - 1
If $nArraySize - 1 == 1 Then GUICtrlSetState($Btn_Delete, 128)
GUICtrlDelete($GUI_Input[$nArraySize][1])
GUICtrlDelete($GUI_Input[$nArraySize][6])
GUICtrlDelete($GUI_Input[$nArraySize][9])
GUICtrlSetPos($Btn_Add, $GUI_Input[1][2] * 4 + $GUI_Input[1][4] + $GUI_Input[1][8] + $GUI_Input[1][11], $GUI_Input[$nArraySize - 1][3])
GUICtrlSetPos($Btn_Delete, $GUI_Input[1][2] * 4 + $GUI_Input[1][4] + $GUI_Input[1][8] + $GUI_Input[1][11], $GUI_Input[$nArraySize - 1][3] - $GUI_Input[1][3] - 25)
GUICtrlSetPos($Btn_Start, $GUI_Input[1][2], $GUI_Input[$nArraySize][3])
$WinPos = WinGetPos($GUI_Form)
WinMove($GUI_Form, "", Default, Default, Default, $WinPos[3] - $GUI_Input[1][3] - $GUI_Input[1][5])
ReDim $GUI_Input[$nArraySize][13]
Case $Btn_Start
$bSendKey = Not $bSendKey
If $bSendKey Then
GUICtrlSetData($Btn_Start, "Stop")
For $i = 1 To $GUI_Input[0][0]
$GUI_Input[$i][12] = TimerInit()
Next
Else
GUICtrlSetData($Btn_Start, "Start")
EndIf
EndSwitch
If $bSendKey Then
$nDelay = GUICtrlRead($GUI_Input[$nIndex][9])
If TimerDiff($GUI_Input[$nIndex][12]) >= $nDelay Then
$szWindowTitle = GUICtrlRead($GUI_Input[$nIndex][1])
$szKey = GUICtrlRead($GUI_Input[$nIndex][6])
$WinList = WinList($szWindowTitle)
If $WinList[0][0] > 0 Then
For $i = 1 To $WinList[0][0]
ControlSend($WinList[$i][1], "", "", $szKey)
Next
EndIf
$GUI_Input[$nIndex][12] = TimerInit()
EndIf
$nIndex += 1
If $nIndex > $GUI_Input[0][0] Then $nIndex = 1
EndIf
;Sleep(10)
Until $nMsg == -3
|
|
|
06/29/2012, 22:48
|
#5
|
elite*gold: 0
Join Date: May 2008
Posts: 14
Received Thanks: 2
|
Quote:
Originally Posted by KDeluxe
Code:
AutoItSetOption("GUIResizeMode", 802)
Dim $bSendKey = False, $nIndex = 1
Dim $GUI_Input[2][13] = [ [1], _ ;Count
[ _
1, _ ;(0): Index
0, _ ;(1) Window: Handle
5, _ ;(2) Window: Left
5, _ ;(3) Top
200, _ ;(4) Window: Width
21, _ ;(5) Height
0, _ ;(6) Key: Handle
0, _ ;(7) Key: Left
35, _ ;(8) Key: Width
0, _ ;(9) Timer: Handle
0, _ ;(10) Timer: Left
45, _ ;(11) Timer: Width
0 _ ;(12) Timer: Timestamp (Handle)
] _
]
$GUI_Input[1][7] = $GUI_Input[1][2] * 2 + $GUI_Input[1][4]
$GUI_Input[1][10] = $GUI_Input[1][2] * 3 + $GUI_Input[1][4] + $GUI_Input[1][8]
$GUI_Form = GUICreate("KDeluxe", $GUI_Input[1][2] * 5 + $GUI_Input[1][4] + $GUI_Input[1][8] + $GUI_Input[1][11] + 25, $GUI_Input[1][3] * 3 + $GUI_Input[1][5] + 25)
$GUI_Input[1][1] = GUICtrlCreateInput("1. Window", $GUI_Input[1][2], $GUI_Input[1][3], $GUI_Input[1][4], $GUI_Input[1][5])
$GUI_Input[1][6] = GUICtrlCreateInput("{F1}", $GUI_Input[1][7], $GUI_Input[1][3], $GUI_Input[1][8], $GUI_Input[1][5])
$GUI_Input[1][9] = GUICtrlCreateInput("250", $GUI_Input[1][10], $GUI_Input[1][3], $GUI_Input[1][11], $GUI_Input[1][5], 0x2080)
$Btn_Add = GUICtrlCreateButton("+", $GUI_Input[1][2] * 4 + $GUI_Input[1][4] + $GUI_Input[1][8] + $GUI_Input[1][11], $GUI_Input[1][3], 25, 21)
$Btn_Delete = GUICtrlCreateButton("-", $GUI_Input[1][2] * 4 + $GUI_Input[1][4] + $GUI_Input[1][8] + $GUI_Input[1][11], $GUI_Input[1][3] - $GUI_Input[1][3] - 25, 25, 21)
$Btn_Start = GUICtrlCreateButton("Start", $GUI_Input[1][2], $GUI_Input[1][3] * 2 + $GUI_Input[1][5], $GUI_Input[1][4], 25)
GUICtrlSetState($Btn_Delete, 128)
GUISetState()
Do
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Btn_Add
$nArraySize = $GUI_Input[0][0] + 1
$GUI_Input[0][0] = $nArraySize
If $nArraySize > 1 Then GUICtrlSetState($Btn_Delete, 64)
ReDim $GUI_Input[$nArraySize + 1][13]
$GUI_Input[$nArraySize][0] = $nArraySize
$GUI_Input[$nArraySize][2] = $GUI_Input[1][2]
$GUI_Input[$nArraySize][3] = $GUI_Input[1][3] * $nArraySize + $GUI_Input[1][5] * ($nArraySize - 1)
$GUI_Input[$nArraySize][4] = $GUI_Input[1][4]
$GUI_Input[$nArraySize][5] = $GUI_Input[1][5]
$GUI_Input[$nArraySize][7] = $GUI_Input[1][2] * 2 + $GUI_Input[1][4]
$GUI_Input[$nArraySize][8] = $GUI_Input[1][8]
$GUI_Input[$nArraySize][10] = $GUI_Input[$nArraySize][7] + $GUI_Input[1][2] + $GUI_Input[1][8]
$GUI_Input[$nArraySize][11] = $GUI_Input[1][11]
$GUI_Input[$nArraySize][1] = GUICtrlCreateInput($nArraySize & ". Window", $GUI_Input[$nArraySize][2], $GUI_Input[$nArraySize][3], $GUI_Input[$nArraySize][4], $GUI_Input[$nArraySize][5])
$GUI_Input[$nArraySize][6] = GUICtrlCreateInput("{F1}", $GUI_Input[$nArraySize][7], $GUI_Input[$nArraySize][3], $GUI_Input[$nArraySize][8], $GUI_Input[$nArraySize][5])
$GUI_Input[$nArraySize][9] = GUICtrlCreateInput("250", $GUI_Input[$nArraySize][10], $GUI_Input[$nArraySize][3], $GUI_Input[$nArraySize][11], $GUI_Input[$nArraySize][5], 0x2080)
GUICtrlSetPos($Btn_Add, $GUI_Input[1][2] * 4 + $GUI_Input[1][4] + $GUI_Input[1][8] + $GUI_Input[1][11], $GUI_Input[$nArraySize][3])
GUICtrlSetPos($Btn_Delete, $GUI_Input[1][2] * 4 + $GUI_Input[1][4] + $GUI_Input[1][8] + $GUI_Input[1][11], $GUI_Input[$nArraySize][3] - $GUI_Input[1][3] - 25)
GUICtrlSetPos($Btn_Start, $GUI_Input[1][2], $GUI_Input[$nArraySize][3] + $GUI_Input[1][3] + $GUI_Input[1][5])
$WinPos = WinGetPos($GUI_Form)
WinMove($GUI_Form, "", Default, Default, Default, $WinPos[3] + $GUI_Input[1][3] + $GUI_Input[1][5])
$GUI_Input[$nArraySize][12] = TimerInit()
Case $Btn_Delete
$nArraySize = $GUI_Input[0][0]
$GUI_Input[0][0] = $nArraySize - 1
If $nArraySize - 1 == 1 Then GUICtrlSetState($Btn_Delete, 128)
GUICtrlDelete($GUI_Input[$nArraySize][1])
GUICtrlDelete($GUI_Input[$nArraySize][6])
GUICtrlDelete($GUI_Input[$nArraySize][9])
GUICtrlSetPos($Btn_Add, $GUI_Input[1][2] * 4 + $GUI_Input[1][4] + $GUI_Input[1][8] + $GUI_Input[1][11], $GUI_Input[$nArraySize - 1][3])
GUICtrlSetPos($Btn_Delete, $GUI_Input[1][2] * 4 + $GUI_Input[1][4] + $GUI_Input[1][8] + $GUI_Input[1][11], $GUI_Input[$nArraySize - 1][3] - $GUI_Input[1][3] - 25)
GUICtrlSetPos($Btn_Start, $GUI_Input[1][2], $GUI_Input[$nArraySize][3])
$WinPos = WinGetPos($GUI_Form)
WinMove($GUI_Form, "", Default, Default, Default, $WinPos[3] - $GUI_Input[1][3] - $GUI_Input[1][5])
ReDim $GUI_Input[$nArraySize][13]
Case $Btn_Start
$bSendKey = Not $bSendKey
If $bSendKey Then
GUICtrlSetData($Btn_Start, "Stop")
For $i = 1 To $GUI_Input[0][0]
$GUI_Input[$i][12] = TimerInit()
Next
Else
GUICtrlSetData($Btn_Start, "Start")
EndIf
EndSwitch
If $bSendKey Then
$nDelay = GUICtrlRead($GUI_Input[$nIndex][9])
If TimerDiff($GUI_Input[$nIndex][12]) >= $nDelay Then
$szWindowTitle = GUICtrlRead($GUI_Input[$nIndex][1])
$szKey = GUICtrlRead($GUI_Input[$nIndex][6])
$WinList = WinList($szWindowTitle)
If $WinList[0][0] > 0 Then
For $i = 1 To $WinList[0][0]
ControlSend($WinList[$i][1], "", "", $szKey)
Next
EndIf
$GUI_Input[$nIndex][12] = TimerInit()
EndIf
$nIndex += 1
If $nIndex > $GUI_Input[0][0] Then $nIndex = 1
EndIf
;Sleep(10)
Until $nMsg == -3
|
Thanks alot! You Rullz!
|
|
|
 |
Similar Threads
|
L2Walker script: Solo rebuff/restock/return script
08/08/2012 - Lin2 Exploits, Hacks, Bots, Tools & Macros - 63 Replies
Hello!
I've been reading alot and not really contributing so i'll start off here with a very well working script im using to bot my SK outside ivory tower in oren. I've tried to structure the code so it easily can be modified for another level of character, town, and hunting spot.
The script is made for CT2 Retail, mainly to get advantage of the newbie buffs (which now lasts all the way until level 62)
Change log:
Update 2008-09-01
Version 1.14 -Download
|
[suche] d2nt level rush script 1-25 / follow script
06/23/2010 - Diablo 2 Programming - 5 Replies
moin
erstmal sry falls es da doch schon was passendes zu gab - hab schonmal gesucht aber nur alte sachen gefunden oder eben antworten in richtung "geht so schnell dafür braucht man keinen bot" ^^
mein problem besteht darin dass ich für lvl 1 bis 20 immer x stunden brauche - trist geht ja noch halberwegs aber mit tombruns such ich mich immer dusselig ^^ - bzw cows sind noch schlimmer (dafür geht das cow-script für d2nt ausm bluebird zumindest halberwegs)
die frage ist jetz die - giebt...
|
All times are GMT +1. The time now is 08:48.
|
|