|
You last visited: Today at 18:05
Advertisement
Need help with Slider
Discussion on Need help with Slider within the AutoIt forum part of the Coders Den category.
12/18/2013, 21:49
|
#1
|
elite*gold: 0
Join Date: Sep 2010
Posts: 473
Received Thanks: 104
|
Need help with Slider
Hi i have next script
I got inputs where i inputs cast times for skills 2900, 2600, etc... it have 10 skills
but problem is when i start it they cast skill and wait 2,9 sec then go to next skill, so i need to controll speed of casting skills + slider. Something like if cast (slider) on 100% to fire very fast but not to skip key, i dont know how to calculate this.
here is script
Code:
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <SliderConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ###
$GUI = GUICreate("Macro", 602, 272, 207, 180)
$Group3 = GUICtrlCreateGroup("", 8, 2, 585, 190)
$Group2 = GUICtrlCreateGroup("", 104, 11, 481, 86)
$castskill1 = GUICtrlCreateInput("1000", 200, 72, 33, 17)
$castskill2 = GUICtrlCreateInput("1000", 238, 72, 33, 17)
$castskill3 = GUICtrlCreateInput("1000", 276, 72, 33, 17)
$castskill4 = GUICtrlCreateInput("1000", 314, 72, 33, 17)
$castskill5 = GUICtrlCreateInput("1000", 352, 72, 33, 17)
$castskill6 = GUICtrlCreateInput("1000", 390, 72, 33, 17)
$castskill7 = GUICtrlCreateInput("1000", 428, 72, 33, 17)
$castskill8 = GUICtrlCreateInput("1000", 466, 72, 33, 17)
$castskill9 = GUICtrlCreateInput("1000", 504, 72, 33, 17)
$castskill10 = GUICtrlCreateInput("1000", 542, 72, 33, 17)
$Checkbox1 = GUICtrlCreateCheckbox("", 210, 51, 17, 17)
$Checkbox2 = GUICtrlCreateCheckbox("", 249, 51, 17, 17)
$Checkbox3 = GUICtrlCreateCheckbox("", 286, 51, 17, 17)
$Checkbox4 = GUICtrlCreateCheckbox("", 325, 51, 17, 17)
$Checkbox5 = GUICtrlCreateCheckbox("", 361, 51, 17, 17)
$Checkbox6 = GUICtrlCreateCheckbox("", 400, 51, 17, 17)
$Checkbox7 = GUICtrlCreateCheckbox("", 439, 51, 17, 17)
$Checkbox8 = GUICtrlCreateCheckbox("", 477, 51, 17, 17)
$Checkbox9 = GUICtrlCreateCheckbox("", 514, 51, 17, 17)
$Checkbox10 = GUICtrlCreateCheckbox("", 551, 51, 17, 17)
$skill1 = GUICtrlCreateInput("3", 208, 31, 17, 17)
$skill2 = GUICtrlCreateInput("4", 248, 32, 17, 17)
$skill3 = GUICtrlCreateInput("5", 284, 31, 17, 17)
$skill4 = GUICtrlCreateInput("6", 323, 31, 17, 17)
$skill5 = GUICtrlCreateInput("7", 359, 31, 17, 17)
$skill6 = GUICtrlCreateInput("8", 397, 31, 17, 17)
$skill7 = GUICtrlCreateInput("9", 437, 31, 17, 17)
$skill8 = GUICtrlCreateInput("0", 475, 31, 17, 17)
$skill9 = GUICtrlCreateInput("ß", 512, 31, 17, 17)
$skill10 = GUICtrlCreateInput("´´", 549, 31, 17, 17)
$Label1 = GUICtrlCreateLabel("Bar No", 120, 32, 46, 18)
GUICtrlSetFont(-1, 9, 400, 0, "Verdana")
GUICtrlCreateCombo("", 120, 54, 41, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "1|2|3|4")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$label5 = GUICtrlCreateLabel("SKILLS", 16, 14, 53, 18)
GUICtrlSetFont(-1, 9, 800, 0, "Verdana")
$label2 = GUICtrlCreateLabel("Hotkey", 24, 56, 48, 18)
GUICtrlSetFont(-1, 9, 400, 0, "Verdana")
$label3 = GUICtrlCreateLabel("CTRL + X", 24, 72, 60, 18)
GUICtrlSetFont(-1, 9, 400, 0, "Verdana")
$Group1 = GUICtrlCreateGroup("", 105, 97, 481, 86)
$Input1 = GUICtrlCreateInput("1000", 201, 158, 33, 17)
$Input2 = GUICtrlCreateInput("1000", 239, 158, 33, 17)
$Input3 = GUICtrlCreateInput("1000", 277, 158, 33, 17)
$Input4 = GUICtrlCreateInput("1000", 315, 158, 33, 17)
$Input5 = GUICtrlCreateInput("1000", 353, 158, 33, 17)
$Input6 = GUICtrlCreateInput("1000", 391, 158, 33, 17)
$Input7 = GUICtrlCreateInput("1000", 429, 158, 33, 17)
$Input8 = GUICtrlCreateInput("1000", 467, 158, 33, 17)
$Input9 = GUICtrlCreateInput("1000", 505, 158, 33, 17)
$Input10 = GUICtrlCreateInput("1000", 543, 158, 33, 17)
$Checkbox11 = GUICtrlCreateCheckbox("", 211, 137, 17, 17)
$Checkbox12 = GUICtrlCreateCheckbox("", 250, 137, 17, 17)
$Checkbox13 = GUICtrlCreateCheckbox("", 287, 137, 17, 17)
$Checkbox14 = GUICtrlCreateCheckbox("", 326, 137, 17, 17)
$Checkbox15 = GUICtrlCreateCheckbox("", 362, 137, 17, 17)
$Checkbox16 = GUICtrlCreateCheckbox("", 401, 137, 17, 17)
$Checkbox17 = GUICtrlCreateCheckbox("", 440, 137, 17, 17)
$Checkbox18 = GUICtrlCreateCheckbox("", 478, 137, 17, 17)
$Checkbox19 = GUICtrlCreateCheckbox("", 515, 137, 17, 17)
$Checkbox20 = GUICtrlCreateCheckbox("", 552, 137, 17, 17)
$Input11 = GUICtrlCreateInput("3", 209, 117, 17, 17)
$Input12 = GUICtrlCreateInput("4", 249, 118, 17, 17)
$Input13 = GUICtrlCreateInput("5", 285, 117, 17, 17)
$Input14 = GUICtrlCreateInput("6", 324, 117, 17, 17)
$Input15 = GUICtrlCreateInput("7", 360, 117, 17, 17)
$Input16 = GUICtrlCreateInput("8", 398, 117, 17, 17)
$Input17 = GUICtrlCreateInput("9", 438, 117, 17, 17)
$Input18 = GUICtrlCreateInput("0", 476, 117, 17, 17)
$Input19 = GUICtrlCreateInput("ß", 513, 117, 17, 17)
$Input20 = GUICtrlCreateInput("´´", 550, 117, 17, 17)
$Label4 = GUICtrlCreateLabel("Bar No", 121, 118, 46, 18)
GUICtrlSetFont(-1, 9, 400, 0, "Verdana")
GUICtrlCreateCombo("", 121, 140, 41, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "1|2|3|4")
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$saveBtn = GUICtrlCreateButton("Save", 520, 240, 75, 25)
$startBtn = GUICtrlCreateButton("Start", 8, 240, 75, 25)
$Group4 = GUICtrlCreateGroup("", 8, 193, 585, 41)
$label10 = GUICtrlCreateLabel("Cast time", 20, 208, 64, 18)
GUICtrlSetFont(-1, 9, 400, 0, "Verdana")
$hSlider = GUICtrlCreateSlider(96, 208, 494, 20, BitOR($TBS_TOOLTIPS, $TBS_AUTOTICKS, $TBS_ENABLESELRANGE))
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
; ============== read data from gui ================
; read keys
; bar 1
$skillInput1 = GUICtrlRead($skill1)
$skillInput2 = GUICtrlRead($skill2)
$skillInput3 = GUICtrlRead($skill3)
$skillInput4 = GUICtrlRead($skill4)
$skillInput5 = GUICtrlRead($skill5)
$skillInput6 = GUICtrlRead($skill6)
$skillInput7 = GUICtrlRead($skill7)
$skillInput8 = GUICtrlRead($skill8)
$skillInput9 = GUICtrlRead($skill9)
$skillInput10 = GUICtrlRead($skill10)
; bar 2
$skillInput11 = GUICtrlRead($Input11)
$skillInput12 = GUICtrlRead($Input12)
$skillInput13 = GUICtrlRead($Input13)
$skillInput14 = GUICtrlRead($Input14)
$skillInput15 = GUICtrlRead($Input15)
$skillInput16 = GUICtrlRead($Input16)
$skillInput17 = GUICtrlRead($Input17)
$skillInput18 = GUICtrlRead($Input18)
$skillInput19 = GUICtrlRead($Input19)
$skillInput20 = GUICtrlRead($Input20)
; read cast times
; bar 1
$castInput1 = GUICtrlRead($castskill1)
$castInput2 = GUICtrlRead($castskill2)
$castInput3 = GUICtrlRead($castskill3)
$castInput4 = GUICtrlRead($castskill4)
$castInput5 = GUICtrlRead($castskill5)
$castInput6 = GUICtrlRead($castskill6)
$castInput7 = GUICtrlRead($castskill7)
$castInput8 = GUICtrlRead($castskill8)
$castInput9 = GUICtrlRead($castskill9)
$castInput10 = GUICtrlRead($castskill10)
; bar 2
$castInput11 = GUICtrlRead($Input1)
$castInput12 = GUICtrlRead($Input2)
$castInput13 = GUICtrlRead($Input3)
$castInput14 = GUICtrlRead($Input4)
$castInput15 = GUICtrlRead($Input5)
$castInput16 = GUICtrlRead($Input6)
$castInput17 = GUICtrlRead($Input7)
$castInput18 = GUICtrlRead($Input8)
$castInput19 = GUICtrlRead($Input9)
$castInput20 = GUICtrlRead($Input10)
; ============== read data from gui end ================
HotKeySet("^x", "_fire")
Global $handle = WinGetHandle("Archlord")
Global $fire
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $startBtn
If WinExists($handle) Then
TrayTip("AL-Macro", "Running...", 5000, 1)
Sleep(500)
WinActivate($handle)
Sleep(100)
EndIf
EndSwitch
WEnd
_GUICtrlSlider_ClearTics($hSlider)
Func _fire()
$fire = Not $fire
While True
If $fire Then
; send keys
; bar 1
If GUICtrlRead($Checkbox1) == $GUI_CHECKED Then
ControlSend($handle, "", "", $skillInput1, 0) ; send key
Sleep($castInput1) ; cast time of skill
EndIf
If GUICtrlRead($Checkbox2) == $GUI_CHECKED Then
ControlSend($handle, "", "", $skillInput2, 0)
Sleep($castInput2)
EndIf
If GUICtrlRead($Checkbox3) == $GUI_CHECKED Then
ControlSend($handle, "", "", $skillInput3, 0)
Sleep($castInput3)
EndIf
If GUICtrlRead($Checkbox4) == $GUI_CHECKED Then
ControlSend($handle, "", "", $skillInput4, 0)
Sleep($castInput4)
EndIf
If GUICtrlRead($Checkbox5) == $GUI_CHECKED Then
ControlSend($handle, "", "", $skillInput5, 0)
Sleep($castInput5)
EndIf
If GUICtrlRead($Checkbox6) == $GUI_CHECKED Then
ControlSend($handle, "", "", $skillInput6, 0)
Sleep($castInput6)
EndIf
If GUICtrlRead($Checkbox7) == $GUI_CHECKED Then
ControlSend($handle, "", "", $skillInput7, 0)
Sleep($castInput7)
EndIf
If GUICtrlRead($Checkbox8) == $GUI_CHECKED Then
ControlSend($handle, "", "", $skillInput8, 0)
Sleep($castInput8)
EndIf
If GUICtrlRead($Checkbox9) == $GUI_CHECKED Then
ControlSend($handle, "", "", $skillInput9, 0)
Sleep($castInput9)
EndIf
If GUICtrlRead($Checkbox10) == $GUI_CHECKED Then
ControlSend($handle, "", "", $skillInput10, 0)
Sleep($castInput10)
EndIf
; bar 2
If GUICtrlRead($Checkbox11) == $GUI_CHECKED Then
Send("{SHIFTDOWN}")
Sleep(50)
ControlSend($handle, "", "", $skillInput11, 0)
Sleep($castInput11)
Send("{SHIFTUP}")
Sleep(100)
EndIf
If GUICtrlRead($Checkbox12) == $GUI_CHECKED Then
Send("{SHIFTDOWN}")
Sleep(50)
ControlSend($handle, "", "", $skillInput12, 0)
Sleep($castInput12)
Send("{SHIFTUP}")
Sleep(100)
EndIf
If GUICtrlRead($Checkbox13) == $GUI_CHECKED Then
Send("{SHIFTDOWN}")
Sleep(50)
ControlSend($handle, "", "", $skillInput13, 0)
Sleep($castInput13)
Send("{SHIFTUP}")
Sleep(100)
EndIf
If GUICtrlRead($Checkbox14) == $GUI_CHECKED Then
Send("{SHIFTDOWN}")
Sleep(50)
ControlSend($handle, "", "", $skillInput14, 0)
Sleep($castInput14)
Send("{SHIFTUP}")
Sleep(100)
EndIf
If GUICtrlRead($Checkbox15) == $GUI_CHECKED Then
Send("{SHIFTDOWN}")
Sleep(50)
ControlSend($handle, "", "", $skillInput15, 0)
Sleep($castInput15)
Send("{SHIFTUP}")
Sleep(100)
EndIf
If GUICtrlRead($Checkbox16) == $GUI_CHECKED Then
Send("{SHIFTDOWN}")
Sleep(50)
ControlSend($handle, "", "", $skillInput16, 0)
Sleep($castInput16)
Send("{SHIFTUP}")
Sleep(100)
EndIf
If GUICtrlRead($Checkbox17) == $GUI_CHECKED Then
Send("{SHIFTDOWN}")
Sleep(50)
ControlSend($handle, "", "", $skillInput17, 0)
Sleep($castInput17)
Send("{SHIFTUP}")
Sleep(100)
EndIf
If GUICtrlRead($Checkbox18) == $GUI_CHECKED Then
Send("{SHIFTDOWN}")
Sleep(50)
ControlSend($handle, "", "", $skillInput18, 0)
Sleep($castInput18)
Send("{SHIFTUP}")
Sleep(100)
EndIf
If GUICtrlRead($Checkbox19) == $GUI_CHECKED Then
Send("{SHIFTDOWN}")
Sleep(50)
ControlSend($handle, "", "", $skillInput19, 0)
Sleep($castInput19)
Send("{SHIFTUP}")
Sleep(100)
EndIf
If GUICtrlRead($Checkbox20) == $GUI_CHECKED Then
Send("{SHIFTDOWN}")
Sleep(50)
ControlSend($handle, "", "", $skillInput20, 0)
Sleep($castInput20)
Send("{SHIFTUP}")
Sleep(100)
EndIf
EndIf
WEnd
EndFunc
|
|
|
12/18/2013, 22:19
|
#2
|
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
|
Before you continue developing you should learn the basics about arrays.
It would shorten your code by far.
|
|
|
12/18/2013, 22:47
|
#3
|
elite*gold: 0
Join Date: Sep 2010
Posts: 473
Received Thanks: 104
|
But i hate arrays so much especially in Autoit its so confusing ;(
|
|
|
12/18/2013, 23:06
|
#4
|
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
|
Handling with arrays makes everything so much easier. Just try to learn how they work after some time you can't solve problems without them.
An example: If you want to set the data of 100 labels you will do it so
Code:
GUICtrlSetData($Label1, "1")
GUICtrlSetData($Label2, "1")
;...
and then you have 100 lines of code but you could solve it like this
Code:
For $i = 0 To UBound($aLabels) - 1
GUICtrlSetData($aLabels[$i], "1")
Next
3 lines against 100 lines, what do you think is better?
|
|
|
12/18/2013, 23:35
|
#5
|
elite*gold: 0
Join Date: Sep 2010
Posts: 473
Received Thanks: 104
|
Oh i see its a only few lines of code and i know is better but i cant find good examples or tutorials to practice with so im now on start
Can you give me maybe a example with my script or some good tutorial ?
|
|
|
12/19/2013, 01:14
|
#6
|
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
|
Quote:
Originally Posted by mlukac89
Oh i see its a only few lines of code and i know is better but i cant find good examples or tutorials to practice with so im now on start
Can you give me maybe a example with my script or some good tutorial ?
|
here's an example of array usage with your script...
Code:
Global $DEBUG = True
Global $label[6], $macroArray[2][10][4] ; [line][index][keyInput,checkbox,timeInput,timer]
Global $run, $buttonText[2]=['Start','Stop'], $handle, $keys[10]=[3,4,5,6,7,8,9,0,'ß',"´´"], $labelFont[6]=[400,400,800,400,400,400]
GUICreate("Macro", 602, 290, Default, Default, 0x108E0000)
GUICtrlCreateGroup('', 8, 2, 585, 190)
GUICtrlCreateGroup('', 8, 193, 585, 41)
GUICtrlCreateGroup('', 104, 11, 481, 86)
GUICtrlCreateGroup('', 105, 97, 481, 86)
For $line=0 To 1
$label[$line] = GUICtrlCreateLabel("Bar No", 120, 32+$line*86, 46, 18)
GUICtrlCreateCombo("", 121, 54+$line*86, 41, 25)
GUICtrlSetData(-1, "1|2|3|4")
For $i=0 To 9
$macroArray[$line][$i][0] = GUICtrlCreateInput($keys[$i], 208+$i*38, 31+$line*86, 17, 17)
$macroArray[$line][$i][1] = GUICtrlCreateCheckbox('', 210+$i*38, 51+$line*86, 17, 17)
$macroArray[$line][$i][2] = GUICtrlCreateInput(1000, 200+$i*38, 72+$line*86, 33, 17)
Next
Next
$label[2] = GUICtrlCreateLabel("SKILLS", 16, 14, 53, 18)
$label[3] = GUICtrlCreateLabel("Hotkey", 24, 56, 48, 18)
$label[4] = GUICtrlCreateLabel("CTRL + X", 24, 72, 60, 18)
$label[5] = GUICtrlCreateLabel("Cast time", 20, 208, 64, 18)
For $i=0 To 5
GUICtrlSetFont($label[$i], 9, $labelFont[$i], 0, "Verdana")
Next
$saveBtn = GUICtrlCreateButton("Save", 520, 240, 75, 25)
$startBtn = GUICtrlCreateButton("Start", 8, 240, 75, 25)
$hSlider = GUICtrlCreateSlider(96, 208, 494, 20)
While True
Switch GUIGetMsg()
Case -3
Exit
Case $startBtn
$run = Not $run
GUICtrlSetData($startBtn, $buttonText[$run])
$handle = WinGetHandle("Archlord")
If $handle = '' Then
TrayTip('AL-Macro', 'You need to run Archlord first', 1)
Else
TrayTip('AL-Macro', 'Running...', 5000, 1)
EndIf
EndSwitch
If $run Then
For $i=0 To 9
If GUICtrlRead($macroArray[0][$i][1])=1 And TimerDiff($macroArray[0][$i][3])>=GUICtrlRead($macroArray[0][$i][2]) Then
MySend(GUICtrlRead($macroArray[0][$i][0]))
$macroArray[0][$i][3]=TimerInit()
EndIf
If GUICtrlRead($macroArray[1][$i][1])=1 And TimerDiff($macroArray[1][$i][3])>=GUICtrlRead($macroArray[1][$i][2]) Then
MySend('+'&GUICtrlRead($macroArray[1][$i][0]))
$macroArray[1][$i][3]=TimerInit()
EndIf
Next
EndIf
WEnd
Func MySend($content)
If $DEBUG Then Return ConsoleWrite($content&@CRLF)
Return ControlSend($handle, '', '', $content, 0)
EndFunc
you should allways keep in mind:
less code -> lower chance of making mistakes
|
|
|
12/19/2013, 02:09
|
#7
|
elite*gold: 0
Join Date: Sep 2010
Posts: 473
Received Thanks: 104
|
Thank for this i will now practice a bit with that ;D
|
|
|
12/19/2013, 10:39
|
#8
|
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
|
If you use arrays then you can put the control handles inside these indexes which shorten your code by far and makes them more readable.
An quick example
Code:
$aLabels[10] = [GUICtrlCreateLabel(), GUICtrlCreateLabel(), GUICtrlCreateLabel(), GUICtrlCreateLabel(), GUICtrlCreateLabel(), GUICtrlCreateLabel(), GUICtrlCreateLabel(), GUICtrlCreateLabel(), GUICtrlCreateLabel(), GUICtrlCreateLabel()]
For $i = 0 To UBound($aLabels) - 1
GUICtrlSetData($aLabels[$i], ...)
Next
and the methode you used
Code:
$h1 = GUICtrlCreateLabel()
$h2 = GUICtrlCreateLabel()
$h3 = GUICtrlCreateLabel()
$h4 = GUICtrlCreateLabel()
$h5 = GUICtrlCreateLabel()
$h6 = GUICtrlCreateLabel()
$h7 = GUICtrlCreateLabel()
$h8 = GUICtrlCreateLabel()
$h9 = GUICtrlCreateLabel()
$h10 = GUICtrlCreateLabel()
GUICtrlSetData($h1, ...)
GUICtrlSetData($h2, ...)
GUICtrlSetData($h3, ...)
GUICtrlSetData($h4, ...)
GUICtrlSetData($h5, ...)
GUICtrlSetData($h6, ...)
GUICtrlSetData($h7, ...)
GUICtrlSetData($h8, ...)
GUICtrlSetData($h9, ...)
GUICtrlSetData($h10, ...)
Arrays just contain multiple variable which makes the handling with controls much easier.
|
|
|
12/19/2013, 14:29
|
#9
|
elite*gold: 0
Join Date: Sep 2010
Posts: 473
Received Thanks: 104
|
example this piece of code from lolkop
Code:
$label[2] = GUICtrlCreateLabel("SKILLS", 16, 14, 53, 18)
$label[3] = GUICtrlCreateLabel("Hotkey", 24, 56, 48, 18)
$label[4] = GUICtrlCreateLabel("CTRL + X", 24, 72, 60, 18)
$label[5] = GUICtrlCreateLabel("Cast time", 20, 208, 64, 18)
For $i=0 To 5
GUICtrlSetFont($label[$i], 9, $labelFont[$i], 0, "Verdana")
Next
some things dont need to be in array like this labels because u dont need to use it anywhere
|
|
|
12/19/2013, 15:47
|
#10
|
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
|
That's right, but it was just an example how you can do it.
Of course you can store more than useless labels.
|
|
|
12/19/2013, 19:23
|
#11
|
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
|
Quote:
Originally Posted by mlukac89
example this piece of code from lolkop
Code:
$label[2] = GUICtrlCreateLabel("SKILLS", 16, 14, 53, 18)
$label[3] = GUICtrlCreateLabel("Hotkey", 24, 56, 48, 18)
$label[4] = GUICtrlCreateLabel("CTRL + X", 24, 72, 60, 18)
$label[5] = GUICtrlCreateLabel("Cast time", 20, 208, 64, 18)
For $i=0 To 5
GUICtrlSetFont($label[$i], 9, $labelFont[$i], 0, "Verdana")
Next
some things dont need to be in array like this labels because u dont need to use it anywhere
|
if u're using one and the same function on more than one variable (in this case SetFont), it's allways usefull to use arrays...
you can change all fonts in 3lines of code... no matter how many labels exist... even for those 4 lines (in total 6), you'd need 4(6) lines to set the fonts, which makes the array usefull for you
Edit:
once you're tryin to handle unknown numbers of variables, you will have to use arrays anyways.
|
|
|
12/20/2013, 18:17
|
#12
|
elite*gold: 0
Join Date: Sep 2010
Posts: 473
Received Thanks: 104
|
Oh i see but i have problem with script you made i put out timer init and timer diff because its not work good i also tried like this, because in game on skill it say example 6 seconds but more cooldown you have like 80% then its cooldown like 1-2
And for cast time too on skill say 2,1 second and i put 2100 but its skip alot, it send keys like 100 ms and it depends of cast time you have 99%
So i need to control cast with slider cast time of skill 2,1 sec + slider = slider on max fire faster, slider on lower fire slower
Code:
If $run Then
For $i=0 To 9
If GUICtrlRead($macroArray[0][$i][1])=1 And GUICtrlRead($macroArray[0][$i][2]) Then
MySend(GUICtrlRead($macroArray[0][$i][0]))
EndIf
If GUICtrlRead($macroArray[1][$i][1])=1 And GUICtrlRead($macroArray[1][$i][2]) Then
MySend('+'&GUICtrlRead($macroArray[1][$i][0]))
EndIf
Next
EndIf
And on the end it need to be something like this :
cast time on skill 2,1 second - + with slider
+ cooldown time from skill 6 sec - + my cooldown 1-80%
skill picture
stats picture
So fire if checked skill bar 1 = 3,4,5,6,7,8,9,0,ß,´´
Fire if checked skill bar 2 = 3,4,5,6,7,8,9,0,ß,´´
wait for cooldown of skill and fire again
|
|
|
12/20/2013, 19:15
|
#13
|
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,147
|
You're using a stupid "system". Just use the highest available time and keep in mind that you have to add a small buffer. The game needs time to recognize the input. You should use something about "23000" ms.
|
|
|
12/20/2013, 20:19
|
#14
|
elite*gold: 0
Join Date: Sep 2010
Posts: 473
Received Thanks: 104
|
Why this system is stupid ? I just need to adjust cast time 99% with skill cast time 6 or 5 or 9 seconds ...
But i think you dont understand what i need. If you have for example 50% cast time you need 10 seconds or more to fire 10 skill, but if you have 99% cast or more you need 3-4 second to fire 10 skills, and second problem is skipping skills, it fire like 4,5,7,9,ß but not
3,4,5,6,7,8,9,0,ß,´´
|
|
|
12/20/2013, 23:28
|
#15
|
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,147
|
You want to create a bot for Archlord. It's one of thousand MMORPGs and I'm pretty sure that the basics are the same. That means that you can learn new skills with various effects at higher levels. All skills are having different parameters (Cast Time, Cooldown Time, Duration, Range). There is no way that you can put all skills together. Your slider is simply useless.
Maybe you can equip some gear which will affect all of your skills. You will need far more than a simple slider in that case. Just calculate the time needed by yourself and set up your settings.
|
|
|
|
|
Similar Threads
|
Slider mit JavaScript bauen
06/16/2013 - Web Development - 2 Replies
Hallo zusammen,
ich habe vor, meiner Games-Webseite einen komplett neuen Look zu verpassen.
Dabei habe ich an eine etwas dynamischere Webseite gedacht. Ich arbeite momentan daran, einen Slider zu bauen. Im Internet habe ich schon einige Slider gefunden, wie zum Beispiel den hier:
jQuery-Slider kostenlos downloaden | Webentwickler Blog
Jedoch sind mir die alle zu einfach. :cool:
Wie kann ich denn so etwas komplett selbst nachbauen und dann später noch erweitern?
|
Help with slider
10/08/2012 - AutoIt - 2 Replies
Ehy i need help to write a script with slider and if i move slider i write in memory the byte(read of slider) how i can?
$PROCESS2 = _MEMORYOPEN(ProcessExists("process"))
$Addres = 0x0000001
$read = GUICtrlRead($Slider1)
_MemoryAsmWrite(Number($Addres), "BYTE" & $read,"DWORD",$PROCESS2 )
i trie to do a simple function but dont work...
|
problem mit slider
09/16/2012 - AutoIt - 1 Replies
versuche derzeit in einem kleinen musikplayer über einen slider zu bestimmten stellen im lied zu springen (geht ja mit soundseek in autoit)
allerdings stehe ich vor folgendem problem:
Local $hLenght = _SoundLength ($hFile, 2)
Local $hPosition = _SoundPos ($hFile, 2)
Local $hPosition2 = _SoundPos ($hFile, 1)
$soundstate = _soundstatus($hfile)
if not @error Then
Local $SoundLenght = $hLenght / 1000
Local $SoundPosition = $hPosition / 1000
|
Per Slider Musikstelle ändern
11/22/2011 - AutoIt - 2 Replies
Hallo liebe Community,
ich habe mal wieder ein Problem:
Ich habe mir ein kleines GUI gebastelt mit dem ich .mp3 dateien abspielen kann.
Nun habe ich einen Slider eingebaut um den aktuellen Soundstatus abzufragen. Nur weis ich jetzt nicht so genau wie ich per Slider zur gewünschten stelle im Song switchen kann. Hier sind ein paar Auszüge:
Global $h_sound
Global $max_sec
$Slider2 = GUICtrlCreateSlider(0, 108, 300, 25)
GUICtrlSetData($Slider2,0)
|
[Homepage] Images Slider
04/12/2011 - Flyff Private Server - 4 Replies
Willkommen auf meinem ersten richtigen Tut.
Hier wird genau erklärt wie ihr einen "Slider" in eurer Homepage einbaut.
Das ist eine Box wo Bidler gezeigt werden. (Je 10 Sekunden wechseln sie sich.)
Das gibt es auch in der Elitepvpers Startseite.
Viel spass!
1. Neue Javasript Datei namens "slider.js" erstellen
2. Js Datei öffnen und folgendes reinschreiben
$(".image_reel").css({'width' : imageReelWidth});
|
All times are GMT +2. The time now is 18:05.
|
|