Sie sind auf Seite 1von 8

;Unponderable's Auto Merge and Boost Script for NGU Idle v0.

4
;Supports Build 0.397
;
; Will merge all equipment and then use boosts in the following order:
;
; Head, Chest, Legs, Boots, Accessories (up to 8), Inventory Slots (up to 5),
Infinity Cube
;
;Release Notes
;Version 0.4 - Experimental release. Now runs in background. Thanks to Satyric.
;Version 0.3 - Supports up to 12 inventory slots now, thanks to Turbo Basti.
;Version 0.2 - Added auto transforming option. Shamelessly adapted from Tatsumasa's
code. Requires Transformable.png.
;Version 0.1 - First Draft
;
;Instructions:
;1. Change settings below.
;2. With the NGU window focused and fully visible in your screen, use Ctrl+k to
begin the script.
;3. Press Esc at any time to exit.
;
;Note: Banner ads may screw up with game detection.

;-------SETTINGS! CHANGE THESE!-------

TimeToWait = 10000 ;Time to wait for loop, in milliseconds. Default 10000 = 10


seconds.

NumberOfAccessorySlots = 5 ;Number of accessory slots possessed. Supports up to 8.

NumberOfInventorySlots = 0 ;Number of inventory slots to merge/boost. Maximum of


12.

^k:: ;**Press CTRL+k to begin script loop**

