numSkills = 4; manaTimer = 35; hitTimer = 90; manaPot = key.VK_F1; hitPot = key.VK_F2; loot = key.VK_F3; findTarget = key.VK_TAB; resetKey = key.VK_HOME; attack = key.VK_E; setStartKey(key.VK_DELETE); setStopKey(key.VK_END); resetStatus = false; 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 cprintf(cli.lightgreen,"\nThe mana pot timer is currently set to %d seconds.\nIs this correct? (y/n) ",manaTimer); while true do local uchoice = io.stdin:read(); if string.lower(uchoice) == "n" then cprintf(cli.lightgreen,"How long should the mana pot quaff interval be? (in seconds)") local settingChoice = true; while settingChoice do local uchoice = tonumber(io.stdin:read()); if uchoice and type(uchoice) == "number" and uchoice <= 1000 and uchoice >= 6 then manaTimer = uchoice; cprintf(cli.lightgreen,"The mana pot timer has been changed to %d seconds.\n",manaTimer); settingChoice = false; else cprintf(cli.lightred,"Invalid input, try again (in seconds): "); 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 cprintf(cli.lightgreen,"\nThe HP pot timer is currently set to %d seconds.\nIs this correct? (y/n) ",hitTimer); while true do local uchoice = io.stdin:read(); if string.lower(uchoice) == "n" then cprintf(cli.lightgreen,"How long should the HP pot quaff interval be? (in seconds)") local settingChoice = true; while settingChoice do local uchoice = tonumber(io.stdin:read()); if uchoice and type(uchoice) == "number" and uchoice <= 1000 and uchoice >= 6 then hitTimer = uchoice; cprintf(cli.lightgreen,"The HP pot timer has been changed to %d seconds.\n",hitTimer); settingChoice = false; else cprintf(cli.lightred,"Invalid input, try again (in seconds): "); 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 resetStatus = false; cprintf(cli.yellow,"Training the first %d skills from 1-10.\nQuaffing mana pots every %d seconds.\nQuaffing HP pots every %d seconds.",numSkills,manaTimer,hitTimer); end newTimer("QuaffMana"); newTimer("QuaffHit"); function main() cprintf(cli.yellow,"Eligium skill trainer bot.\n"); cprintf(cli.yellow," to Pause, to Resume, to Reset\n"); cprintf(cli.yellow,"Please verify default setings.\n"); setTrainer(); attach( findWindow("Eligium*") ); startTimer("QuaffMana",manaTimer*1000); startTimer("QuaffHit",hitTimer*1000); while true do if resetStatus then setTrainer(); end skillSpam(); if isTriggered("QuaffMana") then for i=1,10,1 do if keyPressed( resetKey ) then resetStatus = true; end yrest(100); end keyboardPress( manaPot ); startTimer("QuaffMana",manaTimer*1000); yrest(200) end if isTriggered("QuaffHit") then for i=1,10,1 do if keyPressed( resetKey ) then resetStatus = true; end yrest(100); end keyboardPress( hitPot ); startTimer("QuaffHit",hitTimer*1000); yrest(200) end end detach(); end startMacro(main,true);