Hi Guys,
this script went from a really basic one to an easy configurable for several porposes.
What's planned
Changelog
Instructions:
Configuration - config.lua
You can configure this pretty easy. Just make sure you follow the instructions.
The Script - EMPC1.3a.lua - Do not touch any of the code below, if you don't know what you're doing.
Greetings
this script went from a really basic one to an easy configurable for several porposes.
What's planned
- Updating onBattleAction when using 'False Swipe'
- Adding use of synchronized status alignments
- Adding 'Rpleplay' support
- Uploading example configurations
- Fixing possible issues like:
- You need to go mapA then mapB then again mapA but another entrance
- moveToFrikinWater() won't work
- You need to go mapA then mapB then again mapA but another entrance
Changelog
-- 1.0 Initial: Catch 1 Pokemon: PokeCenter <-> City <-> Route
-- 1.1 Added several counters, logmessages and more possible Pokemon to catch
-- 1.2 Added several configurations, tweaks and dokumentation
-- 1.2a Added bikesupport and stops between catchplace and rest place
-- 1.2b Deleted bikesupport because of accompanied bugs
-- 1.2c Small tweaks
-- 1.3 Added ground/cave/water support and updated moving between stops
-- 1.3a Bugfixes
-- 1.3b Seperated config.lu and script.lua
-- 1.4 Added working and famous 'Bellsprout-exception', updated onBattleAction and lots of tweaks
-- 1.5 Added Any-Mount-Suppot, some tweaks
Instructions:
- Make a new folder for this script
- Copy the configuration and save it as "config.lua"
- Copy the ExpShare script and save it as "EMPC1.3a.lua"
- Change the configuration file to fit your needs
- Load ans start the script at any configured keylocation and enjoy
Configuration - config.lua
You can configure this pretty easy. Just make sure you follow the instructions.
-- **************************** Configuration ****************************
-- ***********************************************************************
-- Leaving something 'blank' always means means: ""
-- Please specify which Pokemon(s) you want to catch,
-- leave not used blank and fill from top to bottom:
poke1 = "Pidgey"
poke2 = ""
poke3 = ""
poke4 = ""
poke5 = ""
-- Please specify which special Pokemon you want to catch,
-- they won't be attacked, just catched with Balls of quality you like:
pokeball = true
greatball = false
ultraball = false
special1 = ""
special2 = ""
-- Please specify if you want to catch uncaught and shinys:
catchNotCaught = true
catchShinys = true
-- Please specifiy keylocations:
mobileNurse = false -- if you're using a standing around 'Nurse Joy' i.e. Pokemon Tower F5 make it true
pokeCenter = "Pokecenter Vermilion" -- place the name of PokeCenter OR mapname where mobile nurse stays
restPlace = "Vermilion City" -- place the mapname where PokeCenter is located here OR if you're using a mobile nurse leave it blank
stop1 = "" -- 1st stop from pokeCenter/restPlace to catchPlace, if unused leave it blank
stop2 = "" -- 2st stop
stop3 = "" -- 3st stop
stop4 = "" -- 4st stop
stop5 = "" -- 5st stop
catchPlace = "Route 6" -- place the final destination here, even if its placed before in pokeCenter or restPlace
-- Please specifiy grass, water or cave/ground (i.e. Mt. Moon or Poke Tower)
-- BEWARE thet only ONE can be true, so make sure you don't make a mistake:
grass = true
water = false
caveground = false
-- You have to some work here if caveground = true:
-- 1.) go to the room/catchPlace
-- 2.) go to the top left of this room and type '/loc' then note minX and minY
-- 3.) go to the bottom right of this room and type '/loc' then note maxX and maxY
-- ATTENTION the rectangle you're creating with this should NOT include
-- ladders, ports, doors or something like that
minX = 0
minY = 0
maxX = 0
maxY = 0
-- Please specify which weak move you want to use,
-- your 1st Pokemon will use it until enemy is under 50% HP:
-- (or at 1 HP if you're using 'False Swipe' -- not implementet yet)
move = "Dragon Rage"
-- Please specifiy if you want to use a mount and which one:
mountUse = true
mount = "Bicycle" -- every mount possible
-- Please specify if you want to use synchronized status alignments:
synchronize = false -- not implemented yet
-- Please specify if you need money from crap Pokemon, this will take a bit longer than 'only catch':
earnMoney = false
-- Please specify if you wanna use Pokeball Buyer:
buyBalls = false -- not implemented yet
-- The bot will use your Bike, if you have one. -- REMOVED THIS ONE, UPDATE INCOMING
-- Please specify if you want to recieve private messages:
privateMessage = true
-- ***********************************************************************
-- ***********************************************************************
The Script - EMPC1.3a.lua - Do not touch any of the code below, if you don't know what you're doing.
name = "EMPC 1.5"
author = "Elunius"
description = "This is Elunius' Multipurpose-Catcher and it does what you configured."
dofile "config.lua"
function onStart()
encounter = 0
poke1counter = 0
poke2counter = 0
poke3counter = 0
poke4counter = 0
poke5counter = 0
special1counter = 0
Special2counter = 0
shinyCounter = 0
allCatch = 0
poke1catch = 0
poke2catch = 0
poke3catch = 0
poke4catch = 0
poke5catch = 0
special1catch = 0
Special2catch = 0
shinyCatch = 0
pokecenterCounter = 0
startMoney = getMoney()
log("=======================================")
log("This Script will catch the configured Pokemon for you.")
if special1 ~= "" and special2 ~= "" then
log("It also throws Balls at Shinys, " ..special1.. " and " ..special2.. " for you.")
elseif special1 ~= "" and special2 == "" then
log("It also throws Balls at Shinys and " ..special1.. " for you.")
elseif special1 == "" and special2 == "" then
log("It also throws Balls at Shinys for you.")
end
log("The Pokemon with '" ..move.. "' should be in 1st place.")
if earnMoney == true then
log("You will farm Pokedollar from crappy Pokemon.")
else
log("You choosed the fast way and will flee from all crappy Pokemon.")
end
if buyBalls == false then
log("Please make sure you got enough Pokeballs with you.")
end
if privateMessage == false then
if isPrivateMessageEnabled() then
log("Private messages disabled.")
disablePrivateMessage()
end
else log("Private messages are enabled.")
end
log("=======================================")
end
function RunningTime()
RunTime = math.floor(os.clock())
if (RunTime / 60) < 60 then -- is less than 1 hr
return log("Running Bot Time: " .. math.floor(RunTime / 60) .. " Minutes.")
else --more than 1 hr
local hr = math.floor((RunTime / 60) / 60)
return log("Running Bot Time: " .. hr .. " Hours and " .. (math.floor(RunTime / 60) - (hr * 60)) .. " Minutes.")
end
end
function bellsproutException()
function onBattleMessage(wrapped)
if stringContains(wrapped, "wrapped")then
-- return anyMove()
return attack() or fatal("You got wrapped - relog and start from Pokemon Center.")
end
end
end
function onPathAction()
-- False swiper status recover
-- if (getPokemonStatus(2)=="PAPALYZE" or getPokemonStatus(2)=="POISON") and getItemQuantity("Lum Berry")>0 then
-- return useItemOnPokemon("Lum Berry", pkmn#)
-- end
-- Pokeball Conditions
if getItemQuantity("Pokeball") < 5 then
-- if buyBalls = true then
-- things()
-- elseif
fatal("BOT HAS STOPPED - You dont have enough Pokeballs with you, go and get some!")
-- end
-- Mounting
elseif not isMounted() and mountUse == true and hasItem(mount) and not isSurfing() and isOutside() then
return useItem(mount)
-- Pokemon Center Conditions
elseif isPokemonUsable(1) and getRemainingPowerPoints(1,move) > 1 then
-- Way there
if getMapName() == pokeCenter then
if restPlace ~= catchPlace and restPlace ~= "" then
moveToMap(restPlace)
elseif stop1 ~= "" and restPlace == "" then
moveToMap(stop1)
elseif pokeCenter ~= catchPlace and restPlace == "" and stop1 == "" then
moveToMap(catchPlace)
elseif pokeCenter ~= catchPlace and restPlace ~= "" then
moveToMap(restPlace)
else
if grass == true then
moveToGrass()
elseif water == true then
moveToWater()
elseif caveground == true then
moveToRectangle(minX, minY, maxX, maxY)
end
end
elseif getMapName() == restPlace and restPlace ~= catchPlace then
if stop1 ~= "" then
moveToMap(stop1)
else
moveToMap(catchPlace)
end
elseif getMapName() == stop1 then
if stop2 ~= "" then
moveToMap(stop2)
else
moveToMap(catchPlace)
end
elseif getMapName() == stop2 then
if stop3 ~= "" then
moveToMap(stop3)
else
moveToMap(catchPlace)
end
elseif getMapName() == stop3 then
if stop4 ~= "" then
moveToMap(stop4)
else
moveToMap(catchPlace)
end
elseif getMapName() == stop4 then
if stop5 ~= "" then
moveToMap(stop5)
else
moveToMap(catchPlace)
end
elseif getMapName() == stop5 then
moveToMap(catchPlace)
elseif getMapName() == catchPlace then
if grass == true then
moveToGrass()
elseif water == true then
moveToWater()
elseif caveground == true then
moveToRectangle(minX, minY, maxX, maxY)
end
end
-- Way home
else
if getMapName() == catchPlace then
if stop5 ~= "" then
moveToMap(stop5)
elseif stop4 ~= "" and stop5 == "" then
moveToMap(stop4)
elseif stop3 ~= "" and stop4 == "" then
moveToMap(stop3)
elseif stop2 ~= "" and stop3 == "" then
moveToMap(stop2)
elseif stop1 ~= "" and stop2 == "" then
moveToMap(stop1)
elseif restPlace ~= "" and stop1 == "" then
moveToMap(restPlace)
elseif pokeCenter ~= "" and restPlace == "" then
moveToMap(pokeCenter)
elseif pokeCenter == catchPlace then
talkToNpc("Nurse Joy")
end
elseif getMapName() == stop5 then
moveToMap(stop4)
elseif getMapName() == stop4 then
moveToMap(stop3)
elseif getMapName() == stop3 then
moveToMap(stop2)
elseif getMapName() == stop2 then
moveToMap(stop1)
elseif getMapName() == stop1 then
if restPlace ~= "" then
moveToMap(restPlace)
else
moveToMap(pokeCenter)
end
elseif getMapName() == restPlace then
moveToMap(pokeCenter)
elseif getMapName() == pokeCenter then
if mobileNurse == false then
usePokecenter()
elseif mobileNurse == true then
talkToNpc("Nurse Joy")
end
end
end
end
function onBattleAction()
encounter = encounter + 1
-- Enemy is on catchlist
if getOpponentName() == poke1
or getOpponentName() == poke2
or getOpponentName() == poke3
or getOpponentName() == poke4
or getOpponentName() == poke5
or (catchNotCaught == true and not isAlreadyCaught() and not isOpponentShiny()) then
-- Weakens enemy then catch or kill if #1 is dead
if isPokemonUsable(1) then
if getOpponentHealthPercent() > 50 then
if getRemainingPowerPoints(1, move) ~= 0 then
return useMove(move)
else return useItem("Pokeball") or attack() or bellsproutException() or sendUsablePokemon() or run()
end
else
return useItem("Pokeball") or attack() or bellsproutException() or sendUsablePokemon() or run()
end
else
return attack() or bellsproutException() or sendUsablePokemon() or run()
end
-- Enemy is on special-catchlist
elseif getOpponentName() == special1 or getOpponentName() == special2 then
if ultraball == true and greatball == true and pokeball == true then
return useItem("Ultra Ball") or useItem("Great Ball") or useItem("Pokeball") or attack() or bellsproutException() or sendUsablePokemon() or run()
elseif ultraball == true and greatball == true and pokeball == false then
return useItem("Ultra Ball") or useItem("Great Ball") or attack() or bellsproutException() or sendUsablePokemon() or run()
elseif ultraball == true and greatball == false and pokeball == true then
return useItem("Ultra Ball") or useItem("Pokeball") or attack() or bellsproutException() or sendUsablePokemon() or run()
elseif ultraball == false and greatball == true and pokeball == true then
return useItem("Great Ball") or useItem("Pokeball") or attack() or bellsproutException() or sendUsablePokemon() or run()
elseif ultraball == true and greatball == false and pokeball == false then
return useItem("Ultra Ball") or attack() or bellsproutException() or sendUsablePokemon() or run()
elseif ultraball == false and greatball == true and pokeball == false then
return useItem("Great Ball") or attack() or bellsproutException() or sendUsablePokemon() or run()
elseif ultraball == false and greatball == false and pokeball == true then
return useItem("Pokeball") or attack() or bellsproutException() or sendUsablePokemon() or run()
else
return attack() or bellsproutException() or sendUsablePokemon() or run()
end
-- Enemy is shiny
elseif catchShinys == true and isOpponentShiny()
and not (getOpponentName() == special1 or getOpponentName() == special2) then
if isPokemonUsable(1)then
if getOpponentHealthPercent() > 50 then
if getRemainingPowerPoints(1, move) ~= 0 then
return useMove(move)
else
return useItem("Ultra Ball") or useItem("Great Ball") or useItem("Pokeball")
or attack() or bellsproutException() or sendUsablePokemon() or run()
end
else
return useItem("Ultra Ball") or useItem("Great Ball") or useItem("Pokeball")
or attack() or bellsproutException() or sendUsablePokemon() or run()
end
else
return attack() or bellsproutException() or sendUsablePokemon() or run()
end
-- Enemy is crap
else
if earnMoney == true then
return attack() or bellsproutException() or sendUsablePokemon() or run()
else
return run() or attack() or bellsproutException() or sendUsablePokemon()
end
end
end
function onBattleMessage(message)
-- Catchlist encounters and caughts
if stringContains(message, "A Wild") and stringContains(message, poke1) then
poke1counter = poke1counter + 1
elseif stringContains(message, "caught") and stringContains(message, poke1) then
poke1catch = poke1catch + 1
allCatch = allCatch + 1
elseif stringContains(message, "A Wild") and stringContains(message, poke2) then
poke2counter = poke2counter + 1
elseif stringContains(message, "caught") and stringContains(message, poke2) then
poke2catch = poke2catch + 1
allCatch = allCatch + 1
elseif stringContains(message, "A Wild") and stringContains(message, poke3) then
poke3counter = poke3counter + 1
elseif stringContains(message, "caught") and stringContains(message, poke3) then
poke3catch = poke3catch + 1
allCatch = allCatch + 1
elseif stringContains(message, "A Wild") and stringContains(message, poke4) then
poke4counter = poke4counter + 1
elseif stringContains(message, "caught") and stringContains(message, poke4) then
poke4catch = poke4catch + 1
allCatch = allCatch + 1
elseif stringContains(message, "A Wild") and stringContains(message, poke5) then
poke5counter = poke5counter + 1
elseif stringContains(message, "caught") and stringContains(message, poke5) then
poke5catch = poke5catch + 1
allCatch = allCatch + 1
-- Special-catchlist encounters and caughts
elseif stringContains(message, "A Wild") and stringContains(message, special1) then
special1counter = special1counter + 1
elseif stringContains(message, "caught") and stringContains(message, special1) then
special1catch = special1catch + 1
allCatch = allCatch + 1
elseif stringContains(message, "A Wild") and stringContains(message, special2) then
special2counter = special2counter + 1
elseif stringContains(message, "caught") and stringContains(message, special2) then
special2catch = special2catch + 1
allCatch = allCatch + 1
-- Shiny encounters and caughts
elseif stringContains(message, "A Wild SHINY") then
shinyCounter = shinyCounter + 1
elseif stringContains(message, "caught") and stringContains(message, "SHINY") then
shinyCatch = shinyCatch + 1
allCatch = allCatch + 1
end
end
function onDialogMessage(pokecenter)
if stringContains(pokecenter, "heal your Pokemon?") then
pokecenterCounter = pokecenterCounter + 1
end
end
function onPause()
recentMoney = getMoney()
log("=======================================")
log("Pokecenter visits: " .. pokecenterCounter)
log("You have encountered " ..encounter.. " Pokemon and catched " ..allCatch.. " Pokemon.")
if earnMoney == true then
log("You have earned ".. tostring(recentMoney - startMoney) .." PokeDollars so far!")
end
RunningTime()
log("=======================================")
end
function onResume()
log("=======================================")
end
function onStop()
endMoney = getMoney()
log("=======================================")
log("Pokecenter visits: " .. pokecenterCounter)
log("You have encountered " ..encounter.. " Pokemon and catched " ..allCatch.. " Pokemon.")
if poke1 ~= "" and poke2 ~= "" and poke3 ~= "" and poke4 ~= "" and poke5 ~= "" then
log("You have seen " ..poke1counter.. " " ..poke1.. ", " ..poke2counter.. " " ..poke2.. ", "..poke3counter.. " " ..poke3.. ", "..poke4counter.. " " ..poke4.. " and "..poke5counter.. " " ..poke5)
log("and have caught " ..poke1catch.. " " ..poke1.. ", " ..poke2catch.. " " ..poke2.. ", "..poke3catch.. " " ..poke3.. ", "..poke4catch.. " " ..poke4.. " and "..poke5catch.. " " ..poke5.. ".")
elseif poke1 ~= "" and poke2 ~= "" and poke3 ~= "" and poke4 ~= "" and poke5 == "" then
log("You have seen " ..poke1counter.. " " ..poke1.. ", " ..poke2counter.. " " ..poke2.. ", "..poke3counter.. " " ..poke3.. " and "..poke4counter.. " " ..poke4)
log("and have caught " ..poke1catch.. " " ..poke1.. ", " ..poke2catch.. " " ..poke2.. ", "..poke3catch.. " " ..poke3.. " and "..poke4catch.. " " ..poke4.. ".")
elseif poke1 ~= "" and poke2 ~= "" and poke3 ~= "" and poke4 == "" and poke5 == "" then
log("You have seen " ..poke1counter.. " " ..poke1.. ", " ..poke2counter.. " " ..poke2.. " and "..poke3counter.. " " ..poke3)
log("and have caught " ..poke1catch.. " " ..poke1.. ", " ..poke2catch.. " " ..poke2.. " and "..poke3catch.. " " ..poke3.. ".")
elseif poke1 ~= "" and poke2 ~= "" and poke3 == "" and poke4 == "" and poke5 == "" then
log("You have seen " ..poke1counter.. " " ..poke1.. " and " ..poke2counter.. " " ..poke2)
log("and have caught " ..poke1catch.. " " ..poke1.. " and " ..poke2catch.. " " ..poke2.. ".")
elseif poke1 ~= "" and poke2 == "" and poke3 == "" and poke4 == "" and poke5 == "" then
log("You have seen " ..poke1counter.. " " ..poke1)
log("and have caught " ..poke1catch.. " " ..poke1.. ".")
end
if special1 ~= "" and special2 ~= "" then
log("You also have seen " ..shinyCounter.. " Shinys, " ..special1counter.. " " ..special1.. " and " ..special2counter.. " " ..special2)
log("and caught " ..shinyCatch.. " Shinys, " ..special1counter.. " " ..special1.. " and " ..special2counter.. " " ..special2.. ".")
elseif special1 ~= "" and special2 == "" then
log("You also have seen " ..shinyCounter.. " Shinys and " ..special1counter.. " " ..special1)
log("and caught " ..shinyCatch.. " Shinys and " ..special1counter.. " " ..special1.. ".")
elseif special1 == "" and special2 == "" then
log("You also have seen " ..shinyCounter.. " Shinys and caught " ..shinyCatch.. " Shinys.")
end
if earnMoney == true then
log("You have earned ".. tostring(endMoney - startMoney) .." PokeDollars!")
end
RunningTime()
log("=======================================")
end
Greetings