harvest & co

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
Miworax
Posts: 57
Joined: Fri Jan 24, 2014 9:46 am

harvest & co

#1 Post by Miworax » Sun Jan 26, 2014 9:46 am

iam serching for the function that wait at a harvest wp until he can use it... i want these for a daily and cant find that :(
can someone help ?

PS. sorry for my bad english

Danni
Posts: 59
Joined: Sat Nov 09, 2013 6:24 pm

Re: harvest & co

#2 Post by Danni » Sun Jan 26, 2014 10:55 am

Can you be more specific?

Do you want to harvest mats, like wood. Or you want to harvest an item?

What's the daily name? So I might help out better.

Miworax
Posts: 57
Joined: Fri Jan 24, 2014 9:46 am

Re: harvest & co

#3 Post by Miworax » Sun Jan 26, 2014 10:58 am

its an daily, where i must do 10 fires on... but not all the fires are "useable" in these time.... can i say that rombot wait at each fire until he can use it ?

i hope its better now ....

Danni
Posts: 59
Joined: Sat Nov 09, 2013 6:24 pm

Re: harvest & co

#4 Post by Danni » Sun Jan 26, 2014 11:06 am

not really "more specific" (look to your pm)

but you could try to work with a loop.

Miworax
Posts: 57
Joined: Fri Jan 24, 2014 9:46 am

Re: harvest & co

#5 Post by Miworax » Sun Jan 26, 2014 11:07 am

How did that work ?

User avatar
Bill D Cat
Posts: 555
Joined: Sat Aug 10, 2013 8:13 pm
Location: Deep in the Heart of Texas

Re: harvest & co

#6 Post by Bill D Cat » Sun Jan 26, 2014 12:37 pm

Perhaps you are looking to do something like this. It scans for the item to use, and if it is found AND within a distance of 50 (melee) then it uses it. Otherwise it waits 5 seconds and scans again.

Code: Select all

local itemhere = false
repeat
  item = player:findNearestNameOrId(xxxxxx) -- Whatever the Name or Id is for the item you want to use
  if item and 50 > distance(item,player) then
     player:target_Object(item.Id)
     itemhere = true
  else
     yrest(5000)
  end
until itemhere == true

Miworax
Posts: 57
Joined: Fri Jan 24, 2014 9:46 am

Re: harvest & co

#7 Post by Miworax » Sun Jan 26, 2014 1:20 pm

mh, that must i copy in each harvest wp in these lua ?

User avatar
Bill D Cat
Posts: 555
Joined: Sat Aug 10, 2013 8:13 pm
Location: Deep in the Heart of Texas

Re: harvest & co

#8 Post by Bill D Cat » Sun Jan 26, 2014 3:24 pm

You could just make it a function in the <onload> section and just have a command to call that function in the appropriate waypoints.

Miworax
Posts: 57
Joined: Fri Jan 24, 2014 9:46 am

Re: harvest & co

#9 Post by Miworax » Sun Jan 26, 2014 3:44 pm

never done this before , i can try but maybe i need a bit help :D

User avatar
Bill D Cat
Posts: 555
Joined: Sat Aug 10, 2013 8:13 pm
Location: Deep in the Heart of Texas

Re: harvest & co

#10 Post by Bill D Cat » Mon Jan 27, 2014 1:02 am

You can use this as a function and place it before the first waypoint.

Code: Select all

<onload>
function findMyItem()
  local itemhere = false
  repeat
    item = player:findNearestNameOrId(xxxxxx) -- Whatever the Name or Id is for the item you want to use
    if item and 50 > distance(item,player) then
      player:target_Object(item.Id)
      itemhere = true
    else
      yrest(5000)
    end
  until itemhere == true
end
</onload>
And then in each waypoint that needs it, just put "findMyItem()"

Miworax
Posts: 57
Joined: Fri Jan 24, 2014 9:46 am

Re: harvest & co

#11 Post by Miworax » Mon Jan 27, 2014 8:04 am

it dont work or i have a mistake in the script :(

Miworax
Posts: 57
Joined: Fri Jan 24, 2014 9:46 am

Re: harvest & co

#12 Post by Miworax » Mon Jan 27, 2014 8:25 am

function findMyItem()
local itemhere = false
repeat
item = player:findNearestNameOrId(120431) -- Whatever the Name or Id is for the item you want to use
if item and 50 > distance(item,player) then
player:target_Object(120431)
itemhere = true

function checkDQCount()
local dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()")
cprintf(cli.lightblue,"%s quests completed.\n",tostring(dailyQuestCount));
if (dailyQuestCount == 10) then
cprintf(cli.lightblue,"Completed max number of daily quests, trying to log in next chara.\n");
SetCharList({
{account=20 , chars= {}},
{account=21 , chars= {}},
{account=22 , chars= {}},
{account=23 , chars= {}},
{account=24 , chars= {}},
{account=25 , chars= {}},
{account=26 , chars= {}},
{account=27 , chars= {}},
{account=28 , chars= {}},
{account=29 , chars= {}},
{account=30 , chars= {}},
})
LoginNextChar()
end
end

function relog()
SetCharList({
{account=20 , chars= {}},
{account=21 , chars= {}},
{account=22 , chars= {}},
{account=23 , chars= {}},
{account=24 , chars= {}},
{account=25 , chars= {}},
{account=26 , chars= {}},
{account=27 , chars= {}},
{account=28 , chars= {}},
{account=29 , chars= {}},
{account=30 , chars= {}},
})

if IsLastChar() then
player:logout();
else
LoginNextChar()
end

SetRestartClientSettings(7, "rom4u")

end
</onLoad>
<!-- # 1 --><waypoint x="4488" z="2165" y="1418">sendMacro("ChangeParallelID(1)");
player:target_NPC("xxxx");
player:target_NPC("xxxx");
CompleteQuestByName("xxxx");
checkDQCount()
AcceptQuestByName("xxxx");
</waypoint>
<!-- # 2 --><waypoint x="4491" z="2167" y="1419">
findMyItem()</waypoint>
<!-- # 3 --><waypoint x="4557" z="2198" y="1421"> </waypoint>
<!-- # 4 --><waypoint x="4557" z="2198" y="1421">
findMyItem()</waypoint>
<!-- # 5 --><waypoint x="4561" z="2080" y="1418"> </waypoint>
<!-- # 6 --><waypoint x="4561" z="2080" y="1418">
findMyItem()</waypoint>
<!-- # 7 --><waypoint x="4477" z="2049" y="1418"> </waypoint>
<!-- # 8 --><waypoint x="4477" z="2049" y="1418">
findMyItem()</waypoint>
<!-- # 9 --><waypoint x="4478" z="2089" y="1418"> </waypoint>
<!-- # 10 --><waypoint x="4478" z="2089" y="1418">
findMyItem()</waypoint>
<!-- # 11 --><waypoint x="4496" z="2179" y="1420"> </waypoint>
<!-- # 12 --><waypoint x="4496" z="2179" y="1420">
findMyItem()</waypoint>
<!-- # 13 --><waypoint x="4560" z="2199" y="1421"> </waypoint>
<!-- # 14 --><waypoint x="4560" z="2199" y="1421">
findMyItem()</waypoint>
<!-- # 15 --><waypoint x="4557" z="2076" y="1418"> </waypoint>
<!-- # 16 --><waypoint x="4557" z="2076" y="1418">
findMyItem()</waypoint>
<!-- # 17 --><waypoint x="4476" z="2044" y="1418"> </waypoint>
<!-- # 18 --><waypoint x="4476" z="2044" y="1418">
findMyItem()</waypoint>
<!-- # 19 --><waypoint x="4478" z="2090" y="1418"> </waypoint>
<!-- # 20 --><waypoint x="4478" z="2090" y="1418">
findMyItem()</waypoint>
<!-- # 21 --><waypoint x="4499" z="2164" y="1418"> </waypoint>
checkDQCount()
</waypoints>



maybe, someone can help, rombot says: line 98... mismatched tag

Danni
Posts: 59
Joined: Sat Nov 09, 2013 6:24 pm

Re: harvest & co

#13 Post by Danni » Mon Jan 27, 2014 10:19 am

:geek: Is that your whole WP?

I am can't see any tags right now. So I am not sure where the problems lies.

But you Code has only 94 lines :?

So either something is missing or you misread the error ;) There is no line 98 :)

