|
The problem isnt finding the location of a pixel for both start and begin buttons, the problem is that the color of the pixel changes from one button to the other.
I added a variable for the begin button and the repeat button in this script, and added a mouse click command directly after the check. It works pretty well, but I am not sure if this configuration of commands is skipping one of the event checks.
#comments-start
Crafting Script by Nuad, Version Date: 07.12.04
This Script includes a Mana Check (pause begins when mana is below 50% and ends when char is
FM again)
which makes it possible to let the script run unattended.
If you wan't to stop the crafting process earlier set $StopEarlier to 1.
This is an ongoing work. To-do List:
- Script reacting on evens
- walking, buying, selling
Please feel free to rewrite/improve this script.
#comments-end
; User needs to update these values accordingly
;
$eq = "EverQuest II (Dec 3 2004 14:00:34) USER OPTIMIZED: SOEBuild=1554T"
$mX = 1651 ; Mouse X coordinate for the Begin/Repeat button
$mY = 1043 ; Mouse Y coordinate for the Begin/Repeat button
$mA = 1659 ; Mouse X for Stop Earlier Check Part 1
$mB = 792 ; Mouse Y for Stop Earlier Check Part 1
$mC = 1818 ; Mouse X for Stop Button
$mD = 1041 ; Mouse Y for Stop Button
$mE = 86 ; Mouse X for Mana full
$mF = 59 ; Mouse Y for Mana full
$mG = 72 ; Mouse X for Mana 50%
$mH = 57 ; Mouse Y for Mana 50%
$mI = 1226 ; Mouse X for Eventcheck
$mJ = 799 ; Mouse Y for Eventcheck
$mK = 1805 ; Mouse X for Stop Earlier Check Part 2
$mL = 792 ; Mouse Y for Stop Earlier Check Part 2
$mBegin = 7621905 ; Begin Button Color
$mEarlier = 4803219 ; Stop earlier Color Part 1
$mEarly = 4737424 ; Stop earlier Color Part 2
$mFM = 7103478 ; Full Mana Color
$mOOM = 54 ; 50% Mana Color
$mEvent = 2302496 ; Event Check Color
$mm = 7621136 ; repeat button color
$StopEarlier = 0 ; Set Variable to 1 if you wish to stop when 'bland' is produced, else to
0.
$stacks = 200 ; Number of complete products you have the ingredients for
; Make EQ2 Window Active
WinActivate($eq)
; Loop x times based on number of ingredients
MouseClick("left", $mX, $mY) ; Click begin
Sleep(1500 + Random(100))
Send("1") ; Ability 1
Sleep(550 + Random(25))
Send("2") ; Ability 2
Sleep(550 + Random(25))
Send("3") ; Ability 3
Sleep(550 + Random(25))
Sleep(2000 + Random(100))
For $count = 1 to $stacks
MouseClick("left", $mX, $mY) ; Click begin
For $count2 = 1 to 15
If (Call("crafted") = 1) Then ExitLoop 1
; Call Earler Check 1/2
If ($StopEarlier = 1) And (Call("Earlier") = 1) Then ExitLoop 1
Send("1") ; Ability 1
Sleep(550 + Random(25))
Send("2") ; Ability 2
Sleep(550 + Random(25))
Send("3") ; Ability 3
Sleep(550 + Random(25))
If (Call("crafted") = 1) Then ExitLoop 1
Sleep(2000 + Random(100))
Next
MouseClick("left", $mX, $mY) ; Click repeat
Sleep(500 + Random(25))
Next
Send("{ENTER}")
Send("/afk")
Send("{ENTER}")
MsgBox(0, "Done!", "Char is now AFK...",1)
; check if done and if mana is still above 50%
Func crafted()
$done = 0
$color = PixelGetColor($mX, $mY)
If ($color = $mBegin) Then MouseClick("left", $mX, $mY)
If ($color = $mm) Then MouseClick("left", $mX, $mY)
If ($StopEarlier = 1) Then Call("Earlier")
If ($done = 1) and (Call("Mana") = 0) Then Call("Medden")
Return $done
EndFunc
; Meditate
Func Medden()
$MedCallzwo = 0
While (Call("ManaZwo") = 0)
$MedCallzwo = 1
Sleep(2000)
WEnd
EndFunc
; Manacheck
Func Mana()
$FM = 0
$color = PixelGetColor($mG, $mH)
If ($color = $mOOM) Then $FM = 1
Return $FM
EndFunc
Func ManaZwo()
$FMa = 0
$color = PixelGetColor($mE, $mF)
If ($color = $mFM) Then $FMa = 1
Return $FMa
EndFunc
; Stop Earlier check
Func Earlier()
$donea = 0
$color = PixelGetColor($mA, $mB)
$colorb = PixelGetColor($mK, $mL)
If ($color = $mEarlier) And ($colorb = $mEarly) Then
$donea = 1
MouseClick("left", $mC, $mD) ; Klick Stop
EndIf
Return $donea
EndFunc
|