Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Path of Exile RNG Challenge
- ; created by unobtanium
- ; 22.05.2015 20:43
- ; Be sure you have Path of Exile running.
- ; I recommend running the game in window (borderless) mode,
- ; because Windows will open and close the game whenever you click a button (nothing i can do about it).
- ; Press F8 to enable the program. A little button will appear on the left side (right under the chat).
- ; Click on it to open the Button Menu.
- ; You can choose from various randomizers.
- ; Some require additional information, like word length size or number value range.
- ; If something went out of control, press Ctrg + Alt + Delete to open up Task Manager and stop/reload the script.
- ; Have fun :)
- ; Known Issue:
- ; The GUI sometimes flickers when a lot of updates are made. Just a minor, visual bug.
- ; Game drops to 30 fps if a video or stream is running on my second monitor. Closing the script with F8 fixes this.
- ~F8::
- {
- toggleGUIMenu()
- Return
- }
- toggleGUIMenu() {
- openPOE()
- IfWinExist, Path of Exile RNG Challenge
- {
- Gui, 1: Destroy
- openPOE()
- Return
- } else {
- openPOE()
- WinGetPos,,,width,height
- wx := 2
- wy := (height*0.75)
- ;Main Button
- Gui, 1: Font, s15, Arial
- Gui, 1: -Caption +AlwaysOnTop +ToolWindow +E0x08000000
- Gui, 1: Color, 000000
- Gui, 1: Add, Button, X0 Y0 w50 h25, RNG
- Gui, 1: Show, X%wx% Y%wy% H25 W50, Path of Exile RNG Challenge
- WinGet, k_ID, ID, A
- WinSet, AlwaysOnTop, On, ahk_id %k_ID%
- WinSet, TransColor, FFFFFF 100, ahk_id %k_ID%
- openPOE()
- Return
- }
- Return
- }
- ButtonRNG() {
- openPOE()
- IfWinExist, Path of Exile RNG Challenge Menu
- {
- Gui, 2: Destroy
- openPOE()
- Return
- } else {
- openPOE()
- WinGetPos,,,width,height
- wx := (width/2-400)
- wy := (height-100)
- Gui, 2: Font, s15, Arial
- Gui, 2: -Caption +AlwaysOnTop +ToolWindow +E0x08000000 +owner1
- Gui, 2: Color, 000000
- Gui, 2: Add, Button, X0 Y0 w100 h50 , Number
- Gui, 2: Add, Button, X100 Y0 w100 h50, YesNo
- Gui, 2: Add, Button, X200 Y0 w100 h50, Letter
- Gui, 2: Add, Button, X300 Y0 w100 h50, Word
- Gui, 2: Add, Button, X400 Y0 w100 h50, Character
- Gui, 2: Add, Button, X500 Y0 w100 h50, Inventory
- Gui, 2: Add, Button, X600 Y0 w100 h50, Flask
- Gui, 2: Add, Button, X700 Y0 w100 h50, Node
- Gui, 2: Show, X%wx% Y%wy% H50 W800 , Path of Exile RNG Challenge Menu
- WinGet, k_ID, ID, A
- WinSet, AlwaysOnTop, On, ahk_id %k_ID%
- WinSet, TransColor, FFFFFF 150, ahk_id %k_ID%
- openPOE()
- Return
- }
- Return
- }
- 2ButtonNumber:
- {
- Gui, 2: Destroy
- openPOE()
- WinGetPos,,,width,height
- winW := 225
- winH := 150
- x := (width/2)-(winW/2)
- y := (winY/2)-(winH/2)
- InputBox, start, Word Length, Enter the minimum value.,, %winW%, %winH%, %x%, %y%,,,1
- if ErrorLevel {
- Return
- }
- InputBox, endNum, Word Length, Enter the maximum number.,, %winW%, %winH%, %x%, %y%
- if ErrorLevel {
- Return
- }
- if (start > = endNum ) {
- Return
- }
- randomizeNumber(start, endNum)
- Return
- }
- 2ButtonYesNo:
- {
- Gui, 2: Destroy
- randomizeYesNo()
- openPOE()
- Return
- }
- 2ButtonLetter:
- {
- Gui, 2: Destroy
- MsgBox, After clicking OK you have two seconds to click where you want to have your letter displayed, before the letter gets randomized.
- Sleep, 2500
- randomizeLetter()
- openPOE()
- Return
- }
- 2ButtonWord:
- {
- Gui, 2: Destroy
- openPOE()
- WinGetPos,,,width,height
- winW := 225
- winH := 150
- x := (width/2)-(winW/2)
- y := (winY/2)-(winH/2)
- InputBox, wordLength, Word Length, Enter the number of letters you want to randomize.,, %winW%, %winH%, %x%, %y%
- if ErrorLevel {
- Return
- }
- MsgBox, After clicking OK you have two seconds to click where you want to have your word displayed, before the word gets randomized.
- Sleep, 2500
- createWord(wordLength)
- openPOE()
- Return
- }
- 2ButtonCharacter:
- {
- Gui, 2: Destroy
- randomizeCharacter()
- openPOE()
- Return
- }
- 2ButtonInventory:
- {
- Gui, 2: Destroy
- randomizeInventory()
- openPOE()
- Return
- }
- 2ButtonFlask:
- {
- Gui 2: Destroy
- randomizeFlasks()
- openPOE()
- Return
- }
- 2ButtonNode:
- {
- Gui, 2: Destroy
- randomizeNode()
- openPOE()
- Return
- }
- ;Functions
- openInventory() {
- SendInput, I
- Return
- }
- openSkillTree() {
- SendInput, P
- Return
- }
- openPOE() {
- IfWinExist, Path of Exile ahk_class Direct3DWindowClass
- WinActivate, Path of Exile ahk_class Direct3DWindowClass
- Return
- }
- randomizeYesNo() {
- IfWinExist, Path of Exile ahk_class Direct3DWindowClass
- WinActivate, Path of Exile ahk_class Direct3DWindowClass
- delay := 100
- counter := 0
- WinGetPos,,,width
- cx1 := (width/2-100)
- cx2 := (width/2)
- colorGreen := 009933
- Random, selected, 0, 1
- Loop {
- if (counter > 30) {
- delay += 50
- }
- Random,end,0,1 == 1
- if (counter > 40 and end == 1) {
- if (selected == 0) {
- SplashImage 9:, B H60 W100 X%cx1% Y0 CWCC0000 C11 FM30 CTFFFFFF,,NO
- SplashImage 10:, B H60 W100 X%cx2% Y0 CW000000
- } else {
- SplashImage 9:, B H60 W100 X%cx1% Y0 CW000000
- SplashImage 10:, B H60 W100 X%cx2% Y0 CW009933 C11 FM30 CTFFFFFF,,YES
- }
- Break
- } else {
- if (selected == 0) {
- SplashImage 9:, B H60 W100 X%cx1% Y0 CWCC0000 C11 FM30 CTFFFFFF,,NO
- SplashImage 10:, B H60 W100 X%cx2% Y0 CW000000 C11 FM30 CTFFFFFF,,YES
- } else {
- SplashImage 9:, B H60 W100 X%cx1% Y0 CW000000 C11 FM30 CTFFFFFF,,NO
- SplashImage 10:, B H60 W100 X%cx2% Y0 CW009933 C11 FM30 CTFFFFFF,,YES
- }
- }
- Sleep, %delay%
- counter += 1
- selected += 1
- if (selected > 1) {
- selected := 0
- }
- }
- Sleep, 3000
- SplashImage 9: Off
- SplashImage 10: Off
- Return
- }
- randomizeNumber(start, end) {
- IfWinExist, Path of Exile ahk_class Direct3DWindowClass
- WinActivate, Path of Exile ahk_class Direct3DWindowClass
- delay := 100
- counter := 0
- selected := 0
- WinGetPos,,,width
- cx := (width/2-75)
- Loop {
- if (counter > 40) {
- delay += 50
- }
- lastSelected := selected
- while (lastSelected == selected) {
- Random, selected, start, end
- }
- if (counter > 50) {
- SplashImage 10:, B H60 W150 X%cx% Y0 CW009933 C11 FM30 CTFFFFFF,,%selected%
- Break
- } else {
- SplashImage 10:, B H60 W150 X%cx% Y0 CWCC0000 C11 FM30 CTFFFFFF,,%selected%
- }
- Sleep, %delay%
- counter += 1
- }
- Sleep, 3000
- SplashImage 10: Off
- Return
- }
- createWordOrder(length) {
- BlockInput, On
- Loop, %length%
- {
- randomizeLetterOrder()
- Sleep, 750
- }
- BlockInput, Off
- Return
- }
- createWord(length) {
- BlockInput, On
- Loop, %length%
- {
- randomizeLetter()
- Sleep, 750
- }
- BlockInput, Off
- Return
- }
- randomizeLetterOrder() {
- BlockInput, On
- Random, start, 1, 26
- delay := 30
- counter := 0
- i := start
- Letters := []
- Loop, 26
- {
- Letters[A_Index] := Chr(A_Index + 96)
- }
- Loop {
- if (counter > 100) {
- Break
- }
- if (counter > 0) {
- SendInput, {Backspace}
- Sleep, 1
- }
- if (counter > 70 and counter < 90) {
- delay += 10
- }
- Letter := Letters[i]
- SendInput, %Letter%
- Sleep, %delay%
- counter += 1
- i += 1
- if (i > 26) {
- i := 1
- }
- }
- BlockInput Off
- Return
- }
- randomizeLetter() {
- BlockInput, On
- delay := 30
- counter := 0
- Letters := []
- Loop, 26
- {
- Letters[A_Index] := Chr(A_Index + 96)
- }
- Loop {
- if (counter > 100) {
- Break
- }
- if (counter > 0) {
- SendInput, {Backspace}
- Sleep, 1
- }
- if (counter > 70 and counter < 90) {
- delay += 10
- }
- Random, i, 1, 26
- Letter := Letters[i]
- SendInput, %Letter%
- Sleep, %delay%
- counter += 1
- }
- BlockInput Off
- Return
- }
- randomizeCharacter() {
- openPOE()
- WinGetPos,,,width,height
- characterX := [0.32292*width, 0.37*width, 0.4375*width, 0.503*width, 0.5625*width, 0.625*width, 0.675*width]
- characterY := [0.78703*height, 0.75*height, 0.73*height, 0.725*height, 0.73*height, 0.74*height, 0.78*height]
- Loop, 7 {
- cx := characterX[a_index]
- cy := characterY[a_index]
- SplashImage %a_index%:, B H40 W40 X%cx% Y%cy% CWCC0000
- }
- Sleep, 1000
- delay := 200
- counter := 0
- selected := 0
- Loop {
- if (counter > 40) {
- Break
- }
- if (counter > 20) {
- delay += 25
- }
- lastSelected := selected
- while (lastSelected == selected) {
- Random, selected, 1, 7
- }
- Loop, 7 {
- cx := characterX[a_index]
- cy := characterY[a_index]
- if (selected == a_index) {
- SplashImage %a_index%:, B H40 W40 X%cx% Y%cy% CW009933
- } else {
- SplashImage %a_index%:, B H40 W40 X%cx% Y%cy% CWCC0000
- }
- cx := *width
- cy := *height
- }
- Sleep, %delay%
- counter += 1
- }
- BlockInput On
- Sleep, 1000
- cx := characterX[selected]
- cy := characterY[selected]-100
- MouseClick, L, %cx%, %cy%, 2, 0
- Loop, 7 {
- SplashImage %a_index%: Off
- }
- Sleep, 2
- cx := 0.58*width
- cy := 0.9259*height
- MouseClick, L, %cx%, %cy%, 1, 0
- BlockInput Off
- Return
- }
- randomizeInventory() {
- openPOE()
- WinGetPos,,,width,height
- ; Main Hand Helmet Off Hand Plate Gloves Belt Boots Ring Left Ring Right Amulet
- slotX := [(1322/1920)*width, (1529/1920)*width, (1735/1920)*width, (1529/1920)*width, (1400/1920)*width, (1530/1920)*width, (1660/1920)*width, (1452/1920)*width, (1657/1920)*width, (1657/1920)*width]
- slotY := [(120/1080)*height, (105/1080)*height, (120/1080)*height, (225/1080)*height, (341/1080)*height, (395/1080)*height, (340/1080)*height, (276/1080)*height, (276/1080)*height, (211/1080)*height]
- slotW := [0.0572*width, 0.057*width, 0.0572*width, 0.0572*width, 0.0572*width, 0.056*width, 0.0555*width, 0.03*width, 0.03*width, 0.03*width]
- slotH := [0.2*height, 0.105*height, 0.2*height, 0.151*height, 0.105*height, 0.0542*height, 0.10452*height, 0.056*height, 0.056*height, 0.056*height]
- delay := 100
- counter := 0
- selected := 0
- c = 009933
- Loop {
- if (counter > 40) {
- c = CC0000
- }
- if (counter > 20) {
- delay += 20
- }
- lastSelected := selected
- while (lastSelected == selected) {
- Random, selected, 1, 10
- }
- sx := slotX[selected]
- sy := slotY[selected]
- sw := slotW[selected]
- sh := slotH[selected]
- sy2 := sy+sh-5
- sx4 := sx+sw
- SplashImage 1:, B X%sx% Y%sy% W%sw% H5 CW%c%
- SplashImage 2:, B X%sx% Y%sy2% W%sw% H5 CW%c%
- SplashImage 3:, B X%sx% Y%sy% W5 H%sh% CW%c%
- SplashImage 4:, B X%sx4% Y%sy% W5 H%sh% CW%c%
- if (counter > 40) {
- Break
- }
- Sleep, %delay%
- counter += 1
- }
- Sleep, 3000
- Loop, 10 {
- SplashImage %a_index%: Off
- }
- Return
- }
- randomizeFlasks() {
- openPOE()
- WinGetPos,,,width,height
- slotZeroX := (1458/1920)*width
- sy := (458/1080)*height
- sw := 0.03*width
- sh := 0.105*height
- delay := 100
- counter := 0
- selected := 0
- c = 009933
- Loop {
- if (counter > 25) {
- c = CC0000
- }
- if (counter > 10) {
- delay += 20
- }
- lastSelected := selected
- while (lastSelected == selected) {
- Random, selected, 1, 5
- }
- sx := slotZeroX + (sw-5)*(selected-1)
- sy2 := sy+sh-5
- sx4 := sx+sw-selected
- SplashImage 1:, B X%sx% Y%sy% W%sw% H5 CW%c%
- SplashImage 2:, B X%sx% Y%sy2% W%sw% H5 CW%c%
- SplashImage 3:, B X%sx% Y%sy% W5 H%sh% CW%c%
- SplashImage 4:, B X%sx4% Y%sy% W5 H%sh% CW%c%
- if (counter > 25) {
- Break
- }
- Sleep, %delay%
- counter += 1
- }
- Sleep, 3000
- Loop, 4 {
- SplashImage %a_index%: Off
- }
- Return
- }
- randomizeNode() {
- openPOE()
- nodeCounter := 0
- nw := 45
- nh := 50
- WinGetPos,,,width,height
- SplashImage 5:, B X200 Y200 W600 H30 CW000000 C11 FM10 CTFFFFFF,, "Mark all nodes by clicking on them. Press Enter to start randomizing."
- c = 009933
- Loop {
- if GetKeyState("Enter", "P")
- {
- KeyWait, Enter, L
- SendInput, {ENTER}
- Break
- }
- if GetKeyState("LButton", "P")
- {
- MouseGetPos, mousePosX, mousePosY
- nodeCounter += 1
- nodeX%nodeCounter% := mousePosX-25
- nodeY%nodeCounter% := mousePosY-25
- nx := nodeX%nodeCounter%
- ny := nodeY%nodeCounter%
- ny2 := ny+nh-5
- nx4 := nx+nw
- SplashImage 1:, B X%nx% Y%ny% W%nw% H5 CW%c%
- SplashImage 2:, B X%nx% Y%ny2% W%nw% H5 CW%c%
- SplashImage 3:, B X%nx% Y%ny% W5 H%nh% CW%c%
- SplashImage 4:, B X%nx4% Y%ny% W5 H%nh% CW%c%
- KeyWait, LButton, L
- }
- Sleep, 1
- }
- SplashImage 5: Off
- SplashImage 6: Off
- if (nodeCounter <= 1)
- {
- Return
- }
- counter := 0
- delay := 100
- selected := 0
- Loop {
- if (counter > 35) {
- c = CC0000
- }
- if (counter > 10) {
- delay += 20
- }
- lastSelected := selected
- while (lastSelected == selected) {
- Random, selected, 1, %nodeCounter%
- }
- nx := nodeX%selected%
- ny := nodeY%selected%
- ny2 := ny+nh-5
- nx4 := nx+nw
- SplashImage 1:, B X%nx% Y%ny% W%nw% H5 CW%c%
- SplashImage 2:, B X%nx% Y%ny2% W%nw% H5 CW%c%
- SplashImage 3:, B X%nx% Y%ny% W5 H%nh% CW%c%
- SplashImage 4:, B X%nx4% Y%ny% W5 H%nh% CW%c%
- if (counter > 35) {
- Break
- }
- Sleep, %delay%
- counter += 1
- }
- Sleep, 3000
- Loop, 4 {
- SplashImage %a_index%: Off
- }
- Return
- }
Advertisement
Add Comment
Please, Sign In to add comment