Koenrad

LL Chest Collector

Oct 31st, 2013
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;This script will run from monsters and collect chests in Last Life.
  2. ;When you get to the top of the map, the script will teleport home.
  3. ;Start the script at 250S 249W Vandora (1 space east of Muerte)
  4. ;You will land in Inari and Arcadia on this journey
  5. ;@auth koenrad
  6.  
  7.  
  8. ;alt+p pauses/unpauses script
  9. !p::Pause
  10.  
  11. ;alt+w starts the script
  12. !w::
  13.  
  14. Loop, 72{
  15. ;you will land in Inari and Arcadia
  16.  
  17.     ;Go Right
  18.     Loop, 498 {
  19.         Send {right}
  20.         Sleep 200
  21.         ImageSearch,FoundX,FoundY,868,294,1125,570,*150 spell.jpg
  22.         if (ErrorLevel = 2)
  23.             MsgBox Fail 1
  24.         else if (ErrorLevel = 1){
  25.             ;MsgBox not in fight
  26.             }
  27.         else{
  28.             Send r
  29.             Sleep 800
  30.             }
  31.  
  32.         ;Search for chests
  33.         PixelSearch, Px1, Py1, 686,211,1269,793, 0x496898, 3, Fast
  34.         if (ErrorLevel = 0)
  35.             {
  36.                 PixelSearch, Px2, Py2, Px1-20, Py1-20, Px1+20, Py1+20, 0x4D70A3, 3, Fast
  37.                 if (ErrorLevel = 0) {      
  38.                         MouseMove, %Px2%, %Py2%
  39.                         Click
  40.                     }
  41.             }
  42.  
  43.         ImageSearch,FoundX,FoundY,628,134,1335,512,*150 inari.jpg
  44.         if (ErrorLevel = 2)
  45.             MsgBox Fail 3
  46.         else if (ErrorLevel = 0){
  47.             click 179, 437
  48.             Sleep 500
  49.             }
  50.            
  51.         ImageSearch,FoundX,FoundY,628,134,1335,512,*200 arcadia.jpg
  52.         if ErrorLevel = 2
  53.             MsgBox Fail 4
  54.         else if (ErrorLevel = 0){
  55.             click 179, 437
  56.             Sleep 500
  57.             }
  58.     }
  59.  
  60.     ;Go 7 up
  61.     Loop, 7 {
  62.         Send {up}
  63.         Sleep 1500
  64.         ImageSearch,FoundX,FoundY,868,294,1125,570,*150 spell.jpg
  65.         if (ErrorLevel = 2)
  66.             exit
  67.         else if (ErrorLevel = 0){
  68.             Send r
  69.             Sleep 800
  70.             }
  71.         else
  72.  
  73.         ;Search for chests
  74.         PixelSearch, Px1, Py1, 686,211,1269,793, 0x496898, 3, Fast
  75.         if (ErrorLevel = 0)
  76.             {
  77.                 PixelSearch, Px2, Py2, Px1-20, Py1-20, Px1+20, Py1+20, 0x4D70A3, 3, Fast
  78.                 if (ErrorLevel = 0) {      
  79.                         MouseMove, %Px2%, %Py2%
  80.                         Click
  81.                     }
  82.             }
  83.     }
  84.  
  85.  
  86.     ;Go Left
  87.     Loop, 500 {
  88.         Send {left}
  89.         Sleep 200
  90.         ImageSearch,FoundX,FoundY,868,294,1125,570,*150 spell.jpg
  91.         if (ErrorLevel = 2)
  92.             MsgBox Fail 1
  93.         else if (ErrorLevel = 1){
  94.             ;MsgBox not in fight
  95.             }
  96.         else{
  97.             Send r
  98.             Sleep 800
  99.             }
  100.  
  101.         ;Search for chests
  102.         PixelSearch, Px1, Py1, 686,211,1269,793, 0x496898, 3, Fast
  103.         if (ErrorLevel = 0)
  104.             {
  105.                 PixelSearch, Px2, Py2, Px1-20, Py1-20, Px1+20, Py1+20, 0x4D70A3, 3, Fast
  106.                 if (ErrorLevel = 0) {      
  107.                         MouseMove, %Px2%, %Py2%
  108.                         Click
  109.                     }
  110.                 else{
  111.                  ;MsgBox not found 2
  112.                  }
  113.             }
  114.         else{
  115.             ;MsgBox not found 1
  116.             }
  117.  
  118.         ImageSearch,FoundX,FoundY,628,134,1335,512,*150 inari.jpg
  119.         if (ErrorLevel = 2)
  120.             MsgBox Fail 3
  121.         else if (ErrorLevel = 0){
  122.             click 140, 437
  123.             Sleep 500
  124.             }
  125.            
  126.         ImageSearch,FoundX,FoundY,628,134,1335,512,*200 arcadia.jpg
  127.         if ErrorLevel = 2
  128.             MsgBox Fail 4
  129.         else if (ErrorLevel = 0){
  130.             click 140, 437
  131.             Sleep 500
  132.             }
  133.     }
  134.  
  135.     ;Go 7 up
  136.     Loop, 7 {
  137.         Send {up}
  138.         Sleep 1500
  139.         ImageSearch,FoundX,FoundY,868,294,1125,570,*150 spell.jpg
  140.         if (ErrorLevel = 2)
  141.             exit
  142.         else if (ErrorLevel = 0){
  143.             Send r
  144.             Sleep 800
  145.             }
  146.         else
  147.  
  148.         ;Search for chests
  149.         PixelSearch, Px1, Py1, 686,211,1269,793, 0x496898, 3, Fast
  150.         if (ErrorLevel = 0)
  151.             {
  152.                 PixelSearch, Px2, Py2, Px1-20, Py1-20, Px1+20, Py1+20, 0x4D70A3, 3, Fast
  153.                 if (ErrorLevel = 0) {      
  154.                         MouseMove, %Px2%, %Py2%
  155.                         Click
  156.                     }
  157.             }
  158.     }
  159.  
  160. }
  161. Click 153, 259
Advertisement
Add Comment
Please, Sign In to add comment