Miworax
Posts: 57
Joined: Fri Jan 24, 2014 9:46 am

Re: harvest & co

#14 Post by Miworax » Mon Jan 27, 2014 10:21 am

iam an idiot ...

wait ....

Miworax
Posts: 57
Joined: Fri Jan 24, 2014 9:46 am

Re: harvest & co

#15 Post by Miworax » Mon Jan 27, 2014 10:23 am

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
cprintf(cli.lightgreen,"\n xxx von xxxx\n")

function findMyItem()
local itemhere = false
repeat
item = player:findNearestNameOrId(120431) -- Whatever the Name or Id is for the item you want to use
if item and 50 > distance(item,player) then
player:target_Object(120431)
itemhere = true

function checkDQCount()
local dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()")
cprintf(cli.lightblue,"%s quests completed.\n",tostring(dailyQuestCount));
if (dailyQuestCount == 10) then
cprintf(cli.lightblue,"Completed max number of daily quests, trying to log in next chara.\n");
SetCharList({
{account=20 , chars= {}},
{account=21 , chars= {}},
{account=22 , chars= {}},
{account=23 , chars= {}},
{account=24 , chars= {}},
{account=25 , chars= {}},
{account=26 , chars= {}},
{account=27 , chars= {}},
{account=28 , chars= {}},
{account=29 , chars= {}},
{account=30 , chars= {}},
})
LoginNextChar()
end
end

