metalhector222
05-18-2013, 07:56 PM
1. Targeting manual
Is posible make the xenobot a new targeting mode to atack?
Like Atack the creatura with Strike Spell (exori vis, flam, tera, frigo and mort) at be targeted for the user.
The bot doesn't must auto-attack
__________________________________________________ _________________________________________
2. AoE with setTargetingEnabled(true/false)
This script is working well
local config = {
delay = 0, -- delay time in between checks [default = 500ms]
attacks = {
['exevo gran mas frigo'] = {
min = 6,
spellRadius = 5,
checkRadius = 4,
countPlayers = false,
attackMode = 'none'
},
[3191] = { -- itemids can be used instead of spellwords (this is a great fireball rune)
min = 4,
spellRadius = 3,
checkRadius = 4,
countPlayers = false,
attackMode = 'none'
}
}
}
wait(5000)
function getTargetCount(pos, atkRadius, chkRadius, incPlayers, atkMode)
local n = 0
for i = CREATURES_LOW, CREATURES_HIGH do
local creature = Creature.GetFromIndex(i)
if(creature:isValid() and creature:ID() ~= Self.ID())then
if(creature:isOnScreen() and creature:isVisible() and creature:isAlive())then
local name = creature:Name()
if(getDistanceBetween(creature:Position(), pos) <= chkRadius)then
if(atkMode == 'none' and (creature:isPlayer()))then
return false
elseif(atkMode == 'enemies' and (creature:isFriendly() or creature:isInnocent()))then
return false
elseif(atkMode == 'strangers' and creature:isFriendly())then
return false
elseif(atkMode == 'friends' and creature:isInnocent())then
return false
end
if(getDistanceBetween(creature:Position(), pos) <= atkRadius)then
if(not creature:isPlayer() or incPlayers)then
n = n + 1
end
end
end
end
end
end
return n
end
function think()
for spell, dat in pairs(config.attacks)do
local amnt = getTargetCount(Self.Position(), dat.spellRadius, dat.checkRadius, dat.countPlayers, dat.attackMode)
if(amnt)then
local _max = (dat.max==nil) and amnt or dat.max
if(amnt >= dat.min) and (amnt <= _max)then
if(type(spell) == 'number')then
Self.UseItemWithMe(spell)
wait(900, 1200)
elseif(Self.CanCastSpell(spell))then
if(dat.needTarget)then
local target = Creature.GetByID(Self.TargetID())
if(target:isOnScreen() and target:isVisible() and target:isAlive())then
if(targetistanceFromSelf() <= dat.spellRadius)then
Self.Say(spell)
wait(600, 1000)
end
end
end
Self.Say(spell)
wait(600, 1000)
end
end
end
end
end
while(true)do
think()
wait(config.delay)
end
The problem is that doesn't execute it freely while the targeting mode is enabled Because Cooldown spells!
Then, I'm trying to implement setTargetingEnabled(true) - setTargetingEnabled(false)
but i dont know how to do it!
__________________________________________________ _________________________________________
3. Depositing Loots in DP
This work perfectly!
http://thumbs.subefotos.com/88a52b1b7876359ee527083f8911fa42o.jpg (http://subefotos.com/ver/?88a52b1b7876359ee527083f8911fa42o.jpg)
resetbp: Will close and reopen correctly all the backpacks from the first!
dofile("Forgee.lua")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "resetbp") then
resetBackpacks()
local indexes = Container.GetAll()
for i = 1, #indexes do
Container.New(indexes[i]):Minimize()
wait(400, 800)
end
end
end
dp: Will Reach the Depot, will open it and start to deposit the items Stackable and Non Stackable
dofile("Forgee.lua")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "dp") then
Walker.Stop()
Self.ReachDepot()
Self.DepositItems({9692, 0}, {8031, 0}, {10301, 0}, {10275, 0}, {10281, 0}) -- Stackable items
Self.DepositItems({3286, 1},{3264, 1}) -- Non-Stackable items
wait(1500,1900)
end
end
The problem: While is deposit all the items, will no open the next backpack into the main backpack to continue depositing items!
Is posible make the xenobot a new targeting mode to atack?
Like Atack the creatura with Strike Spell (exori vis, flam, tera, frigo and mort) at be targeted for the user.
The bot doesn't must auto-attack
__________________________________________________ _________________________________________
2. AoE with setTargetingEnabled(true/false)
This script is working well
local config = {
delay = 0, -- delay time in between checks [default = 500ms]
attacks = {
['exevo gran mas frigo'] = {
min = 6,
spellRadius = 5,
checkRadius = 4,
countPlayers = false,
attackMode = 'none'
},
[3191] = { -- itemids can be used instead of spellwords (this is a great fireball rune)
min = 4,
spellRadius = 3,
checkRadius = 4,
countPlayers = false,
attackMode = 'none'
}
}
}
wait(5000)
function getTargetCount(pos, atkRadius, chkRadius, incPlayers, atkMode)
local n = 0
for i = CREATURES_LOW, CREATURES_HIGH do
local creature = Creature.GetFromIndex(i)
if(creature:isValid() and creature:ID() ~= Self.ID())then
if(creature:isOnScreen() and creature:isVisible() and creature:isAlive())then
local name = creature:Name()
if(getDistanceBetween(creature:Position(), pos) <= chkRadius)then
if(atkMode == 'none' and (creature:isPlayer()))then
return false
elseif(atkMode == 'enemies' and (creature:isFriendly() or creature:isInnocent()))then
return false
elseif(atkMode == 'strangers' and creature:isFriendly())then
return false
elseif(atkMode == 'friends' and creature:isInnocent())then
return false
end
if(getDistanceBetween(creature:Position(), pos) <= atkRadius)then
if(not creature:isPlayer() or incPlayers)then
n = n + 1
end
end
end
end
end
end
return n
end
function think()
for spell, dat in pairs(config.attacks)do
local amnt = getTargetCount(Self.Position(), dat.spellRadius, dat.checkRadius, dat.countPlayers, dat.attackMode)
if(amnt)then
local _max = (dat.max==nil) and amnt or dat.max
if(amnt >= dat.min) and (amnt <= _max)then
if(type(spell) == 'number')then
Self.UseItemWithMe(spell)
wait(900, 1200)
elseif(Self.CanCastSpell(spell))then
if(dat.needTarget)then
local target = Creature.GetByID(Self.TargetID())
if(target:isOnScreen() and target:isVisible() and target:isAlive())then
if(targetistanceFromSelf() <= dat.spellRadius)then
Self.Say(spell)
wait(600, 1000)
end
end
end
Self.Say(spell)
wait(600, 1000)
end
end
end
end
end
while(true)do
think()
wait(config.delay)
end
The problem is that doesn't execute it freely while the targeting mode is enabled Because Cooldown spells!
Then, I'm trying to implement setTargetingEnabled(true) - setTargetingEnabled(false)
but i dont know how to do it!
__________________________________________________ _________________________________________
3. Depositing Loots in DP
This work perfectly!
http://thumbs.subefotos.com/88a52b1b7876359ee527083f8911fa42o.jpg (http://subefotos.com/ver/?88a52b1b7876359ee527083f8911fa42o.jpg)
resetbp: Will close and reopen correctly all the backpacks from the first!
dofile("Forgee.lua")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "resetbp") then
resetBackpacks()
local indexes = Container.GetAll()
for i = 1, #indexes do
Container.New(indexes[i]):Minimize()
wait(400, 800)
end
end
end
dp: Will Reach the Depot, will open it and start to deposit the items Stackable and Non Stackable
dofile("Forgee.lua")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "dp") then
Walker.Stop()
Self.ReachDepot()
Self.DepositItems({9692, 0}, {8031, 0}, {10301, 0}, {10275, 0}, {10281, 0}) -- Stackable items
Self.DepositItems({3286, 1},{3264, 1}) -- Non-Stackable items
wait(1500,1900)
end
end
The problem: While is deposit all the items, will no open the next backpack into the main backpack to continue depositing items!