Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <AutoItConstants.au3>
- HotKeySet("{f9}", "TogglePause")
- ;TODO AT WAKE UP
- ;MERGEDRAG each x seconds
- ;Equip gold [x]
- ;Equip bars
- ;Stay in adventuyre mode until highest boss killed [x]
- ;Drop down to farm zone [NOT NOW]
- ;Inventory 61,2,3,4,5,6,7,8 for equipedItems
- ;Tooltip to know which run we are at
- ;------------ CONSTANTS ---------------------------------;
- Local $SLEEP_DELAY = 50
- Local $MOUSE_SPEED = 1
- Local $pause = True
- ;Items
- Local $InventoryPositions[60]
- Local $Equipment[20]
- Local $EquipmentCount = 0
- Local $MAGIC_TYPE = 0
- Local $ENERGY_TYPE = 1
- Local $PIT_TYPE = 2
- Local $BOOST_TYPE = 3
- Local $MERGE_TYPE = 4
- Local $GOLD_TYPE = 5
- Local $LAST_SWAPPED = -1
- ;Menu Positions
- Local $MenuTrainAttack = 0
- Local $MenuTrainDefense = 1
- Local $MenuFightBoss = 2
- Local $MenuMoneyPit = 3
- Local $MenuAdventure = 4
- Local $MenuInventory = 5
- Local $MenuAugmentation = 6
- Local $MenuAdvTraining = 7
- Local $MenuTimeMachine = 8
- Local $MenuBloodMagic = 9
- Local $MenuWandoos = 10
- Local $MenuNGU = 11
- Local $MenuYgg = 12
- ; Trick to add/remove
- Local $Unassign = -1
- Local $Assign = 1
- ;Run Properties--------
- ;-- Timers
- Local $FightBossTimer = TimerInit()
- Local $ResetTimer = TimerInit()
- Local $BoostAndMergeTimer = TimerInit()
- ;Props
- Local $Initialized = 0
- Local $RunTime = 50000 ; Time each run will take
- Local $FightBossTime = 100000 ; Time between each boss fight
- Local $BoostAndMergeTime = 5000 ; time between each merge/boost attempt
- ;Start features time
- Local $GoldMachineTime = 10000
- Local $AugmentsTime = 310000
- Local $BloodMagicTime = 310000
- ;End features time
- Local $GoldMachineEnd = 30000
- Local $AugmentsEnd = 700000
- Local $BloodMagicEnd = 700000
- ;IgnoreFeatures
- Local $IgnoreTimeMachine = 0
- Local $IgnoreAugments = 0
- Local $IgnoreBloodMagic = 0
- ;--------------------------------------------------------;
- ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
- ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<;
- ; MAINLOOP/ MAINLOOP/ MAINLOOP/ MAINLOOP/ MAINLOOP/ MAINLOOP/
- Setup()
- Rebirth()
- while 1
- if $pause == True Then
- Sleep($SLEEP_DELAY*10)
- ContinueLoop
- EndIf
- if $Initialized == 0 Then
- $ResetTimer = TimerInit()
- $FightBossTimer = TimerInit()
- $BoostAndMergeTimer = TimerInit()
- FightBoss()
- Adventure(7,true)
- $Initialized = 1
- EndIf
- ; Things that need to be looped every x second
- if TimerDiff($ResetTimer) >= $runTime Then
- SwapItems($PIT_TYPE)
- MoneyPit()
- Rebirth()
- EndIf
- if TimerDiff($FightBossTimer) >= $FightBossTime Then
- FightBoss()
- $FightBossTimer = TimerInit()
- EndIf
- if TimerDiff($BoostAndMergeTimer) >= $BoostAndMergeTime Then
- BoostItems()
- MergeItems()
- $BoostAndMergeTimer = TimerInit()
- EndIf
- if TimerDiff($ResetTimer) >= $runTime - 30000 Then
- FightBoss()
- EndIf
- ; Since i'm not powerful, i'll keep this way for now. Pls change like Anso when we get new gear \o/
- if $IgnoreTimeMachine == 0 Then
- if TimerDiff($ResetTimer) >= $GoldMachineTime then
- GoldMachine($Assign, $Assign)
- EndIf
- if TimerDiff($ResetTimer) >= $GoldMachineEnd then
- GoldMachine($Unassign, $Unassign)
- $IgnoreTimeMachine = 1
- EndIf
- EndIf
- if $IgnoreAugments == 0 Then
- if TimerDiff($ResetTimer) >= $AugmentsTime then
- Augments($Assign, 3, 0)
- EndIf
- if TimerDiff($ResetTimer) >= $AugmentsEnd then
- ;Augments($Unassign, 0, 0)
- $IgnoreAugments = 1
- EndIf
- EndIf
- if $IgnoreBloodMagic == 0 Then
- if TimerDiff($ResetTimer) >= $BloodMagicTime then
- BloodMagic($Assign, 0)
- EndIf
- if TimerDiff($ResetTimer) >= $BloodMagicEnd then
- ;BloodMagic($Unassign, 0, 0)
- $IgnoreBloodMagic = 1
- EndIf
- EndIf
- WEnd
- ;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^;
- ; MAINLOOP/ MAINLOOP/ MAINLOOP/ MAINLOOP/ MAINLOOP/ MAINLOOP/
- ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
- ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<;
- ;--------------------------------------------------------;
- Func _goToMenu( $indexMenu )
- if $indexMenu >=0 AND $indexMenu <=12 Then
- ; 500 / 350 / 380 / 410
- Local $incrementY = 30;
- Local $startY = 350;
- Click($MOUSE_CLICK_LEFT,500, $startY + ($indexMenu * $incrementY ), 5 )
- Else
- Return
- EndIf
- EndFunc
- ;------------------- INVENTORY -------------------------;
- Func SetupInventoryPosition()
- ;660 / 660
- $startPosition = 660
- $currentPosition = 0
- For $r = 0 To 4 Step 1
- For $c = 0 To 11 Step 1
- local $posToShip = [$startPosition+($c*50), $startPosition+($r*50)]
- $InventoryPositions[$currentPosition] = $posToShip
- $currentPosition+=1
- Next
- Next
- EndFunc
- Func CreateItem($type, $invPosition, $slotPosition)
- dim $item = [$type, $invPosition, $slotPosition]
- $Equipment[$EquipmentCount] = $item
- $EquipmentCount+=1
- EndFunc
- Func SwapItems($type)
- if( $EquipmentCount <1 ) Then
- Return
- EndIf
- if( $LAST_SWAPPED <> -1 ) Then ; SWAP BACK
- _goToMenu($MenuInventory)
- For $i = 0 To $EquipmentCount - 1 Step 1
- $item = $Equipment[$i]
- if ( $item[0] == $LAST_SWAPPED ) Then
- $pos = $item[1]
- $coord = $InventoryPositions[$pos]
- $index = $item[2]
- Sleep($SLEEP_DELAY)
- Send("{" & $index & " down}")
- Sleep($SLEEP_DELAY)
- MouseClick($MOUSE_CLICK_RIGHT, $coord[0], $coord[1], 1, $MOUSE_SPEED)
- Sleep($SLEEP_DELAY)
- Send("{" & $index & " up}")
- Sleep($SLEEP_DELAY)
- EndIf
- Next
- EndIf
- _goToMenu($MenuInventory)
- For $i = 0 To $EquipmentCount - 1 Step 1
- $item = $Equipment[$i]
- if ( $item[0] == $type ) Then
- $pos = $item[1]
- $coord = $InventoryPositions[$pos]
- $index = $item[2]
- Sleep($SLEEP_DELAY)
- Send("{" & $index & " down}")
- Sleep($SLEEP_DELAY)
- MouseClick($MOUSE_CLICK_RIGHT, $coord[0], $coord[1], 1, $MOUSE_SPEED)
- Sleep($SLEEP_DELAY)
- Send("{" & $index & " up}")
- Sleep($SLEEP_DELAY)
- $LAST_SWAPPED = $type
- EndIf
- Next
- EndFunc
- Func BoostItems()
- if( $EquipmentCount <1 ) Then
- Return
- EndIf
- _goToMenu($MenuInventory)
- For $i = 0 To $EquipmentCount - 1 Step 1
- $item = $Equipment[$i]
- if ( $item[0] == $BOOST_TYPE ) Then
- $pos = $item[1]
- $coord = $InventoryPositions[$pos]
- $index = $item[2]
- Sleep($SLEEP_DELAY)
- Send("{a down}")
- Sleep($SLEEP_DELAY)
- MouseClick($MOUSE_CLICK_LEFT, $coord[0], $coord[1], 1, $MOUSE_SPEED)
- Sleep($SLEEP_DELAY)
- Send("{a up}")
- Sleep($SLEEP_DELAY)
- EndIf
- Next
- EndFunc
- Func MergeItems()
- if( $EquipmentCount <1 ) Then
- Return
- EndIf
- For $i = 0 To $EquipmentCount - 1 Step 1
- $item = $Equipment[$i]
- if ( $item[0] == $MERGE_TYPE ) Then
- $pos = $item[1]
- $coord = $InventoryPositions[$pos]
- $index = $item[2]
- Sleep($SLEEP_DELAY)
- Send("{d down}")
- Sleep($SLEEP_DELAY)
- MouseClick($MOUSE_CLICK_LEFT, $coord[0], $coord[1], 1, $MOUSE_SPEED)
- Sleep($SLEEP_DELAY)
- Send("{d up}")
- Sleep($SLEEP_DELAY)
- EndIf
- Next
- EndFunc
- ;-------------------- Funcs -----------------------------;
- Func MoneyPit()
- Local $MoneyPitClick = [756,629] ; This is the yes button.
- _goToMenu($MenuMoneyPit)
- Sleep($SLEEP_DELAY)
- MouseClick("left",$MoneyPitClick[0]+50,$MoneyPitClick[1]+50,1,2)
- MouseClick("left",$MoneyPitClick[0]+40,$MoneyPitClick[1]+40,1,2)
- MouseClick("left",$MoneyPitClick[0]+30,$MoneyPitClick[1]+30,1,2)
- MouseClick("left",$MoneyPitClick[0]+20,$MoneyPitClick[1]+20,1,2)
- MouseClick("left",$MoneyPitClick[0]+10,$MoneyPitClick[1]+10,1,2)
- EndFunc
- Func FightBoss()
- local $Nuke = [950,425]
- local $Fight = [950, 525]
- _goToMenu($MenuFightBoss)
- Sleep($SLEEP_DELAY)
- Click($MOUSE_CLICK_LEFT, $Nuke[0], $Nuke[1], 1)
- Sleep($SLEEP_DELAY)
- For $i = 0 To 10 Step 1
- Sleep($SLEEP_DELAY)
- Click($MOUSE_CLICK_LEFT, $Fight[0], $Fight[1], 1)
- Sleep(5*$SLEEP_DELAY)
- Next
- EndFunc
- Func Reset()
- EndFunc
- Func Adventure($count, $inc)
- local $bossFound = false
- SwapItems($GOLD_TYPE)
- _goToMenu($MenuAdventure)
- if($inc == false) Then
- for $i = 0 To 10 Step 1
- Sleep($SLEEP_DELAY)
- Send("{left}")
- Sleep($SLEEP_DELAY)
- Next
- EndIf
- for $i = 0 To $count -1 Step 1
- Sleep($SLEEP_DELAY)
- Send("{right}")
- Sleep($SLEEP_DELAY)
- Next
- Sleep(5000)
- for $i = 908 To 984
- if PixelGetColor($i, 560) <> 0xC0C0C0 Then
- ExitLoop 1
- EndIf
- Next
- Sleep($SLEEP_DELAY)
- Send("{left}")
- Sleep($SLEEP_DELAY)
- ; Highest boss is here probably, wait for the boss to die
- while $bossFound == False
- If(PixelGetColor(1049,733) == 0xFF0000) Then ; Enemy spawned?
- If (PixelGetColor(1041,617) == 0xF7EF29) Then ; Boss here
- $bossFound = true
- Else
- Sleep(100)
- Send("{LEFT}")
- Sleep(100)
- Send("{RIGHT}")
- EndIf
- EndIf
- WEnd
- SwapItems(-1)
- EndFunc
- Func GoldMachine($energy, $magic)
- _goToMenu($MenuTimeMachine)
- Local $GoldPlus = [855,542]
- Local $GoldMinus = [887,542]
- Local $GoldMagicPlus = [855,642]
- Local $GoldMagicMinus = [887,642]
- Switch $energy
- case $Assign
- Click($MOUSE_CLICK_LEFT,$GoldPlus[0],$GoldPlus[1],2)
- case $Unassign
- Click($MOUSE_CLICK_LEFT,$GoldMinus[0],$GoldMinus[1],2)
- EndSwitch
- Switch $magic
- case $Assign
- Click($MOUSE_CLICK_LEFT,$GoldMagicPlus[0],$GoldMagicPlus[1],2)
- case $Unassign
- Click($MOUSE_CLICK_LEFT,$GoldMagicMinus[0],$GoldMagicMinus[1],2)
- EndSwitch
- EndFunc
- Func Augments($do, $where, $upgrade)
- _goToMenu($MenuAugments)
- $y = 0
- if($do == $Unassign) Then
- $y = 890
- Else
- $y = 855
- EndIf
- if $where == 0 Then ; 0 means everything, mostly for unassign part tho
- for $x = 580 To 860 Step 70
- Click($MOUSE_CLICK_LEFT, $x-10, $y, 2)
- Click($MOUSE_CLICK_LEFT, $x+10, $y, 2)
- Next
- Else
- if $upgrade == 1 Then
- Click($MOUSE_CLICK_LEFT, 580+(70*$where)+10, $y, 2)
- Else
- Click($MOUSE_CLICK_LEFT, 580+(70*$where)-10, $y, 2)
- EndIf
- EndIf
- EndFunc
- Func BloodMagic($do, $where)
- _goToMenu($MenuBloodMagic)
- $y = 0
- if($do == $Unassign) Then
- $y = 850
- Else
- $y = 815
- EndIf
- if $where == 0 Then ; 0 means everything, mostly for unassign part tho
- for $x = 535 To 850 Step 45
- Click($MOUSE_CLICK_LEFT, $x, $y, 2)
- Next
- Else
- Click($MOUSE_CLICK_LEFT, 535+(35*$where), $y, 2)
- EndIf
- EndFunc
- Func Rebirth()
- FightBoss()
- Local $RebirthMenu = [413, 719]
- Local $RebirthButton = [815, 830]
- Local $RebirthYes = [756,627]
- SwapItems(-1)
- Click($MOUSE_CLICK_LEFT,$RebirthMenu[0],$RebirthMenu[1],5)
- Click($MOUSE_CLICK_LEFT,$RebirthButton[0],$RebirthButton[1],5)
- Click($MOUSE_CLICK_LEFT,$RebirthYes[0],$RebirthYes[1],5)
- $FightBossTimer = TimerInit()
- $ResetTimer = TimerInit()
- $BoostAndMergeTimer = TimerInit()
- $IgnoreTimeMachine = 0
- $IgnoreAugments = 0
- $IgnoreBloodMagic = 0
- $Initialized = 0
- EndFunc
- Func ColRowToInv($col, $row)
- $x = $col-1
- $y = $row-1
- return $x+$y*12
- EndFunc
- Func Setup()
- SetupInventoryPosition()
- ;pit items
- CreateItem($PIT_TYPE, ColRowToInv(6,2), 1)
- CreateItem($PIT_TYPE, ColRowToInv(11,4), 2)
- CreateItem($PIT_TYPE, ColRowToInv(6,1), 3)
- CreateItem($PIT_TYPE, ColRowToInv(8,2), 0)
- CreateItem($PIT_TYPE, ColRowToInv(9,2), 0)
- CreateItem($PIT_TYPE, ColRowToInv(10,2), 0)
- CreateItem($PIT_TYPE, ColRowToInv(12,2), 0)
- CreateItem($BOOST_TYPE, 17, 1)
- CreateItem($BOOST_TYPE, 36, 2)
- CreateItem($BOOST_TYPE, ColRowToInv(6,1), 3)
- CreateItem($BOOST_TYPE, ColRowToInv(8,2), 0)
- CreateItem($BOOST_TYPE, ColRowToInv(9,2), 0)
- CreateItem($BOOST_TYPE, ColRowToInv(10,2), 0)
- CreateItem($BOOST_TYPE, ColRowToInv(12,2), 0)
- EndFunc
- ;------------------- GLOBAL ----------------------------;
- Func Click($MouseClick, $positionX, $positionY, $amountOfClicks)
- Sleep($SLEEP_DELAY*5)
- MouseClick($MouseClick, $positionX, $positionY, $amountOfClicks, $MOUSE_SPEED)
- EndFunc
- Func TogglePause()
- If($pause == true ) Then
- $pause = False
- Else
- $pause = true
- EndIf
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement