Code: Select all
_Elemental = GetIdName(113614)
Code: Select all
local cecandle = player:findNearestNameOrId(_Elemental)
Code: Select all
_Elemental = GetIdName(113614)
Code: Select all
local cecandle = player:findNearestNameOrId(_Elemental)
I think I didn't understand this when I first read it. This thought occurred to me tonight. The GetIdName command doesn't need to have the object targetable does it? It's pulling the information from the internal RoM database?rock5 wrote:If they share the same name you can also get the name using one of the ids. eg.and thenCode: Select all
_Elemental = GetIdName(113614)
We did something similar in survival I think.Code: Select all
local cecandle = player:findNearestNameOrId(_Elemental)
Correct, it gets the info direct from memory and it doesn't matter if you have ever seend the item/npc in your entire playing of the game.kanta wrote:The GetIdName command doesn't need to have the object targetable does it?
Code: Select all
-- click ecandle
player:target(cecandle)
yrest(100)
player:target_Object("Elemental Candlestick", 6000);
yrest(5000)
player:update()
Code: Select all
-- click ecandle
player:target(cecandle)
rest(100)
repeat
player:target_Object("Elemental Candlestick", 6000);
player:update()
until not player.Casting
Code: Select all
<!-- #105 --><waypoint x="4021" z="3944" y="34">
player:target_Object("Elemental Candlestick", 6000);
flyoff()
player:rest(10)
</waypoint>
Code: Select all
<!-- #105 --><waypoint x="4021" z="3944" y="34">
roomOpenA=player:findNearestNameOrId(113617);
roomOpenB=player:findNearestNameOrId(113619);
if roomOpenA==nil and roomOpenB==nil then
player:target_Object("Elemental Candlestick", 6000);
rest(9*1000);
end
flyoff();
</waypoint>
Code: Select all
<!-- # 72b --><waypoint x="3624" z="3666" y="92"> </waypoint>
Code: Select all
<!-- # 84 b--><waypoint x="4087" z="3589" y="92"> </waypoint>
Code: Select all
<!-- #110 --><waypoint x="3780" z="3800" y="34">
if gettotems == 1 then
player:target_Object(114080, 6000);
end
</waypoint>
Not really. That doesn't do anything. player:target_Object wont finish until it finishes collecting, so if it succeeds or fails, player.Casting will always be false. To be sure it suceeded you would have to check the candle to see if it has been clicked. Not sure how. Maybe Lisas "open chest" offset will work here.kkulesza wrote:it is better to do it inside a loop:
Code: Select all
-- click ecandle player:target(cecandle) rest(100) repeat player:target_Object("Elemental Candlestick", 6000); player:update() until not player.Casting
Code: Select all
roomOpenA=player:findNearestNameOrId(113617);
roomOpenB=player:findNearestNameOrId(113619);
if roomOpenA==nil and roomOpenB==nil then
Code: Select all
roomOpen=player:findNearestNameOrId({113617,113619});
if roomOpen==nil then
Code: Select all
--=== Create table for rune and mount chests ===--
chests = {runes = {}, mount = {}}
local objectList = CObjectList();
objectList:update();
local objSize = objectList:size()
for i = 0,objSize do
local obj = objectList:getObject(i);
if obj.Id == 113618 or obj.Id == 113619 then
if obj.Z > 3825 then -- mount
table.insert(chests.mount, table.copy(obj))
else -- runes
table.insert(chests.runes, table.copy(obj))
end
end
end
-- Sort chests
table.sort(chests.mount, function(a,b) return b.X > a.X end)
table.sort(chests.runes, function(a,b) return a.X > b.X end)
-- Get mount
if getcmount == 1 then
for k,v in pairs(chests.mount) do
player:target(v.Address);
Attack()
yrest(2000)
Attack()
yrest(2000)
repeat
yrest(2000)
player:update()
until not player.Casting
end
end
-- Get runes
for k,v in pairs(chests.runes) do
player:target(v.Address);
Attack()
yrest(2000)
Attack()
yrest(2000)
repeat
yrest(2000)
player:update()
until not player.Casting
end
Code: Select all
if getcmount == 1 then
Code: Select all
getcmount = 1 -- "0" do not collect mount chests "1" collect mount chests
rock5 wrote:Did you seton line 12?Code: Select all
getcmount = 1 -- "0" do not collect mount chests "1" collect mount chests
If you want to collect, do as the description says and change "getcmount = 0" to "getcmount = 1"getcmount = 0 -- "0" do not collect mount chests "1" collect mount chests
gettotems = 1 -- "0" do not collect totems "1" collect totems
-- (don't know why people would want this but adding the option anyway)
exitat = 0 -- Until a check for all chests are opened use this option to set if
-- you want the bot to exit the mini game "0" do not exit "1" exit
I'm assuming I could also have it use the value I am setting?rock5 wrote:You can also do this like thisCode: Select all
roomOpenA=player:findNearestNameOrId(113617); roomOpenB=player:findNearestNameOrId(113619); if roomOpenA==nil and roomOpenB==nil then
Code: Select all
roomOpen=player:findNearestNameOrId({113617,113619}); if roomOpen==nil then
Code: Select all
roomOpen=player:findNearestNameOrId({_Elemental});
Code: Select all
_Elemental = GetIdName(113614)
function getecandle()
roomOpen = player:findNearestNameOrId({_Elemental});
if roomOpen == nil then
local lastpllocx = 0
local lastpllocz = 0
local lastpllocy = 0
player:update()
local cecandle = player:findNearestNameOrId(_Elemental)
local dist = distance(cecandle.X,cecandle.Z,player.X,player.Z)
local lastpllocx = player.X
local lastpllocz = player.Z
local lastpllocy = player.Y
if cecandle and (30 > dist) then
-- goto ecandle
teleport_SetStepSize(40)
teleport(cecandle.X, cecandle.Z) -- teleport to above ecandle
yrest(1000)
teleport(nil, nil, cecandle.Y +25) -- teleport in range to click ecandle
yrest(1000)
-- click ecandle
player:target(cecandle)
yrest(1000)
player:target_Object(_Elemental, 5000);
yrest(1000)
player:update()
teleport(nil, nil, lastpllocy)
yrest(1000)
teleport(lastpllocx,lastpllocz)
yrest(1000)
end
end
end
Code: Select all
player:findNearestNameOrId({_Elemental});
Users browsing this forum: No registered users and 8 guests