Scripts

This page shows the standard used to make scripts that could be handled by the bot.

mouvement() function

The below function is the first function that the bot should read after loading, starting, and reading the constants on your script. It should contain all unidirectional moves you want your character to make while he is in a specific map.

function mouvement()
	return
	{
		--Instruction 1,
		--Instruction 2,
		...
	}

The instruction format allows you to firstly specify the map where the action should take place :

{  map = "mapid or coords", ..., ... },

If you' are using map coords, you should follow this format : map = "[0,-2]"

It is strongly recommended to begin your movement instructions from a bank position.

The second argument, if needed, should tell the character what to do in the current map.

{ ..., recolte = true, ... },
Allows the bot to collect all resources targeted by the constants on the script.
{ ..., combat = true, ... },
Allows the bot to attack all ennemis targeted by the constants on the script.
Constants

The third argument should give the cell id of the exit cell of the map. It is the only cell your character will move to after finishing his tasks.

{  ..., ..., cell = "cellid"},

You could also use a less stable parameter that allows to to specify the direction only.

{  ..., ..., direction = "DIRECTION"}, -- Available directions : TOP|BOTTOM|LEFT|RIGHT

banque() function

This function will be triggered in case the MAX_PODS constant threshold is exceeded. It allows you to specify the instructions the bot should follow to go to the bank before coming back to the farm routine.

function banque()
	return
	{
		--Instruction 1,
		--Instruction 2,
		...
		--Final instruction to interact with the bank npc,
    }
end

Always use mapid and cellid instead of map coords and directions on bank maps.

The "inside bank" instruction needs a third parameter that will automatically talk to the NPC, open the bank, and throw the whole inventory in the bank, then switch back to mouvement() function.

-- Astrub Bank Example
{  map = "7414", cell = "142"},
{  map = "7549", cell = "381", npc_banque = true},

phenix() function

under construction...

This function will be triggered in case your character dies turns into ghost. It will give him movement instruction to the phoenix position to recover his body, then switch back to the mouvement() function.

function phenix()
	return
	{
		--Instruction 1,
		--Instruction 2,
		...
		--Final instruction to interact with phoenix,
	}
end

Experimental functions

inventario.pods()
inventario.podsMaximos()
inventario.podsPorcentaje()
inventario.tieneObjeto(ID)
inventario.utilizar(ID)
inventario.equipar(ID)

mapa.cambiarMapa(ID)
mapa.moverCelda(ID)
mapa.enCelda(ID)
mapa.enMapa(ID)
mapa.actualMapa(ID)
mapa.actualPosicion(ID)

personaje.nombre()
personaje.nivel()
personaje.experiencia()
personaje.kamas()

pelea.puedePelear()
pelea.pelear()

npc.npcBanco(ID)
npc.hablarNpc(ID)
npc.responder(ID)
npc.cerrar(ID)

Last updated