Advertisement
Guest User

Untitled

a guest
Apr 1st, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 23.54 KB | None | 0 0
  1. #include <AutoItConstants.au3>
  2. HotKeySet("{f9}", "TogglePause")
  3. ;TODO AT WAKE UP
  4. ;MERGEDRAG each x seconds
  5. ;Equip gold [x]
  6. ;Stay in adventuyre mode until highest boss killed [x]
  7. ;Drop down to farm zone [NOT NOW]
  8. ;Inventory 61,2,3,4,5,6,7,8 for equipedItems
  9. ;Tooltip to know which run we are at
  10.  
  11. ;------------ CONSTANTS ---------------------------------;
  12. Local $SLEEP_DELAY = 50
  13. Local $MOUSE_SPEED = 1
  14.  
  15. Local $canrb = true
  16. Local $pause = false
  17. Local $rebNumber = 0
  18. ;Items
  19. Local $InventoryPositions[68]
  20. Local $Equipment[200]
  21. Local $EquipmentCount = 0
  22. Local $MAGIC_TYPE = 0
  23. Local $ENERGY_TYPE = 1
  24. Local $PIT_TYPE = 2
  25. Local $BOOST_TYPE = 3
  26. Local $MERGE_TYPE = 4
  27. Local $GOLD_TYPE = 5
  28. Local $MAIN_TYPE = 6
  29. Local $BOSS_TYPE = 7
  30. Local $TRANSFORM_TYPE = 8
  31. Local $SECOND_TYPE = 9
  32. Local $WANDOOS_TYPE = 10
  33. Local $BASE_TYPE = 11
  34. Local $LAST_SWAPPED = -1
  35.  
  36.  
  37.  
  38. Local $swapped = 0
  39. Local $swapped1 = 0
  40. ;Menu Positions
  41. Local $MenuTrainAttack = 0
  42. Local $MenuTrainDefense = 1
  43. Local $MenuFightBoss = 2
  44. Local $MenuMoneyPit = 3
  45. Local $MenuAdventure = 4
  46. Local $MenuInventory = 5
  47. Local $MenuAugmentation = 6
  48. Local $MenuAdvTraining = 7
  49. Local $MenuTimeMachine = 8
  50. Local $MenuBloodMagic = 9
  51. Local $MenuWandoos = 10
  52. Local $MenuNGU = 11
  53. Local $MenuYgg = 12
  54.  
  55. ; Trick to add/remove
  56. Local $Unassign = -1
  57. Local $Assign = 1
  58. ;Run Properties--------
  59. ;-- Timers
  60. Local $FightBossTimer = TimerInit()
  61. Local $ResetTimer = TimerInit()
  62. Local $BoostAndMergeTimer = TimerInit()
  63. Local $updateTimer = TimerInit()
  64.  
  65. ;Props
  66.  
  67.  
  68. ;Start features time
  69.  
  70. Local $AugmentsTime = 300000
  71. Local $BloodMagicTime = 300000
  72.  
  73.  
  74.  
  75. Local $wandoosSwapped = 0
  76.  
  77. ;End features time
  78. Local $GoldMachineEnergyEnd = 300000
  79. Local $GoldMachineMagicEnd = 300000
  80. Local $AugmentsEnd = 880000
  81. Local $BloodMagicEnd = 880000
  82.  
  83. Local $reassignedEnergy = 0
  84. Local $reassignedMagic = 0
  85. ;IgnoreFeatures
  86. Local $IgnoreTimeMachine = 1
  87. Local $IgnoreAugments = 1
  88. Local $IgnoreBloodMagic = 1
  89. Local $bloodReassignCounter = 0
  90. Local $Log[50]
  91. Local $lastLog = 0
  92. Local $maxNGU = 0
  93. Local $NGUFraction = 0
  94.  
  95.  
  96. ;--------------------------------------------------------;
  97. ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
  98. ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<;
  99. ;~ SETTINGS
  100. Local $Initialized = 0
  101. Local $RunTime = 3600000 ; Time each run will take
  102. Local $FightBossTime = 80000 ; Time between each boss fight
  103. Local $BoostAndMergeTime = 90000 ; time between each merge/boost attempt
  104.  
  105. Local $GoldMachineEnergyTime = 720999
  106. Local $GoldMachineMagicTime = 1080999
  107. Local $wandoosTime = 135000
  108. Local $NGUTime = $GoldMachineEnergyTime + 1
  109.  
  110. Local $swapTime = 83000
  111. Local $swapTime1 = 172000
  112.  
  113. Local $AugmentUsed = 2
  114. Local $BloodUsed = 2
  115. Local $NGUClicks =  [9,5,0,8,0,10]
  116.  
  117.  
  118. ;--------------------------------------------------------;
  119. ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
  120. ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<;
  121. ; MAINLOOP/ MAINLOOP/ MAINLOOP/ MAINLOOP/ MAINLOOP/ MAINLOOP/
  122.  
  123.  
  124.  
  125. Setup()
  126. ;~ MoneyPit()
  127.    SwapItems($PIT_TYPE)
  128.    SwapItems($BOSS_TYPE)
  129.    SwapItems($WANDOOS_TYPE)
  130.    SwapItems($SECOND_TYPE)
  131.    SwapItems($MAIN_TYPE)
  132.    SwapItems($BASE_TYPE)
  133.    SwapItems($GOLD_TYPE)
  134. Rebirth()
  135. while 1
  136.     local $srt = ""
  137.     for $i = 0 to $lastLog-1 step 1
  138.        $srt &= $Log[$i]
  139.     Next
  140.     ToolTip("Current time: " & TimerDiff($ResetTimer) &"ms"& @CRLF & "Rebirth: " & $rebNumber & @CRLF & " ______________ " & @CRLF & $srt  , 20, 20, "NGU IDLE AUTO V0.01", 1)
  141.    if $pause == True Then
  142.       Sleep($SLEEP_DELAY*10)
  143.       ContinueLoop
  144.    EndIf
  145.  
  146.    if $Initialized == 0 Then
  147.       ToolTipLog("Initializing...")
  148.       $ResetTimer = TimerInit()
  149.       $FightBossTimer = TimerInit()
  150.       $BoostAndMergeTimer = TimerInit()
  151.       FightBoss()
  152.       Adventure(5,true)
  153.       $Initialized = 1
  154.    EndIf
  155.  
  156.   ; Things that need to be looped every x second
  157.    if TimerDiff($ResetTimer) >= $runTime - 10000  Then
  158.       ToolTipLog("Rebirthing...")
  159.       RemoveCaps()
  160.       send("r")
  161.       sleep(100)
  162.       send("t")
  163.       sleep(100)
  164.       send("r")
  165.       sleep(100)
  166.       send("t")
  167.       sleep(100)
  168.       send("r")
  169.       sleep(100)
  170.       send("t")
  171.       SwapItems($PIT_TYPE)
  172.       MoneyPit()
  173.       SwapItems($PIT_TYPE)
  174.       SwapItems($BOSS_TYPE)
  175.       SwapItems($WANDOOS_TYPE)
  176.       SwapItems($SECOND_TYPE)
  177.       SwapItems($MAIN_TYPE)
  178.       SwapItems($BASE_TYPE)
  179.       SwapItems($GOLD_TYPE)
  180.       Rebirth()
  181.    EndIf
  182.  
  183.    if TimerDiff($FightBossTimer) >= $FightBossTime And TimerDiff($ResetTimer) <= $runTime - 30000 Then
  184.       FightBoss()
  185.       $FightBossTimer = TimerInit()
  186.    EndIf
  187.  
  188.    if TimerDiff($BoostAndMergeTimer) >= $BoostAndMergeTime And TimerDiff($ResetTimer) <= $runTime - 30000 Then
  189.       BoostItems()
  190.       MergeItems()
  191.       $BoostAndMergeTimer = TimerInit()
  192.    EndIf
  193.  
  194.    if TimerDiff($ResetTimer) >= $runTime - 15000 Then
  195.       if $LAST_SWAPPED <> $BOSS_TYPE Then
  196.          RemoveCaps()
  197.          send("r")
  198.          sleep(100)
  199.          send("r")
  200.          send("t")
  201.          sleep(100)
  202.          send("t")
  203.          if( $wandoosTime == 0 ) Then
  204.             SwapItems($WANDOOS_TYPE)
  205.          EndIf
  206.          SwapItems($BOSS_TYPE)
  207.       EndIf
  208.       FightBoss()
  209.    EndIf
  210.  
  211.    if TimerDiff($ResetTimer) >= $swapTime and $swapped == 0 Then
  212.       RemoveCaps()
  213.       send("r")
  214.       sleep(100)
  215.       send("t")
  216.       SwapItems($MAIN_TYPE)
  217.       $swapped = 1
  218.    EndIf
  219.  
  220.    if TimerDiff($ResetTimer) >= $swapTime1 and $swapped1 == 0 Then
  221.       RemoveCaps()
  222.       send("r")
  223.       sleep(100)
  224.       send("t")
  225.       SwapItems($SECOND_TYPE)
  226.       $swapped1 = 1
  227.    EndIf
  228.  
  229.    If TimerDiff($resetTimer) >= $runTime-$wandoosTime And $wandoosSwapped == 0 AND $wandoosTime>0  Then
  230.  
  231.       Sleep($SLEEP_DELAY)
  232.       Send("r");
  233.       Sleep($SLEEP_DELAY)
  234.       Send("r");
  235.       Sleep($SLEEP_DELAY)
  236.       Send("t");
  237.       Sleep($SLEEP_DELAY)
  238.       Send("t");
  239.       Sleep($SLEEP_DELAY)
  240.  
  241.       GoldMachine($Unassign, $Unassign)
  242.       Augments($Unassign, 0, 0)
  243.       BloodMagic($Unassign, 0)
  244.  
  245.  
  246.  
  247.       SwapItems($WANDOOS_TYPE)
  248.       Wandoos(1)
  249.       $wandoosSwapped = 1
  250.    EndIf
  251.  
  252.    if TimerDiff($updateTimer) >= 5000 Then
  253.  
  254.       if TimerDiff($ResetTimer) < $GoldMachineEnergyTime Then
  255.  
  256.          If TimerDiff($resetTimer) <= 25000 AND TimerDiff($resetTimer) >= 12000  Then
  257.             GoldMachine($Unassign, 0)
  258.             Augments($Assign, $AugmentUsed, 0)
  259.          Else
  260.             Augments($Unassign, $AugmentUsed, 0)
  261.             GoldMachine($Assign, 0)
  262.          EndIf
  263.       EndIf
  264.  
  265.       if TimerDiff($ResetTimer) < $GoldMachineMagicTime Then
  266.          GoldMachine(0, $Assign)
  267.       EndIf
  268.  
  269.       if TimerDiff($ResetTimer) >= $GoldMachineEnergyTime and TimerDiff($resetTimer) < $runTime-$wandoosTime then
  270.          If $reassignedEnergy == 0 Then
  271.             ToolTipLog("Reassigned Energy")
  272.             GoldMachine($Unassign, 0)
  273.             NGU(1,true)
  274.             Augments($Assign, $AugmentUsed, 1)
  275.             $reassignedEnergy = 1
  276.          EndIf
  277.          Augments($Assign, $AugmentUsed, 0)
  278.       EndIf
  279.  
  280.       if TimerDiff($ResetTimer) >= $GoldMachineMagicTime and TimerDiff($resetTimer) < $runTime-$wandoosTime then
  281.          GoldMachine(0, $Assign)
  282.          If $reassignedMagic == 0 Then
  283.                GoldMachine(0, $Unassign)
  284.                ToolTipLog("Reassigned Magic")
  285.                $reassignedMagic = 1
  286.          EndIf
  287.  
  288.          If $bloodReassignCounter == 4 Then
  289.             Sleep(150)
  290.             Send("t");
  291.             Sleep(150)
  292.             Send("t");
  293.             Sleep(150)
  294.             $bloodReassignCounter = 0
  295.          EndIf
  296.  
  297.          BloodMagic($Assign, 0)
  298.          GoldMachine(0, $Assign)
  299.          $bloodReassignCounter += 1
  300.       EndIf
  301.  
  302.       If TimerDiff($resetTimer) >= $NGUTime And $maxNGU == 0  and 1 == 0 Then
  303.          Augments($Unassign, $AugmentUsed, 0)
  304.          Augments($Assign, $AugmentUsed, 1)
  305.          NGU(1-$NGUFraction,true)
  306.          $maxNGU = 1
  307.          Augments($Assign, $AugmentUsed, 0)
  308.       EndIf
  309.  
  310.       If TimerDiff($resetTimer) >= $runTime-$wandoosTime And $wandoosSwapped == 1 AND $wandoosTime>0  Then
  311.          Wandoos(1)
  312.       EndIf
  313.  
  314.       $updateTimer = TimerInit()
  315.    EndIf
  316.  
  317.    while 0
  318.    ; Since i'm not powerful, i'll keep this way for now. Pls change like Anso when we get new gear \o/
  319.    if $IgnoreTimeMachine == 0 And TimerDiff($ResetTimer) <= $runTime - 30000 Then
  320.       ToolTipLog("TM...")
  321.       if TimerDiff($ResetTimer) >= $GoldMachineEnergyTime then
  322.          GoldMachine($Assign, 0)
  323.       EndIf
  324.       if TimerDiff($ResetTimer) >= $GoldMachineMagicTime then
  325.          GoldMachine(0, $Assign)
  326.       EndIf
  327.       if TimerDiff($ResetTimer) >= $GoldMachineEnergyEnd and TimerDiff($ResetTimer) <= $GoldMachineEnergyEnd + 10000 then
  328.          GoldMachine($Unassign, 0)
  329.       EndIf
  330.       if TimerDiff($ResetTimer) >= $GoldMachineMagicEnd and TimerDiff($ResetTimer) <= $GoldMachineMagicEnd + 10000 then
  331.          GoldMachine(0, $Unassign)
  332.       EndIf
  333.       if TimerDiff($ResetTimer) >= $GoldMachineEnergyEnd and TimerDiff($ResetTimer) >= $GoldMachineMagicEnd Then
  334.          GoldMachine($Unassign, $Unassign)
  335.          $IgnoreTimeMachine = 1
  336.       EndIf
  337.    EndIf
  338.  
  339.    if $IgnoreAugments == 0 And TimerDiff($ResetTimer) <= $runTime - 30000 Then
  340.       ToolTipLog("Augments...")
  341.       if TimerDiff($ResetTimer) >= $AugmentsTime then
  342.          Augments($Assign, 4, 0)
  343.       EndIf
  344.       if TimerDiff($ResetTimer) >= $AugmentsEnd then
  345.          Augments($Unassign, 0, 0)
  346.          $IgnoreAugments = 1
  347.       EndIf
  348.    EndIf
  349.  
  350.    if $IgnoreBloodMagic == 0 And TimerDiff($ResetTimer) <= $runTime - 30000 Then
  351.       ToolTipLog("Blood...")
  352.       if TimerDiff($ResetTimer) >= $BloodMagicTime then
  353.          BloodMagic($Assign, 0)
  354.       EndIf
  355.       if TimerDiff($ResetTimer) >= $BloodMagicEnd then
  356.          ;BloodMagic($Unassign, 0, 0)
  357.          $IgnoreBloodMagic = 1
  358.       EndIf
  359.    EndIf
  360.    WEnd
  361.  
  362. WEnd
  363.  
  364. ;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^;
  365. ; MAINLOOP/ MAINLOOP/ MAINLOOP/ MAINLOOP/ MAINLOOP/ MAINLOOP/
  366. ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
  367. ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<;
  368. ;--------------------------------------------------------;
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379. Func _goToMenu( $indexMenu )
  380.    if $indexMenu >=0 AND $indexMenu <=12 Then
  381.       ; 500 / 350 / 380 / 410
  382.       Local $incrementY = 30;
  383.       Local $startY = 350;
  384.       Click($MOUSE_CLICK_LEFT,500, $startY + ($indexMenu * $incrementY ), 5 )
  385.    Else
  386.       Return
  387.    EndIf
  388. EndFunc
  389.  
  390.  
  391. ;------------------- INVENTORY -------------------------;
  392.  
  393. Func SetupInventoryPosition()
  394.    ;660 / 660
  395.    $startPosition = 660
  396.    $currentPosition = 0
  397.  
  398.    For $r = 0 To 4 Step 1
  399.       For $c = 0 To 11 Step 1
  400.          local $posToShip = [$startPosition+($c*50), $startPosition+($r*50)-10]
  401.          $InventoryPositions[$currentPosition] = $posToShip
  402.          $currentPosition+=1
  403.       Next
  404.    Next
  405.    ; MIDLE
  406.    local $posToShip = [730, 384]
  407.    $InventoryPositions[$currentPosition] = $posToShip
  408.    CreateItem($BOOST_TYPE, $currentPosition, 0)
  409.    $currentPosition+=1
  410.  
  411.    local $posToShip = [730, 435]
  412.    $InventoryPositions[$currentPosition] = $posToShip
  413.    CreateItem($BOOST_TYPE, $currentPosition, 0)
  414.    $currentPosition+=1
  415.  
  416.    local $posToShip = [730, 480]
  417.    $InventoryPositions[$currentPosition] = $posToShip
  418.    CreateItem($BOOST_TYPE, $currentPosition, 0)
  419.    $currentPosition+=1
  420.  
  421.    local $posToShip = [730, 535]
  422.    $InventoryPositions[$currentPosition] = $posToShip
  423.    CreateItem($BOOST_TYPE, $currentPosition, 0)
  424.    $currentPosition+=1
  425.  
  426.    ; LEFT
  427.    local $posToShip = [680, 435]
  428.    $InventoryPositions[$currentPosition] = $posToShip
  429.    CreateItem($BOOST_TYPE, $currentPosition, 0)
  430.    CreateItem($MERGE_TYPE, $currentPosition, 0)
  431.    $currentPosition+=1
  432.  
  433.    local $posToShip = [680, 480]
  434.    $InventoryPositions[$currentPosition] = $posToShip
  435.    CreateItem($BOOST_TYPE, $currentPosition, 0)
  436.    CreateItem($MERGE_TYPE, $currentPosition, 0)
  437.    $currentPosition+=1
  438.  
  439.    local $posToShip = [680, 535]
  440.    $InventoryPositions[$currentPosition] = $posToShip
  441.    CreateItem($BOOST_TYPE, $currentPosition, 0)
  442.    CreateItem($MERGE_TYPE, $currentPosition, 0)
  443.    $currentPosition+=1
  444.  
  445.    ; Weapon
  446.    local $posToShip = [780, 435]
  447.    $InventoryPositions[$currentPosition] = $posToShip
  448.    CreateItem($BOOST_TYPE, $currentPosition, 0)
  449.    CreateItem($MERGE_TYPE, $currentPosition, 0)
  450.    $currentPosition+=1
  451. EndFunc
  452.  
  453. Func CreateItem($type, $invPosition, $slotPosition)
  454.    dim $item = [$type, $invPosition, $slotPosition]
  455.    $Equipment[$EquipmentCount] = $item
  456.    $EquipmentCount+=1
  457. EndFunc
  458.  
  459. Func SwapItems($type)
  460.    if( $EquipmentCount <1 ) Then
  461.       Return
  462.    EndIf
  463.    _goToMenu($MenuInventory)
  464.    For $i = 0 To $EquipmentCount - 1 Step 1
  465.       $item = $Equipment[$i]
  466.       if ( $item[0] == $type ) Then
  467.          $pos = $item[1]
  468.          $coord = $InventoryPositions[$pos]
  469.          Local $index
  470.          if $item[2] == 1 Then
  471.                $index = "q"
  472.             ElseIf $item[2] == 2 Then
  473.                $index = "w"
  474.             ElseIf $item[2] == 3 Then
  475.                $index = "e"
  476.             EndIf
  477.  
  478.          Sleep($SLEEP_DELAY*2)
  479.          Send("{" & $index & " down}")
  480.          Sleep($SLEEP_DELAY*2)
  481.  
  482.          MouseClick($MOUSE_CLICK_RIGHT, $coord[0], $coord[1], 1, $MOUSE_SPEED)
  483.  
  484.          Sleep($SLEEP_DELAY*2)
  485.          Send("{" & $index & " up}")
  486.          Sleep($SLEEP_DELAY*2)
  487.          $LAST_SWAPPED = $type
  488.       EndIf
  489.    Next
  490.    ToolTipLog("Swapped to" & TypeToString($LAST_SWAPPED))
  491. EndFunc
  492.  
  493. Func BoostItems()
  494.    if( $EquipmentCount <1 ) Then
  495.       Return
  496.    EndIf
  497.    _goToMenu($MenuInventory)
  498.    Sleep($SLEEP_DELAY)
  499.    Send("{a down}")
  500.    Sleep($SLEEP_DELAY)
  501.  
  502.    For $i =0 To $EquipmentCount - 1 Step 1
  503.       $item = $Equipment[$i]
  504.       if ( $item[0] == $BOOST_TYPE ) Then
  505.          $pos = $item[1]
  506.          $coord = $InventoryPositions[$pos]
  507.          $index = $item[2]
  508.  
  509.  
  510.  
  511.          MouseClick($MOUSE_CLICK_LEFT, $coord[0], $coord[1], 1, $MOUSE_SPEED)
  512.  
  513.  
  514.       EndIf
  515.    Next
  516.  
  517.    Sleep($SLEEP_DELAY)
  518.    Send("{a up}")
  519.    Sleep($SLEEP_DELAY)
  520. EndFunc
  521.  
  522. Func MergeItems()
  523.    if( $EquipmentCount <1 ) Then
  524.       Return
  525.    EndIf
  526.    Sleep($SLEEP_DELAY)
  527.    Send("{d down}")
  528.    Sleep($SLEEP_DELAY)
  529.    For $i = 0 To $EquipmentCount - 1 Step 1
  530.       $item = $Equipment[$i]
  531.       if ( $item[0] == $MERGE_TYPE ) Then
  532.          $pos = $item[1]
  533.          $coord = $InventoryPositions[$pos]
  534.          $index = $item[2]
  535.  
  536.  
  537.  
  538.          MouseClick($MOUSE_CLICK_LEFT, $coord[0], $coord[1], 1, $MOUSE_SPEED)
  539.  
  540.  
  541.       EndIf
  542.    Next
  543.    Sleep($SLEEP_DELAY)
  544.    Send("{d up}")
  545.    Sleep($SLEEP_DELAY)
  546.  
  547.    Sleep($SLEEP_DELAY)
  548.    Send("{e down}")
  549.    Sleep($SLEEP_DELAY)
  550.    For $i = 0 To $EquipmentCount - 1 Step 1
  551.       $item = $Equipment[$i]
  552.       if ( $item[0] == $MERGE_TYPE ) Then
  553.          $pos = $item[1]
  554.          $coord = $InventoryPositions[$pos]
  555.          $index = $item[2]
  556.  
  557.  
  558.  
  559.          MouseClick($MOUSE_CLICK_LEFT, $coord[0], $coord[1], 1, $MOUSE_SPEED)
  560.  
  561.  
  562.       EndIf
  563.    Next
  564.    Sleep($SLEEP_DELAY)
  565.    Send("{e up}")
  566.    Sleep($SLEEP_DELAY)
  567. EndFunc
  568.  
  569. Func ToolTipLog($str)
  570.     $dif = TimerDiff($ResetTimer)
  571.     $dif2 = StringLeft($dif, StringInStr($dif, ".") -1)
  572.     $Count = int($dif/1000)
  573.    if($Log[49] <> "") Then
  574.       for $i = 1 to 49
  575.          $Log[($i-1)] = $Log[$i]
  576.       Next
  577.       $Log[49]=$Count & " : " & $str & @CRLF
  578.    Else
  579.       $Log[$lastLog]=$Count & " : " &$str & @CRLF
  580.       $lastLog+=1
  581.    EndIf
  582. EndFunc
  583.  
  584. Func ResetLog()
  585.    for $i = 0 to 49 step 1
  586.       $Log[$i]=""
  587.    Next
  588.    $lastLog=0
  589. EndFunc
  590. ;-------------------- Funcs -----------------------------;
  591. Func MoneyPit()
  592.    Local $MoneyPitClick = [756,629] ; This is the yes button.
  593.    _goToMenu($MenuMoneyPit)
  594.    Sleep($SLEEP_DELAY)
  595.    Click("left",$MoneyPitClick[0]+50,$MoneyPitClick[1]+50,1)
  596.    Click("left",$MoneyPitClick[0]+40,$MoneyPitClick[1]+40,1)
  597.    Click("left",$MoneyPitClick[0]+30,$MoneyPitClick[1]+30,1)
  598.    Click("left",$MoneyPitClick[0]+20,$MoneyPitClick[1]+20,1)
  599.    Click("left",$MoneyPitClick[0]+10,$MoneyPitClick[1]+10,1)
  600.  
  601.    Click("left",$MoneyPitClick[0]+50,$MoneyPitClick[1]+50,1)
  602.    Click("left",$MoneyPitClick[0]+40,$MoneyPitClick[1]+40,1)
  603.    Click("left",$MoneyPitClick[0]+30,$MoneyPitClick[1]+30,1)
  604.    Click("left",$MoneyPitClick[0]+20,$MoneyPitClick[1]+20,1)
  605.    Click("left",$MoneyPitClick[0]+10,$MoneyPitClick[1]+10,1)
  606.  
  607. EndFunc
  608.  
  609. Func FightBoss()
  610.    local $Nuke = [950,425]
  611.    local $Fight = [950, 525]
  612.    _goToMenu($MenuFightBoss)
  613.    Sleep($SLEEP_DELAY)
  614.    Click($MOUSE_CLICK_LEFT, $Nuke[0], $Nuke[1], 1)
  615.    Sleep($SLEEP_DELAY)
  616.    Sleep($SLEEP_DELAY)
  617.    Click($MOUSE_CLICK_LEFT, $Nuke[0], $Nuke[1], 1)
  618.    Sleep($SLEEP_DELAY)
  619.    Sleep($SLEEP_DELAY)
  620.    Click($MOUSE_CLICK_LEFT, $Nuke[0], $Nuke[1], 1)
  621.    Sleep($SLEEP_DELAY)
  622.  
  623.    For $i = 0 To 5 Step 1
  624.       Sleep($SLEEP_DELAY)
  625.       Click($MOUSE_CLICK_LEFT, $Fight[0], $Fight[1], 1)
  626.       Sleep(5*$SLEEP_DELAY)
  627.    Next
  628. EndFunc
  629.  
  630. Func Adventure($count, $inc)
  631.    local $bossFound = false
  632.    SwapItems($GOLD_TYPE)
  633.    _goToMenu($MenuAdventure)
  634.    if($inc == false) Then
  635.       for $i = 0 To 10 Step 1
  636.          Sleep($SLEEP_DELAY)
  637.          Send("{left}")
  638.          Sleep($SLEEP_DELAY)
  639.       Next
  640.    EndIf
  641.    for $i = 0 To $count  Step 1
  642.       Sleep($SLEEP_DELAY)
  643.       Send("{right}")
  644.       Sleep($SLEEP_DELAY)
  645.    Next
  646.  
  647.    sleep(4500)
  648.    ; Highest boss is here probably, wait for the boss to die
  649.    while $bossFound == False
  650.       If(PixelGetColor(1049,733) == 0xFF0000) Then ; Enemy spawned?
  651.          If (PixelGetColor(1041,617) == 0xF7EF29) Then ; Boss here
  652.             $bossFound = true
  653.             While PixelGetColor(1049,733) == 0xFF0000
  654.                SLEEP(1000)
  655.             WEnd
  656.          Else
  657.              Sleep(100)
  658.              Send("{LEFT}")
  659.              Sleep(100)
  660.              Send("{RIGHT}")
  661.              GoldMachine($Assign, $Assign)
  662.              _goToMenu($MenuAdventure)
  663.          EndIf
  664.        EndIf
  665.     WEnd
  666.    send("r")
  667.    sleep(100)
  668.    send("t")
  669.    Sleep($SLEEP_DELAY)
  670.          Send("{left}")
  671.          Sleep($SLEEP_DELAY)
  672.    SwapItems($BASE_TYPE)
  673. EndFunc
  674.  
  675. Func GoldMachine($energy, $magic)
  676.    _goToMenu($MenuTimeMachine)
  677.    Local $GoldPlus = [855,542]
  678.    Local $GoldMinus = [887,542]
  679.    Local $GoldMagicPlus = [855,642]
  680.    Local $GoldMagicMinus = [887,642]
  681.  
  682.    Switch $energy
  683.       case $Assign
  684.          Click($MOUSE_CLICK_LEFT,$GoldPlus[0],$GoldPlus[1],2)
  685.       case $Unassign
  686.          Click($MOUSE_CLICK_LEFT,$GoldMinus[0],$GoldMinus[1],2)
  687.       EndSwitch
  688.  
  689.    Switch $magic
  690.       case $Assign
  691.          Click($MOUSE_CLICK_LEFT,$GoldMagicPlus[0],$GoldMagicPlus[1],2)
  692.       case $Unassign
  693.          Click($MOUSE_CLICK_LEFT,$GoldMagicMinus[0],$GoldMagicMinus[1],2)
  694.       EndSwitch
  695.  
  696. EndFunc
  697.  
  698. Func Augments($do, $where, $upgrade)
  699.    _goToMenu($MenuAugmentation)
  700.    $x = 0
  701.    if($do == $Unassign) Then
  702.       $x = 890
  703.    Else
  704.       $x = 855
  705.    EndIf
  706.    if $where == 0 Then ; 0 means everything, mostly for unassign part tho
  707.       for $y = 580 To 860 Step 70
  708.          Click($MOUSE_CLICK_LEFT, $x, $y-10, 1)
  709.          Click($MOUSE_CLICK_LEFT, $x, $y+10, 1)
  710.       Next
  711.    Else
  712.       if $upgrade == 1 Then
  713.          Click($MOUSE_CLICK_LEFT, 926, 360, 2)
  714.          Click($MOUSE_CLICK_LEFT, $x, 580+(70*($where-1))+10, 1)
  715.          Click($MOUSE_CLICK_LEFT, 1202, 358, 2)
  716.       Else
  717.          Click($MOUSE_CLICK_LEFT, $x, 580+(70*($where-1))-10, 1)
  718.       EndIf
  719.    EndIf
  720. EndFunc
  721.  
  722. Func BloodMagic($do, $where)
  723.    _goToMenu($MenuBloodMagic)
  724.    $x = 0
  725.    if($do == $Unassign) Then
  726.       $x = 850
  727.    Else
  728.       $x = 880
  729.    EndIf
  730.  
  731.    if $where == 0 Then ; 0 means everything, mostly for unassign part tho
  732.       Click($MOUSE_CLICK_LEFT, $x, 640, 2)
  733.    Else
  734.       Click($MOUSE_CLICK_LEFT, $x, 535+(35*$where) , 2)
  735.    EndIf
  736. EndFunc
  737.  
  738. Func Rebirth()
  739.    FightBoss()
  740.    Local $RebirthMenu = [413, 719]
  741.    Local $RebirthButton = [815, 830]
  742.    Local $RebirthYes = [756,627]
  743.    Click($MOUSE_CLICK_LEFT,$RebirthMenu[0],$RebirthMenu[1],5)
  744.    Click($MOUSE_CLICK_LEFT,$RebirthButton[0],$RebirthButton[1],5)
  745.    Click($MOUSE_CLICK_LEFT,$RebirthYes[0],$RebirthYes[1],5)
  746.  
  747.    $FightBossTimer = TimerInit()
  748.    $ResetTimer = TimerInit()
  749.    $BoostAndMergeTimer = TimerInit()
  750.    $FightBossTimer = TimerInit()
  751.    $updateTimer = TimerInit()
  752.  
  753.    $IgnoreTimeMachine = 0
  754.    $IgnoreAugments = 0
  755.    $IgnoreBloodMagic = 0
  756.    $reassignedEnergy = 0
  757.    $swapped = 0
  758.    $swapped1 = 0
  759.    $wandoosSwapped = 0
  760.  
  761.    $Initialized = 0
  762.    $rebNumber += 1
  763. EndFunc
  764.  
  765. Func ColRowToInv($col, $row)
  766.    $x = $col-1
  767.    $y = $row-1
  768.  
  769.    return $x+$y*12
  770. EndFunc
  771.  
  772. Func Setup()
  773.    SetupInventoryPosition()
  774.  
  775. ;~    Start as boss, swap to gold/mixed
  776.    ;--------- Gold
  777.    CreateItem($GOLD_TYPE, ColRowToInv(11,3), 0) ; strange head SWAPPED
  778.    CreateItem($GOLD_TYPE, ColRowToInv(12,1), 0) ; 2d chest SWAPPED
  779.    CreateItem($GOLD_TYPE, ColRowToInv(11,1), 0) ; 2d boots SWAPPED
  780.  
  781.    ;--------- Base CHECK
  782.    CreateItem($BASE_TYPE, ColRowToInv(11,4), 1) ; stapler SWAPPED
  783.    CreateItem($BASE_TYPE, ColRowToInv(11,5), 2) ; Meat SWAPPED
  784.    CreateItem($BASE_TYPE, ColRowToInv(12,4), 3) ; ghost amulet SWAPPED
  785.  
  786.    ;--------- Main CHECK
  787.    CreateItem($MAIN_TYPE, ColRowToInv(11,3), 0) ; strange rare SWAPPED
  788.    CreateItem($MAIN_TYPE, ColRowToInv(11,2), 2) ; 2d weapon SWAPPED
  789.  
  790.    ;-------- Second CHECK
  791.    CreateItem($SECOND_TYPE, ColRowToInv(12,1), 0) ; Strange chest  SWAPPED
  792.    CreateItem($SECOND_TYPE, ColRowToInv(12,2), 0) ; Ghost weapon  SWAPPED
  793.  
  794. ;~    $WANDOOS_TYPE
  795.    CreateItem($WANDOOS_TYPE, ColRowToInv(12,3), 0) ; 2d Head  SWAPPED
  796.    CreateItem($WANDOOS_TYPE, ColRowToInv(12,2), 0) ; 2d weapon  SWAPPED
  797.    CreateItem($WANDOOS_TYPE, ColRowToInv(12,5), 3) ; 2d amulet  SWAPPED
  798.  
  799.    ;-------- Boss HECK
  800.    CreateItem($BOSS_TYPE, ColRowToInv(12,4), 3) ; heart SWAPPED
  801.    CreateItem($BOSS_TYPE, ColRowToInv(11,5), 2) ; aafp SWAPPED
  802.    CreateItem($BOSS_TYPE, ColRowToInv(11,4), 1) ; afp SWAPPED
  803.    CreateItem($BOSS_TYPE, ColRowToInv(11,1), 0) ; strange boots SWAPPED
  804.    CreateItem($BOSS_TYPE, ColRowToInv(11,2), 0) ; gaudy weapon SWAPPED
  805.    CreateItem($BOSS_TYPE, ColRowToInv(12,3), 0) ; gaudy rare SWAPPED
  806.  
  807.    ;-------- Pit CHECK
  808.    CreateItem($PIT_TYPE, ColRowToInv(10,2), 0) ; jake start SWAPPED
  809.    CreateItem($PIT_TYPE, ColRowToInv(10,3), 0)
  810.    CreateItem($PIT_TYPE, ColRowToInv(10,4), 0)
  811.    CreateItem($PIT_TYPE, ColRowToInv(10,5), 0)
  812.    CreateItem($PIT_TYPE, ColRowToInv(9,1), 2) ; Paper SWAPPED
  813.    CreateItem($PIT_TYPE, ColRowToInv(11,4), 1) ; stapler SWAPPED
  814.  
  815.  
  816.  
  817.    For $r = 1 to 5 Step 1
  818.       For $c = 9 to 12 step 1
  819.          CreateItem($BOOST_TYPE, ColRowToInv($c,$r), 0)
  820.          ;CreateItem($MERGE_TYPE, $currentPosition, 0)
  821.       Next
  822.    Next
  823.    For $r = 1 to 5 Step 1
  824.       For $c = 1 to 4 step 1
  825.          CreateItem($TRANSFORM_TYPE, ColRowToInv($c,$r), 0)
  826.          CreateItem($MERGE_TYPE, ColRowToInv($c,$r), 0)
  827.       Next
  828.    Next
  829.  
  830. EndFunc
  831.  
  832. Func RemoveCaps()
  833.    GoldMachine($Unassign, $Unassign)
  834.    Augments($Unassign, 0, 0)
  835.    BloodMagic($Unassign, 0)
  836. EndFunc
  837.  
  838. Func NGU($fraction, $ceil)
  839.    _goToMenu($MenuNGU)
  840.  
  841.    Click($MOUSE_CLICK_LEFT, 930, 360, 5 )
  842.    If $fraction == 0 Then
  843.       For $a = 0 To 5 Step 1
  844.          Click($MOUSE_CLICK_LEFT, 900, 565+$i*45, 1 )
  845.          Sleep($SLEEP_DELAY)
  846.       Next
  847.       Return
  848.    EndIf
  849.    For $i = 0 To 5 Step 1
  850.       Sleep(2*$SLEEP_DELAY)
  851.       $iter = 0
  852.       If $ceil Then
  853.          $iter = Floor($NGUClicks[$i]*$fraction)
  854.       Else
  855.          $iter = Ceiling($NGUClicks[$i]*$fraction)
  856.       EndIf
  857.       For $a = 0 To $iter-1 Step 1
  858.          Click($MOUSE_CLICK_LEFT, 860, 565+$i*45, 1 )
  859.          Sleep($SLEEP_DELAY)
  860.       Next
  861.    Next
  862.  
  863.    Click($MOUSE_CLICK_LEFT, 1196, 360, 5 )
  864. EndFunc
  865.  
  866. Func Wandoos($bool)
  867.    _goToMenu($MenuWandoos)
  868.    If $bool == 0 Then
  869.       Sleep($SLEEP_DELAY)
  870.       Click($MOUSE_CLICK_LEFT, 900, 560, 5 )
  871.       Sleep($SLEEP_DELAY)
  872.       Click($MOUSE_CLICK_LEFT, 900, 660, 5 )
  873.       Return
  874.    EndIf
  875.    _goToMenu($MenuWandoos)
  876.    Sleep($SLEEP_DELAY)
  877.    Click($MOUSE_CLICK_LEFT, 872, 560, 5 )
  878.    Sleep($SLEEP_DELAY)
  879.    Click($MOUSE_CLICK_LEFT, 872, 660, 5 )
  880. EndFunc
  881. ;------------------- GLOBAL ----------------------------;
  882.  
  883. Func Click($MouseClick, $positionX, $positionY, $amountOfClicks)
  884.    Sleep($SLEEP_DELAY)
  885.    MouseClick($MouseClick, $positionX, $positionY, $amountOfClicks, $MOUSE_SPEED)
  886. EndFunc
  887.  
  888. Func TogglePause()
  889.    If($pause == true ) Then
  890.       $pause = False
  891.    Else
  892.       $pause = true
  893.    EndIf
  894. EndFunc
  895.  
  896.  
  897.  
  898. Func TypeToString($var)
  899.    Select
  900.    case $var == 0
  901.       return "$MAGIC_TYPE"
  902.    case $var == 1
  903.       return "$ENERGY_TYPE"
  904.    case $var == 2
  905.       return "$PIT_TYPE"
  906.    case $var == 3
  907.       return "$BOOST_TYPE"
  908.    case $var == 4
  909.       return "$MERGE_TYPE"
  910.    case $var == 5
  911.       return "$GOLD_TYPE"
  912.    case $var == 6
  913.       return "$MAIN_TYPE"
  914.    case $var == 7
  915.       return "$BOSS_TYPE"
  916.    case $var == 8
  917.       return "$TRANSFORM_TYPE"
  918.    case $var == 9
  919.       return "$SECOND_TYPE"
  920.    case $var == 10
  921.       return "$WANDOOS_TYPE"
  922.    case $var == 11
  923.       return "$BASE_TYPE"
  924.    Case Else
  925.       return "error"
  926.    EndSelect
  927.  
  928.  
  929. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement