numSkills = 3; manaPot = key.VK_F1; hitPot = key.VK_F2; loot = key.VK_F3; findTarget = key.VK_TAB; resetKey = key.VK_HOME; attack = key.VK_E; buffTimer = 600; buff = key.VK_F8; quaffTimer = 2.5; setStartKey(key.VK_DELETE); setStopKey(key.VK_END); resetStatus = false; key.VK_LMOUSE = 1; key.VK_RMOUSE = 2; key.VK_MMOUSE = 4; local bar = {Color = cli.white, hpColor = cli.white, mpColor = cli.white} local mPos = { hpBar = {0,0}, mpBar = {0,0} } win = findWindow("Eligium*"); function MouseInfoSet(vBar) local gettingColor = true; while gettingColor do printf("\nUse alt-tab to switch screens, then click on the %s bar where you want to quaff pots.\n", vBar); local gettingMousePos = true; while gettingMousePos do if keyPressed( key.VK_LMOUSE ) or keyPressed ( key.VK_RMOUSE ) then x2,y2,h2,w2 = windowRect( win ); hdc = openDC( win ); x,y = mouseGetPos(); y = y-y2-1; x = x-x2-1; printf("mouse_x: %d, mouse_y: %d\n", x, y); r,g,b = getPixel(hdc, x, y); printf("RGB: %d, %d, %d\n", r, g, b); gettingMousePos = false; yrest(1000); closeDC(hdc); flashWindow(); end yrest(100); end if r > b and r > g then cprintf(cli.yellow,"Dominant color is Red -- is this correct? (y/n) "); elseif b > g then cprintf(cli.yellow,"Dominant color is Blue -- is this correct? (y/n) "); else cprintf(cli.yellow,"Dominant color is Green -- is this correct? (y/n) "); end local verifyChoice = true; while verifyChoice do local uchoice = io.stdin:read(); if string.lower(uchoice) == "n" then cprintf(cli.yellow,"User indicated an error occured, please try again."); verifyChoice = false; elseif string.lower(uchoice) == "y" then cprintf(cli.yellow,"User accepted mouse collected data.\n"); verifyChoice = false; gettingColor = false; else cprintf(cli.yellow,"Invalid choice, please try again. (y/n) "); end end end bar[vBar .. "Color"] = makeColor(r,g,b); mPos[vBar .. "Bar"] = {x,y}; end function checkPots() hdc = openDC( win ); x = mPos.hpBar[1]; y = mPos.hpBar[2]; r,g,b = getPixel(hdc, x, y); bar.Color = makeColor( r, g, b); if not colorMatch( bar.Color, bar.hpColor, 50) then printf("Quaffing HP Potion.\n"); keyboardPress( hitPot ); yrest(100); -- quaff hp end x = mPos.mpBar[1]; y = mPos.mpBar[2]; r,g,b = getPixel(hdc, x, y); bar.Color = makeColor( r, g, b); if not colorMatch( bar.Color, bar.mpColor, 50) then printf("Quaffing MP Potion.\n"); keyboardPress( manaPot ); yrest(100); -- quaff mp end closeDC(hdc); end function skillSpam() keyboardPress( findTarget ); yrest(200); keyboardPress( attack ); yrest(200); for i=1,numSkills,1 do if keyPressed( resetKey ) then resetStatus = true; end keyboardPress( key["VK_" .. i] ); yrest(100); keyboardPress( loot ); yrest(100); end end function setTrainer() cprintf(cli.lightgreen,"\nNumber of skills being used is %d.\nIs this correct? (y/n) ",numSkills); while true do local uchoice = io.stdin:read(); if string.lower(uchoice) == "n" then cprintf(cli.lightgreen,"How many skills are being used? (0-9)") local settingChoice = true; while settingChoice do local uchoice = tonumber(io.stdin:read()); if uchoice and type(uchoice) == "number" and uchoice <= 10 and uchoice > 0 then numSkills = uchoice; cprintf(cli.lightgreen,"Number of skills being used changed to %d.\n",numSkills); settingChoice = false; else cprintf(cli.lightred,"Invalid input, try again (1-10): "); end end if settingChoice == false then break end; elseif string.lower(uchoice) == "y" then cprintf(cli.lightgreen,"Default accepted.\n"); break; else cprintf(cli.lightred,"Invalid input, try again (y/n): "); end end MouseInfoSet("hp"); MouseInfoSet("mp"); resetStatus = false; cprintf(cli.yellow,"Fighting with the first %d skills from 1-10.\n",numSkills); end newTimer("Quaff"); newTimer("Quaffbuff"); function main() cprintf(cli.yellow,"Eligium bot.\n"); cprintf(cli.yellow," to Pause, to Resume, to Reset\n"); cprintf(cli.yellow,"Please verify default setings.\n"); setTrainer(); attach( win ); startTimer("Quaff",quaffTimer*1000); startTimer("Quaffbuff",buffTimer*1000); while true do if resetStatus then setTrainer(); end skillSpam(); if isTriggered("Quaff") then for i=1,10,1 do if keyPressed( resetKey ) then resetStatus = true; end yrest(100); end checkPots(); startTimer("Quaff",quaffTimer*1000); yrest(200) end if isTriggered("Quaffbuff") then for i=1,10,1 do if keyPressed( resetKey ) then resetStatus = true; end yrest(100); end keyboardPress( buff ); startTimer("Quaffbuff",buffTimer*1000); yrest(200) end end detach(); end startMacro(main,true);