;Global Variables Global $iType1[2] = ["215","215"] ;Item Type Global $iArm[2] = ["215","290"] ;Sub Item Select Armor Global $iType2[2] = ["215","235"] ;Item Sub Type Global $i2hand[2] = ["215","250"] ;Sub Item two-hand Global $sArrow1[2] = ["185","330"] ;Stats Arrow 1 Global $sArrow2[2] = ["185","350"] ;Stats Arrow 2 Global $sArrow3[2] = ["185","375"] ;Stats Arrow 3 Global $pLeft[2] = ["180","420"] ;Price Left Global $pRight[2] = ["180", "500"] ;Price Right Global $bTop[2] = ["650","150"] ;Buyout Top Global $bBottom[2] = ["650","485"] ;Buyout Bottom Global $bConfirm[2] = ["330","400"] ;Buyout Confirm Global $tItem[2] = ["650","175"] ;Top Item in Q Global $sValueL1[2] = ["200","325"] ;Stats Value Left 1 Global $sValueR1[2] = ["225","325"] ;Stats Value Right 1 Global $sValueL2[2] = ["200","350"] ;Stats Value Left 2 Global $sValueR2[2] = ["225","350"] ;Stats Value Right 2 Global $sValueL3[2] = ["200","375"] ;Stats Value Left 3 Global $sValueR3[2] = ["225","375"] ;State Value Right 3 ;_______LAG VARIABLES______________________________________________________________________ $LagValue = 1 ;Value used to slow down Search Function (1 = Fast Search, 2 = Med, 3 = Slow) $sleepSmallFast = 20 $sleepSmallMed = 500 $sleepSmallSlow = 800 $sleepMedFast = 40 $sleepMedMed = 800 $sleepMedSlow = 1200 $sleepLargeFast = 60 $sleepLargeMed = 1000 $sleepLargeSlow = 1600 ;_______END_______LAG VARIABLES____________________________________________________________ ;_______STAT VARIABLES______________________________________________________________________ Global $statLocation = 1 ;1=Top 2=Middle 3=Bottom Global $statValue = 1 statValueChangeShort() ;-------------------------------------------------------------------------------------------------------------- ;-------- START ---------------- Mouse Functions, Moves and Clicks -------------------------------------------- ;Moves mouse to location and click ;Parameter: Array with X and Y Values Func MoveClick($array) MouseMove($array[0], $array[1], 1) sleep(GetLagValSmall()) MouseClick("LEFT") EndFunc ;Moves mouse to a location ;Parameter: Array with X and Y Values Func Move($array) MouseMove($array[0], $array[1], 1) EndFunc ;-------- TERMINATE ---------------- Mouse Functions, Moves and Clicks -------------------------------------------- ;-------------------------------------------------------------------------------------------------------------- ;============================================================================================================== ;======== START ================ STAT Locations, Positions, Values ============================================ ;Stats Value Change Selection ;Parameters: Value=Value for Stat, Location=Location to put number... 1=top 2=middle 3=bottom Func statValueChangeSelect($Value,$Location) Local $statLocArray = statLocationSelect($Location) ;statLocationSelect returns a n=4 array, Split the Left(x,y) Right(x,y) as follows: Local $leftArray[2] = [$statLocArray[0], $statLocArray[1]] Local $rightArray[2] = [$statLocArray[2], $statLocArray[3]] MSG($leftArray[0]) Move($leftArray) ;Move mouse to left side of stats box Sleep(GetLagValSmall()) MouseDown("LEFT") ;Click Mouse Sleep(GetLagValSmall()) Move($rightArray) ;Move mouse to right side of stats box (This Highlights the number in box) Sleep(GetLagValSmall()) MouseUp("LEFT") ;Let off of the mouse button Sleep(GetLagValSmall()) Send($Value) ;Type the Value in the stats box EndFunc ;Stats Value Change Selection ;Unlike 'statValueChangeSelect' this "Short" uses the global settings for statValue and statLocation Func statValueChangeShort() Local $statLocArray = statLocationSelect($statLocation) ;statLocationSelect returns a n=4 array, Split the Left(x,y) Right(x,y) as follows: Local $leftArray[2] = [$statLocArray[0], $statLocArray[1]] Local $rightArray[2] = [$statLocArray[2], $statLocArray[3]] MSG($leftArray[0]) Move($leftArray) ;Move mouse to left side of stats box Sleep(GetLagValSmall()) MouseDown("LEFT") ;Click Mouse Sleep(GetLagValSmall()) Move($rightArray) ;Move mouse to right side of stats box (This Highlights the number in box) Sleep(GetLagValSmall()) MouseUp("LEFT") ;Let off of the mouse button Sleep(GetLagValSmall()) Send(getStatValue()) ;Type the Value in the stats box EndFunc ;Uses a parameter to declare Global Stats Value ;Return the value of the new Global stats value Func statValueSelect($chooseStatValue) $statValue = $chooseStatValue Return $statValue; Same as getStatValue() EndFunc ;Stats Value for input (Default= 5) (This prevents a faulted buy) Counts Up ;Linked to HotKey: "^=" Ctrl= Func statValueUP() $statValue += 1 EndFunc ;Stats Value for input (Default= 5) (This prevents a faulted buy) Counts down ;Linked to HotKey: "^-" Ctrl- Func statValueDOWN() $statValue -= 1 EndFunc ;Returns the Global Stats Value (This debugged ValueChange) Func getStatValue() Return $statValue EndFunc ;Return Array with Left and Right Value Locations ["LEFT x", "LEFT y", "RIGHT x", "LEFT y"] ;BASED ON A SELECTED CODED VARIABLE \/ Func statLocationSelect($chooseStatLocation) Local $statLocArray[4] = ["LEFT x", "LEFT y", "RIGHT x", "LEFT y"] Switch $chooseStatLocation Case 0 Local $statLocArray[4] = [$sValueL1[0], $sValueL1[1], $sValueR1[0], $sValueR1[1]] Case 1 ;Same as when it's 0 Local $statLocArray[4] = [$sValueL1[0], $sValueL1[1], $sValueR1[0], $sValueR1[1]] Case 2 Local $statLocArray[4] = [$sValueL2[0], $sValueL2[1], $sValueR2[0], $sValueR2[1]] Case 3 Local $statLocArray[4] = [$sValueL3[0], $sValueL3[1], $sValueR3[0], $sValueR3[1]] Case Else Local $statLocArray[4] = [0,0,0,0] EndSwitch Return $statLocArray EndFunc ;Get Stat Location Variable ;Return Array with Left and Right Value Locations ;BASED ON THE GLOBAL LOCATION VARIABLE Func statLocationShort() Local $statLocVal = getStatLocation() Local $statLocArray[4] = ["LEFT x", "LEFT y", "RIGHT x", "LEFT y"] Switch $statLocVal Case 0 Local $statLocArray[4] = [$sValueL1[0], $sValueL1[1], $sValueR1[0], $sValueR1[1]] Case 1 ;Same as when it's 0 Local $statLocArray[4] = [$sValueL1[0], $sValueL1[1], $sValueR1[0], $sValueR1[1]] Case 2 Local $statLocArray[4] = [$sValueL2[0], $sValueL2[1], $sValueR2[0], $sValueR2[1]] Case 3 Local $statLocArray[4] = [$sValueL3[0], $sValueL3[1], $sValueR3[0], $sValueR3[1]] Case Else Local $statLocArray[4] = [0,0,0,0] EndSwitch Return $statLocArray EndFunc ;Return Stats Location Variable (1-3) Func getStatLocation() Return $statLocation EndFunc ;========= TERMINATE ============== STAT Locations, Positions, Values ========================================= ;============================================================================================================== ;-------------------------------------------------------------------------------------------------------------- ;--------- START -------------- Lag Controllers, Returns and functions ---------------------------------------- ;-------------------------------------------------------------------------------------------------------------- ;Function Lag: Returns an Array with Sleep Values Small/Med/Large ;Parameter: $LagLocal a Declared Value (Default:1) decides Latency ;$LagLocal = 1(Fast) 2(Medium) 3(Slow) ;AH Search Function Doesn't Finish before loading new Stats, increase $LagLocal Func Lag($LagLocal) Local $LagArray[3] = ["9999","9999","9999"] Switch $LagLocal Case 1 $LagArray[0] = $sleepSmallFast $LagArray[1] = $sleepSmallMed $LagArray[2] = $sleepSmallSlow Case 2 $LagArray[0] = $sleepMedFast $LagArray[1] = $sleepMedMed $LagArray[2] = $sleepMedSlow Case 3 $LagArray[0] = $sleepLargeFast $LagArray[1] = $sleepLargeMed $LagArray[2] = $sleepLargeSlow EndSwitch Return $LagArray EndFunc ;Return the Larger of the sleep values for lag (800,1200,1600) Func GetLagValLarge() Local $LagLarge = Lag($LagValue) Return $LagLarge[2] EndFunc ;Return the Medium sleep values for lag (500,800,1000) Func GetLagValMedium() Local $LagMed = Lag($LagValue) Return $LagMed[1] EndFunc ;Return the Smallest of the sleep values for lag (20,40,60) Func GetLagValSmall() Local $LagSmall = Lag($LagValue) Return $LagSmall[0] EndFunc ;Increases the Global LagValue (Making Sleep Times longer between 1-3) ;Returns the New Global Lag Value Func LagValueUp() If $LagValue = 3 Then Else $LagValue += 1 EndIf Return $LagValue EndFunc ;Decreases the Global LagValue (Making Sleep Times Shorter between 1-3) ;Returns the New Global Lag Value Func LagValueDown() If $LagValue = 1 Then Else $LagValue -= 1 EndIf Return $LagValue EndFunc ;Returns the Global Lag Value Func GetLagValue() Return $LagValue EndFunc ;-------------------------------------------------------------------------------------------------------------- ;----------- TERMINATE ------------ Lag Controllers, Returns and functions ------------------------------------ ;-------------------------------------------------------------------------------------------------------------- ;Msg: Calls MsgBox to simplify debugging through output Func Msg($Message) MsgBox("","",$Message) EndFunc