IfWinNotActive, Play NGU IDLE ;Need to test if this causes problems on non-Chrome
browsers
{
MsgBox, Failed to initiate - NGU Idle window not active.`nRun the script when
the game window is active.
Exit
}
SetMouseDelay, 10
SetKeyDelay, 10

WinGetPos,,,WinW,WinH
PixelSearch, Px, Py, 0, 0, %WinW%, %WinH%, 0xA58663, 5, Fast ;Looks for the top
left corner of the game (blue-ish pixels)
if ErrorLevel{
MsgBox, Failed to initiate - couldn't detect top left corner of NGU Idle.`nMake
sure the game is fully visible on your screen.`nExiting...
Exit
}
else
;MsgBox, The pixel was found at X%Px% Y%Py%.

Global WindowId
WinActivate, Play NGU IDLE
WinGet, WindowId, ID, A
;Set the position of boxes relative to the top left corner. Determined in advance.
XPositionInventory := Px + 237
YPositionInventory := Py + 170

XSlotHead := Px + 527
YSlotHead := Py + 60
XSlotChest := Px + 527
YSlotChest := Py + 106
XSlotLegs := Px + 527
YSlotLegs := Py + 162
XSlotBoots := Px + 527
YSlotBoots := Py + 214
XSlotWeapon := Px + 575
YSlotWeapon := Py + 112
XSlotAcc1 := Px + 467
YSlotAcc1 := Py + 58
XSlotAcc2 := Px + 467
YSlotAcc2 := Py + 110
XSlotAcc3 := Px + 467
YSlotAcc3 := Py + 154
XSlotAcc4 := Px + 467
YSlotAcc4 := Py + 212
XSlotAcc5 := Px + 423
YSlotAcc5 := Py + 212
XSlotAcc6 := Px + 423
YSlotAcc6 := Py + 154
XSlotAcc7 := Px + 423
YSlotAcc7 := Py + 110
XSlotAcc8 := Px + 423
YSlotAcc8 := Py + 58

XCube := Px + 625
YCube := Py + 112

XInv1 := Px + 347
YInv1 := Py + 324
XInv2 := Px + 395
YInv2 := Py + 324
XInv3 := Px + 445
YInv3 := Py + 324
XInv4 := Px + 493
YInv4 := Py + 324
XInv5 := Px + 539
YInv5 := Py + 324
XInv6 := Px + 595
YInv6 := Py + 324
XInv7 := Px + 640
YInv7 := Py + 324
XInv8 := Px + 690
YInv8 := Py + 324
XInv9 := Px + 740
YInv9 := Py + 324
XInv10 := Px + 785
YInv10 := Py + 324
XInv11 := Px + 835
YInv11 := Py + 324
XInv12 := Px + 885
YInv12 := Py + 324

;Setup

Click %XPositionInventory%,%YPositionInventory% ;Inventory


Sleep,100

;MsgBox, Success?`n%PositionInventory%

Loop{
IfWinNotActive, Play NGU IDLE ;Need to test if this causes problems on non-
Chrome browsers
{
;MsgBox, NGU Idle window no longer active - exiting.
;Exit
}

ControlClick2(XSlotHead,YSlotHead,"d")
Sleep, 100
ControlClick2(XSlotChest,YSlotChest,"d")
Sleep, 100
ControlClick2(XSlotLegs,YSlotLegs,"d")
Sleep, 100
ControlClick2(XSlotBoots,YSlotBoots,"d")
Sleep, 100
ControlClick2(XSlotWeapon,YSlotWeapon,"d")
Sleep, 100

if NumberOfAccessorySlots >= 1
{
ControlClick2(XSlotAcc1,YSlotAcc1,"d")
Sleep, 100
}
if NumberOfAccessorySlots >= 2
{
ControlClick2(XSlotAcc2,YSlotAcc2,"d")
Sleep, 100
}
if NumberOfAccessorySlots >= 3
{
ControlClick2(XSlotAcc3,YSlotAcc3,"d")
Sleep, 100
}
if NumberOfAccessorySlots >= 4
{
ControlClick2(XSlotAcc4,YSlotAcc4,"d")
Sleep, 100
}
if NumberOfAccessorySlots >= 5
{
ControlClick2(XSlotAcc5,YSlotAcc5,"d")
Sleep, 100
}
if NumberOfAccessorySlots >= 6
{
ControlClick2(XSlotAcc6,YSlotAcc6,"d")
Sleep, 100
}
if NumberOfAccessorySlots >= 7
{
ControlClick2(XSlotAcc7,YSlotAcc7,"d")
Sleep, 100
}
if NumberOfAccessorySlots >= 8
{
ControlClick2(XSlotAcc8,YSlotAcc8,"d")
Sleep, 100
}

if NumberOfInventorySlots >= 1
{
ControlClick2(XInv1,YInv1,"d")
Sleep, 100
}
if NumberOfInventorySlots >= 2
{
ControlClick2(XInv2,YInv2,"d")
Sleep, 100
}
if NumberOfInventorySlots >= 3
{
ControlClick2(XInv3,YInv3,"d")
Sleep, 100
}
if NumberOfInventorySlots >= 4
{
ControlClick2(XInv4,YInv4,"d")
Sleep, 100
}
if NumberOfInventorySlots >= 5
{
ControlClick2(XInv5,YInv5,"d")
Sleep, 100
}
if NumberOfInventorySlots >= 6
{
ControlClick2(XInv6,YInv6,"d")
Sleep, 100
}
if NumberOfInventorySlots >= 7
{
ControlClick2(XInv7,YInv7,"d")
Sleep, 100
}
if NumberOfInventorySlots >= 8
{
ControlClick2(XInv8,YInv8,"d")
Sleep, 100
}
if NumberOfInventorySlots >= 9
{
ControlClick2(XInv9,YInv9,"d")
Sleep, 100
}
if NumberOfInventorySlots >= 10
{
ControlClick2(XInv10,YInv10,"d")
Sleep, 100
}
if NumberOfInventorySlots >= 11
{
ControlClick2(XInv11,YInv11,"d")
Sleep, 100
}
if NumberOfInventorySlots >= 12
{
ControlClick2(XInv12,YInv12,"d")
Sleep, 100
}

Sleep, 100

ControlClick2(XSlotHead,YSlotHead,"a")
Sleep, 100
ControlClick2(XSlotChest,YSlotChest,"a")
Sleep, 100
ControlClick2(XSlotLegs,YSlotLegs,"a")
Sleep, 100
ControlClick2(XSlotBoots,YSlotBoots,"a")
Sleep, 100
ControlClick2(XSlotWeapon,YSlotWeapon,"a")
Sleep, 100

if NumberOfAccessorySlots >= 1
{
ControlClick2(XSlotAcc1,YSlotAcc1,"a")
Sleep, 100
}
if NumberOfAccessorySlots >= 2
{
ControlClick2(XSlotAcc2,YSlotAcc2,"a")
Sleep, 100
}
if NumberOfAccessorySlots >= 3
{
ControlClick2(XSlotAcc3,YSlotAcc3,"a")
Sleep, 100
}
if NumberOfAccessorySlots >= 4
{
ControlClick2(XSlotAcc4,YSlotAcc4,"a")
Sleep, 100
}
if NumberOfAccessorySlots >= 5
{
ControlClick2(XSlotAcc5,YSlotAcc5,"a")
Sleep, 100
}
if NumberOfAccessorySlots >= 6
{
ControlClick2(XSlotAcc6,YSlotAcc6,"a")
Sleep, 100
}
if NumberOfAccessorySlots >= 7
{
ControlClick2(XSlotAcc7,YSlotAcc7,"a")
Sleep, 100
}
if NumberOfAccessorySlots >= 8
{
ControlClick2(XSlotAcc8,YSlotAcc8,"a")
Sleep, 100
}

if (NumberOfInventorySlots >= 1 && TransformInventorySlot1 != 1)


{
ControlClick2(XInv1,YInv1,"a")
Sleep, 100
}
if (NumberOfInventorySlots >= 2 && TransformInventorySlot2 != 1)
{
ControlClick2(XInv2,YInv2,"a")
Sleep, 100
}
if (NumberOfInventorySlots >= 3 && TransformInventorySlot3 != 1)
{
ControlClick2(XInv3,YInv3,"a")
Sleep, 100
}
if (NumberOfInventorySlots >= 4 && TransformInventorySlot4 != 1)
{
ControlClick2(XInv4,YInv4,"a")
Sleep, 100
}
if (NumberOfInventorySlots >= 5 && TransformInventorySlot5 != 1)
{
ControlClick2(XInv5,YInv5,"a")
Sleep, 100
}
if (NumberOfInventorySlots >= 6 && TransformInventorySlot6 != 1)
{
ControlClick2(XInv6,YInv6,"a")
Sleep, 100
}
if (NumberOfInventorySlots >= 7 && TransformInventorySlot7 != 1)
{
ControlClick2(XInv7,YInv7,"a")
Sleep, 100
}
if (NumberOfInventorySlots >= 8 && TransformInventorySlot8 != 1)
{
ControlClick2(XInv8,YInv8,"a")
Sleep, 100
}
if (NumberOfInventorySlots >= 9 && TransformInventorySlot9 != 1)
{
ControlClick2(XInv9,YInv9,"a")
Sleep, 100
}
if (NumberOfInventorySlots >= 10 && TransformInventorySlot10 != 1)
{
ControlClick2(XInv10,YInv10,"a")
Sleep, 100
}
if (NumberOfInventorySlots >= 11 && TransformInventorySlot11 != 1)
{
ControlClick2(XInv11,YInv11,"a")
Sleep, 100
}
if (NumberOfInventorySlots >= 12 && TransformInventorySlot12 != 1)
{
ControlClick2(XInv12,YInv12,"a")
Sleep, 100
}

if HaveInfinityCube = 1
{
ControlClick2(XCube,YCube,"a")
Sleep, 100
}

Sleep,%TimeToWait%
}

TransformCheck()
{
WinGetPos,,,WinW,WinH
SearchFileName = Transformable.png
ImageSearch, SearchX, SearchY, 0, 0, %WinW%, %WinH%, *10 %SearchFileName%

If SearchX
{
return, 1
}
else
{
return, 0
}
}

ControlClick2(X, Y, Button) {

PostMessage, 0x200, 0, X&0xFFFF | Y<<16,, ahk_id %WindowId% ; WM_MOUSEMOVE


Sleep, 100

if (Button = "Left") {
PostMessage, 0x201, 0, X&0xFFFF | Y<<16,, ahk_id %WindowId% ; WM_LBUTTONDOWN
Sleep, 100
PostMessage, 0x202, 0, X&0xFFFF | Y<<16,, ahk_id %WindowId% ; WM_LBUTTONUP
}

else if (Button = "Right") {


PostMessage, 0x204, 0, X&0xFFFF | Y<<16,, ahk_id %WindowId% ; WM_RBUTTONDOWN
Sleep, 100
PostMessage, 0x205, 0, X&0xFFFF | Y<<16,, ahk_id %WindowId% ; WM_RBUTTONUP
}
else if (Button = "a") {
PostMessage, 0x100, 0x41,,, ahk_id %WindowId% ; A down
Sleep, 100
PostMessage, 0x201, 0, X&0xFFFF | Y<<16,, ahk_id %WindowId% ; WM_LBUTTONDOWN
Sleep, 100
PostMessage, 0x202, 0, X&0xFFFF | Y<<16,, ahk_id %WindowId% ; WM_LBUTTONUP
Sleep, 100
PostMessage, 0x101, 0x41,,, ahk_id %WindowId% ; A up
}
else if (Button = "d") {
PostMessage, 0x100, 0x44,,, ahk_id %WindowId% ; D down
Sleep, 100
PostMessage, 0x201, 0, X&0xFFFF | Y<<16,, ahk_id %WindowId% ; WM_LBUTTONDOWN
Sleep, 100
PostMessage, 0x202, 0, X&0xFFFF | Y<<16,, ahk_id %WindowId% ; WM_LBUTTONUP

Sleep, 100
PostMessage, 0x101, 0x44,,, ahk_id %WindowId% ; D up
}
}

Das könnte Ihnen auch gefallen