Heroes of Gaia Wiki
Register
Advertisement

Notes

  • This macro will use your hero in your main castle to go after 5 star resource piles and above continuously (Enormous piles). It does not filter between resource types.
    • The macro only works with 1 hero active at one time. Multiple heroes on the map at once may cause problems for the macro.
  • All X values need 1680 subtracted out for single 1280x1024 displays.
    • Macro was designed to be used with a primary display of 1680x1050 and a secondary (to the right) display of 1280x1024
  • Lag effect macro drastically, you may need to inset extra delay in places
constants
 HeroFindingStuff = 0
 EnormousY = 0
 EnormousTemp = 0
 CurrentPage = 1
 MaxPages = 10
end

procedure OpenFind
 MousePos 2604, 325
 delay 200
 leftclick
 //server lags
 delay 2 sec
end

procedure CloseFind
 MousePos 2543, 336
 delay 200
 leftclick 
end

procedure ClickResourceTab
 MousePos 2292, 387
 delay 1 sec
 leftclick
 compute CurrentPage = 1
 delay 2 sec
end

procedure ClickNextResource
 MousePos 2501, 418
 delay 500
 leftclick
 compute CurrentPage = $CurrentPage + 1
 delay 1 sec
end

procedure AttackLocation
 MousePos 2321, 698
 delay 500
 leftclick
 //insert more delay here if server laggy
 delay 1 sec
 MousePos 2261, 730
 delay 1 sec
 leftclick
 delay 2 sec
end

procedure CheckHero
 //red box around hero 1
 //136,9,0
 LoadRGB 2660, 510
 
 if {RGBRed} > 130 and {RGBGreen} < 20 and {RGBBlue} < 10
  Compute HeroFindingStuff = 1
 else
  Compute HeroFindingStuff = 0
 end 
end

procedure FindEnormous
//Stuff about finding Enormous upper right of s
//base location = 2171, 476
//color = 255,255,255
//offset between each s = 28 pixels
//view is 265px away from s
 Compute EnormousY = 0
 Compute EnormousTemp = 478
 while $EnormousTemp < 760
  LoadRGB 2167, $EnormousTemp
  if {RGBRed} >= 253 and {RGBGReen} >= 253 and {RGBBlue} >= 253
   Compute EnormousY = $EnormousTemp
   //kill loop
   Compute EnormousTemp = 1000
  end
  //artificial delay
  delay 10
  Compute EnormousTemp = $EnormousTemp + 2
 end
end

procedure ClickView
 if $EnormousY > 0
  MousePos 2436, $EnormousY
  delay 500
  leftclick
 end
end

 call CheckHero
 

//Main Loop
loop 50000
 call CheckHero
 //wait until hero is done
 while $HeroFindingStuff = 1
  delay 10 sec
  call CheckHero
 end
 //hero is no longer finding anything, give server some time to update stuff
 delay 2 sec
 call OpenFind
 call ClickResourceTab
 //number of pages to search
 while $CurrentPage < $MaxPages
  call FindEnormous
  //if enormous was found do the fight
  if $EnormousY > 0
   call ClickView
   delay 1 sec
   call AttackLocation
   //kill loop
   compute $CurrentPage = 1000
  else
   call ClickNextResource
  end 
 end
 delay 2 sec
 call CloseFind
 delay 3 sec
end
Advertisement