Re: Rock5's ToDo list
Posted: Tue Dec 07, 2010 9:12 am
ekhm, i belive its agruments are the npc namem just tryi it 

player:target() accept an address or pawn. player:findNearestNameOrId() returns an object which is basically the same as a pawn but with less info. What player:target() needs is the address which objects have. So ...jduartedj wrote: How do I tell player:target() to target the result from player:findNearestNameOrId()? does player:target() take any arguments?
Code: Select all
targetObj = player:findNearestNameOrId(arguments)
player:target(targetObj)
-- or
player:target(targetObj.Address)
rock5 wrote:player:target() accept an address or pawn. player:findNearestNameOrId() returns an object which is basically the same as a pawn but with less info. What player:target() needs is the address which objects have. So ...jduartedj wrote: How do I tell player:target() to target the result from player:findNearestNameOrId()? does player:target() take any arguments?Code: Select all
targetObj = player:findNearestNameOrId(arguments) player:target(targetObj) -- or player:target(targetObj.Address)
He he. I've moved but I still have a lot of junk there. I wont count the move complete until everything has been cleared away and I can get tenants in there. But there are interruption. For instance I fractured my thumb about 3 weeks ago. Still healing but I'm also lazy so that doesn't helplisa wrote:I see moving house is still at 65%, you must have a lot of stuff lol
This is not related to my list. Please start a new thread.Alkaiser wrote:Having a problem with pet crafting. A pet has reached max crafting level, and now only produces Ash Wood... though it should still default to the highest level material, right?
Code: Select all
Stolen Tools.Sys420059_name_plural.Stolen Tools.Sys420059_szquest_accept_detail.
Code: Select all
http://www.theromwiki.com/API:GetQuestNameByIndex
Code: Select all
function AcceptQuestByName(_name, _all)
_all = _all or false
local questToAccept = _name or ""
local questOnBoard
-- Accepts all available quests
if (_all == true) then
for i = 1,sendMacro("GetNumQuest(1)") do
sendMacro("OnClick_QuestListButton(1, "..i..")") -- Clicks the quest
yrest(100)
sendMacro("AcceptQuest()") -- Accepts the quest
end
-- Accepts a quest by quest name
else
for i = 1,sendMacro("GetNumQuest(1)") do
questOnBoard = sendMacro("GetQuestNameByIndex(1, "..i..")")
if questOnBoard == questToAccept then
sendMacro("OnClick_QuestListButton(1,"..i..")") -- Clicks the quest
yrest(100)
sendMacro("AcceptQuest()") -- Accepts the quest
end
end
end
end
function CompleteQuestByName(_name, _all)
_all = _all or false
local questToComplete = _name or ""
local questOnBoard
-- Complete all available quests
if (_all == true) then
for i = 1,sendMacro("GetNumQuest(3)") do
sendMacro("OnClick_QuestListButton(3, "..i..")") -- Clicks the quest
yrest(100)
sendMacro("CompleteQuest()") -- Accepts the quest
end
-- Complete a quest by quest name
else
for i = 1,sendMacro("GetNumQuest(1)") do
questOnBoard = sendMacro("GetQuestNameByIndex(3, "..i..")")
if questOnBoard == questToComplete then
sendMacro("OnClick_QuestListButton(3,"..i..")") -- Clicks the quest
yrest(100)
sendMacro("CompleteQuest()") -- Accepts the quest
end
end
end
end
Code: Select all
AcceptQuestByName(nil, true)
Code: Select all
AcceptQuestByName("all")
Code: Select all
if _name = "all" then
do all
else
do only _name
end
Code: Select all
player:target_NPC("Logar Bulletin Board");
AcceptQuestByName("Stolen Tools","")
Code: Select all
We try to find NPC Logar Bulletin Board:
We successfully target NPC Logar Bulletin Board and try to open the dialog windo
w.
Use MACRO: Executing RoMScript "GetNumQuest(1)".
Use MACRO: Executing RoMScript "GetQuestNameByIndex(1, 1)".
Use MACRO: Executing RoMScript "OnClick_QuestListButton(1,1)".
Use MACRO: Executing RoMScript "AcceptQuest()".
Use MACRO: Executing RoMScript "GetQuestNameByIndex(1, 2)".
Use MACRO: Executing RoMScript "GetQuestNameByIndex(1, 3)".
Use MACRO: Executing RoMScript "GetQuestNameByIndex(1, 4)".
Use MACRO: Executing RoMScript "GetQuestNameByIndex(1, 5)".
Use MACRO: Executing RoMScript "GetQuestNameByIndex(1, 6)".
Use MACRO: Executing RoMScript "GetQuestNameByIndex(1, 7)".
Use MACRO: Executing RoMScript "GetQuestNameByIndex(1, 8)".
Use MACRO: Executing RoMScript "GetQuestNameByIndex(1, 9)".
Use MACRO: Executing RoMScript "GetQuestNameByIndex(1, 10)".
Use MACRO: Executing RoMScript "GetQuestNameByIndex(1, 11)".
Not really. I'll change it.Do you really need to use a second argument?
OK, I'll change this, too.1. RoMScript should be used instead of sendMacro so you don't get so much junk messages and
2. When searching for a quest name, once found it can break from the loop so it stops searching.
Code: Select all
function AcceptQuestByName(_name)
_name = _name or "All"
local questToAccept = _name
local questOnBoard = ""
local i
-- Accept all available quests
if (_name == "" or _name == "All" or _name == "ALL" or _name == "all") then
printf("We accept all quests\n")
for i = 1,RoMScript("GetNumQuest(1)") do
RoMScript("OnClick_QuestListButton(1, "..i..")") -- Clicks the quest
yrest(100)
RoMScript("AcceptQuest()") -- Accepts the quest
end
-- Accept a quest by quest name
else
for i = 1,RoMScript("GetNumQuest(1)") do
questOnBoard = RoMScript("GetQuestNameByIndex(1, "..i..")")
if questOnBoard == questToAccept then
RoMScript("OnClick_QuestListButton(1,"..i..")") -- Clicks the quest
yrest(100)
RoMScript("AcceptQuest()") -- Accepts the quest
break
end
end
end
end
function CompleteQuestByName(_name)
_name = _name or "All"
local questToComplete = _name
local questOnBoard = ""
local i
-- Complete all available quests
if (_name == "" or _name == "All" or _name == "ALL" or _name == "all") then
for i = 1,RoMScript("GetNumQuest(3)") do
RoMScript("OnClick_QuestListButton(3, "..i..")") -- Clicks the quest
yrest(100)
RoMScript("CompleteQuest()") -- Completes the quest
end
-- Complete a quest by quest name
else
for i = 1,RoMScript("GetNumQuest(1)") do
questOnBoard = RoMScript("GetQuestNameByIndex(3, "..i..")")
if questOnBoard == questToComplete then
RoMScript("OnClick_QuestListButton(3,"..i..")") -- Clicks the quest
yrest(100)
RoMScript("CompleteQuest()") -- Completes the quest
break
end
end
end
end
This is mostly donerock5 wrote:Guild function addon to send resources to guild.
Code: Select all
GuildDonate("Ash","green")
Code: Select all
if ( _type == "all" and (item:isType("Ores") or item:isType("Herbs") or item:isType("Wood")) ) or
( _type ~= "all" and item:isType(_type) ) then
Code: Select all
if ( _type == "all" and (item:isType("Ores") or item:isType("Herbs") or item:isType("Wood")) ) or
( _type ~= "all" and item:isType(_type) ) or
( string.find(item.Name,_type) ) then