Auto Target

meubk
Por meubk
em Mods, funções e outros

meubk

@miillerdomingues
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 21/04/08Posts: 311

autotarget.xml:

[LUA]<?xml version="1.0" encoding="ISO-8859-1"?> 
<mod name="Auto Target System" version="1.0" author="xOtservx" enabled="yes"> 
<event type="login" name="AutoTargetLogin" event="script"><![CDATA[
function onLogin(cid)
return registerCreatureEvent(cid, "AutoTarget")
end]]></event>
<event type="think" name="AutoTarget" event="script"><![CDATA[
function onThink(cid, interval)
	if getPlayerStorageValue(cid, 25471) ~= "on" then return true end
	if getCreatureTarget(cid) then return true end
	local monsterScreen = {}
	for x = -7, 7 do
		for y = -5, 5 do
			creature = getTopCreature({x = getThingPos(cid).x + x, y = getThingPos(cid).y + y, z = getThingPos(cid).z}).uid
			if isMonster(creature) then
				table.insert(monsterScreen, creature)
			end
		end
    end
    if #monsterScreen == 0 then return true end
    monsterTarget = #monsterScreen[1]
	if #monsterTarget > 1 then
		local type = type(getPlayerStorageValue(cid, 25472)) ~= "string" and "distancia" or getPlayerStorageValue(cid, 25471)
		for i = 1, #monsterScreen do
            if type == "distancia" then
				if getDistanceBetween(getThingPos(monsterScreen[i]), getThingPos(cid)) < getDistanceBetween(getThingPos(monsterTarget), getThingPos(cid)) then
					monsterTarget = monsterScreen[i]
				end
            elseif type == "forte" then
				if getCreatureMaxHealth(monsterScreen[i]) > getCreatureMaxHealth(monsterTarget) then
					monsterTarget = monsterScreen[i]
				end
            end
		end
	end
	doMonsterSetTarget(cid, monsterTarget)
	return true
end]]></event>
<talkaction words="!autotarget;/autotarget" event="buffer"><![CDATA[
function onSay(cid, words, param)
	if param == "on" then
		setPlayerStorageValue(cid, 25471, "on")
		return doPlayerSendTextMessage(cid, 27, "Você ligou o sistema de auto target, configure ele para !autotarget distancia ou !autotarget forte .")
	elseif param == "off" then
		setPlayerStorageValue(cid, 25471, "off")
		return doPlayerSendTextMessage(cid, "27, Você desligou o sistema de auto target.")
	elseif param == "distancia" or param "forte" then
		if getPlayerStorageValue(cid, 25471) ~= "on" then
			return doPlayerSendTextMessage(cid, "27, Você precisa estar com o sistema de auto target ligado (!autotarget on)")
		end
		setPlayerStorageValue(cid, 25472, param)
		return doPlayerSendTextMessage(cid, "27, Você trocou o modo do auto target para " .. param .. ".")
	end
end]]></talkaction>
</mod>[/LUA]

coloque o xml na pasta mods do ot.

 

comandos:

 

 

!autotarget on -- liga o sistema

!autotarget off -- desliga o sistema

!autotarget forte -- vai da preferencia para o monstro mais forte, por exemplo se na tela tem um demon e um dragon, ele vai dar target no demon.

!autotarget distancia -- vai da preferencia para o mosntro q estiver mais perto do player

ScythePhantom

Conde
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 27/01/13Posts: 443Gênero: Masculino

Muito bom brother, uma boa alternativa para quem não tem bot, ficaria bacana se você colocasse um alternativa para premiums usarem ou não.

Att. CelinoAndrade

 

 

 

 

 

 

 

 

 

 

 

 

appearance.png [Show Off] ScythePhantom

network.png pbOT-Skyline

xSONYx

Prostituto
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 26/12/07Posts: 272Char no Tibia: [ADM]Sony

Boa, script bastante legal ! alguém testa aí e fala se funcionou perfeitamente e tal..

eu uso oculos no show porque elas querem minha alma

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

Parece estar incrível, parabéns!

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

Martelix

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 30/08/08Posts: 57Char no Tibia: Termabre Dore

Bons códigos, mas cara acredito que isso possa usar muita CPU do PC e/ou lagar o servidor, é o famoso script de luxo rsrs

 

Parabéns

KmzTueio

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 09/12/06Posts: 4

aqui nao funcionou :/

só coloquei o arquivo na pasta mod do server mais nada aconteceu :/

Lunar Archer

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 28/11/18Posts: 1

bad

KaboFlow

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 04/07/17Posts: 434

nao tira targ na versao 8.6

KaboFlow

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 04/07/17Posts: 434
Em 03/12/2013 em 15:03, meubk disse:

autotarget.xml:

[LUA]<?xml version="1.0" encoding="ISO-8859-1"?> 
<mod name="Auto Target System" version="1.0" author="xOtservx" enabled="yes"> 
<event type="login" name="AutoTargetLogin" event="script"><![CDATA[
function onLogin(cid)
return registerCreatureEvent(cid, "AutoTarget")
end]]></event>
<event type="think" name="AutoTarget" event="script"><![CDATA[
function onThink(cid, interval)
	if getPlayerStorageValue(cid, 25471) ~= "on" then return true end
	if getCreatureTarget(cid) then return true end
	local monsterScreen = {}
	for x = -7, 7 do
		for y = -5, 5 do
			creature = getTopCreature({x = getThingPos(cid).x + x, y = getThingPos(cid).y + y, z = getThingPos(cid).z}).uid
			if isMonster(creature) then
				table.insert(monsterScreen, creature)
			end
		end
    end
    if #monsterScreen == 0 then return true end
    monsterTarget = #monsterScreen[1]
	if #monsterTarget > 1 then
		local type = type(getPlayerStorageValue(cid, 25472)) ~= "string" and "distancia" or getPlayerStorageValue(cid, 25471)
		for i = 1, #monsterScreen do
            if type == "distancia" then
				if getDistanceBetween(getThingPos(monsterScreen[i]), getThingPos(cid)) < getDistanceBetween(getThingPos(monsterTarget), getThingPos(cid)) then
					monsterTarget = monsterScreen[i]
				end
            elseif type == "forte" then
				if getCreatureMaxHealth(monsterScreen[i]) > getCreatureMaxHealth(monsterTarget) then
					monsterTarget = monsterScreen[i]
				end
            end
		end
	end
	doMonsterSetTarget(cid, monsterTarget)
	return true
end]]></event>
<talkaction words="!autotarget;/autotarget" event="buffer"><![CDATA[
function onSay(cid, words, param)
	if param == "on" then
		setPlayerStorageValue(cid, 25471, "on")
		return doPlayerSendTextMessage(cid, 27, "Você ligou o sistema de auto target, configure ele para !autotarget distancia ou !autotarget forte .")
	elseif param == "off" then
		setPlayerStorageValue(cid, 25471, "off")
		return doPlayerSendTextMessage(cid, "27, Você desligou o sistema de auto target.")
	elseif param == "distancia" or param "forte" then
		if getPlayerStorageValue(cid, 25471) ~= "on" then
			return doPlayerSendTextMessage(cid, "27, Você precisa estar com o sistema de auto target ligado (!autotarget on)")
		end
		setPlayerStorageValue(cid, 25472, param)
		return doPlayerSendTextMessage(cid, "27, Você trocou o modo do auto target para " .. param .. ".")
	end
end]]></talkaction>
</mod>[/LUA]

coloque o xml na pasta mods do ot.

 

comandos:

 

pra base pokemon?

 

base DXP??