function relog()
SetCharList({
{account=20 , chars= {}},
{account=21 , chars= {}},
{account=22 , chars= {}},
{account=23 , chars= {}},
{account=24 , chars= {}},
{account=25 , chars= {}},
{account=26 , chars= {}},
{account=27 , chars= {}},
{account=28 , chars= {}},
{account=29 , chars= {}},
{account=30 , chars= {}},
})

if IsLastChar() then
player:logout();
else
LoginNextChar()
end

SetRestartClientSettings(7, "rom4u")

end

</onLoad>
<!-- # 1 --><waypoint x="4488" z="2165" y="1418">sendMacro("ChangeParallelID(1)");
player:target_NPC("xxxx");
player:target_NPC("xxxx");
CompleteQuestByName("xxxx");
checkDQCount()
AcceptQuestByName("xxxx");
</waypoint>
<!-- # 2 --><waypoint x="4491" z="2167" y="1419">
findMyItem()</waypoint>
<!-- # 3 --><waypoint x="4557" z="2198" y="1421"> </waypoint>
<!-- # 4 --><waypoint x="4557" z="2198" y="1421">
findMyItem()</waypoint>
<!-- # 5 --><waypoint x="4561" z="2080" y="1418"> </waypoint>
<!-- # 6 --><waypoint x="4561" z="2080" y="1418">
findMyItem()</waypoint>
<!-- # 7 --><waypoint x="4477" z="2049" y="1418"> </waypoint>
<!-- # 8 --><waypoint x="4477" z="2049" y="1418">
findMyItem()</waypoint>
<!-- # 9 --><waypoint x="4478" z="2089" y="1418"> </waypoint>
<!-- # 10 --><waypoint x="4478" z="2089" y="1418">
findMyItem()</waypoint>
<!-- # 11 --><waypoint x="4496" z="2179" y="1420"> </waypoint>
<!-- # 12 --><waypoint x="4496" z="2179" y="1420">
findMyItem()</waypoint>
<!-- # 13 --><waypoint x="4560" z="2199" y="1421"> </waypoint>
<!-- # 14 --><waypoint x="4560" z="2199" y="1421">
findMyItem()</waypoint>
<!-- # 15 --><waypoint x="4557" z="2076" y="1418"> </waypoint>
<!-- # 16 --><waypoint x="4557" z="2076" y="1418">
findMyItem()</waypoint>
<!-- # 17 --><waypoint x="4476" z="2044" y="1418"> </waypoint>
<!-- # 18 --><waypoint x="4476" z="2044" y="1418">
findMyItem()</waypoint>
<!-- # 19 --><waypoint x="4478" z="2090" y="1418"> </waypoint>
<!-- # 20 --><waypoint x="4478" z="2090" y="1418">
findMyItem()</waypoint>
<!-- # 21 --><waypoint x="4499" z="2164" y="1418"> </waypoint>
checkDQCount()
</waypoints>

Miworax
Posts: 57
Joined: Fri Jan 24, 2014 9:46 am

Re: harvest & co

#16 Post by Miworax » Mon Jan 27, 2014 10:24 am

Line: 98
Column: 17
Pos: 3256
Message: mismatched tag

Miworax
Posts: 57
Joined: Fri Jan 24, 2014 9:46 am

Re: harvest & co

#17 Post by Miworax » Mon Jan 27, 2014 10:25 am

now there is the whole wp and the error message

Danni
Posts: 59
Joined: Sat Nov 09, 2013 6:24 pm

Re: harvest & co

#18 Post by Danni » Mon Jan 27, 2014 10:30 am

change
<!-- # 21 --><waypoint x="4499" z="2164" y="1418"> </waypoint>
checkDQCount()
into

Code: Select all

<!-- # 21 --><waypoint x="4499" z="2164" y="1418">
checkDQCount() 	</waypoint>
than it should work.

Miworax
Posts: 57
Joined: Fri Jan 24, 2014 9:46 am

Re: harvest & co

#19 Post by Miworax » Mon Jan 27, 2014 10:31 am

i try, 1 moment pls :D

Miworax
Posts: 57
Joined: Fri Jan 24, 2014 9:46 am

Re: harvest & co

#20 Post by Miworax » Mon Jan 27, 2014 10:35 am

scripts/rom/classes/waypointlist.lua:83: Fehler beim
kompilieren und ausfuhren des LUA codes. Fehler in dem onLoad Event in der Wegp
unkt Datei.


an other error message :(

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 8 guests