Advertisement
Guest User

Torchlight II Auto-fishing by Wiking

a guest
Apr 10th, 2015
934
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
  3. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  4.  
  5. ;==================================================================
  6.  
  7. ;TORCHLIGHT 2 FISHING AHK SCRIPT BY WIKING
  8.  
  9. ;V0.8 - working
  10. ;efficiency:
  11. ;~8/10 fishes during day/night
  12. ;~7/10 fishes during transition time when shadows move
  13.  
  14. ;controls:
  15. ;F5 to start fishing
  16. ;P hold for 5s+ to stop fishing
  17. ;F6 to start/stop color and coordinate find
  18. ;F7 to copy color and coordinate values to clipboard
  19.  
  20. ;==================================================================
  21.  
  22.  
  23. ;**************************************************************
  24.  
  25. ;***********************Fishing Script*************************
  26. F5::
  27. loop {
  28.     PixelSearch, Px, Py, 780, 493, 811, 539, 0x80798F, 20, Fast         ;search box coordinates go here x1, y1, x2, y2, color, shades, speed
  29.         GetKeyState, state, P
  30.             if state = D
  31.             {
  32.             ToolTip
  33.             break
  34.             }
  35.         else{  
  36.             if ErrorLevel
  37.                 {
  38.                 ToolTip SEARCHING
  39.                 MouseMove, 955, 444                                         ;clicks on the fishing hole
  40.                 Sleep 200
  41.                 Send, {LButton down}
  42.                 Sleep 100
  43.                 Send, {LButton up}
  44.                 Sleep 200
  45.                 }
  46.             else
  47.                 {
  48.                 ToolTip MATCH
  49.                 sleep 20
  50.                 MouseMove, 1680/2, 1050/2                                   ;clicks on the centre of the screen, aka catch fish
  51.                 Sleep 40
  52.                 Send, {LButton down}
  53.                 Sleep 40
  54.                 Send, {LButton up}
  55.                 Sleep 100
  56.                 MouseMove, 955, 444                                         ;clicks on the fishing hole
  57.                 Sleep 3000
  58.                 Send, {LButton down}
  59.                 Sleep 100
  60.                 Send, {LButton up}
  61.                 Sleep 100
  62.                 }
  63.             }
  64.     }
  65. return
  66. ;**************************************************************
  67.  
  68. ;***********************Get Color**************************
  69. ;F6  = Start stop Color Detection
  70. ;F7 = Copy currently color to clipboard
  71. ;***********************************************************
  72.  
  73. #MaxThreadsPerHotkey 2
  74.  
  75. F6::
  76. Toggle := !Toggle
  77. While Toggle {
  78.     MouseGetPos Xpos, Ypos
  79.     PixelGetColor Colour, %Xpos%, %Ypos%, RGB
  80.     StringTrimLeft Colour, Colour, 2                    ; Remove 0x
  81.     ToolTip %Colour% X%Xpos% Y%Ypos%
  82.     }
  83. ToolTip
  84. Return
  85.  
  86. F7::
  87. StringTrimLeft Colour, Colour, 2                    ; Remove 0x
  88. Clipboard = %Colour% X%Xpos% Y%Ypos%
  89. ToolTip Copied to the clipboard:`n%Colour% X%Xpos% Y%Ypos%
  90. Sleep 3000
  91. ToolTip %Colour%
  92. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement