how can i? need coding

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Romplayer
Posts: 120
Joined: Wed Jan 11, 2012 10:07 am

how can i? need coding

#1 Post by Romplayer » Wed Jan 11, 2012 10:15 am

how can i repeat a waypoint when the rom system gives "You did not gain any items"

i am running a waypoint file to collect quest items but sometimes i get interuppted by combat and it says "You did not gain any items". What code can I write to recognize it saying You did not gain any items and then repeat the waypoint?

I need this b/c sometimes it will skip the waypoint and move to the next without collecting the item after killing the mob.

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: how can i? need coding

#2 Post by kanta » Wed Jan 11, 2012 11:39 am

Have you tried the following code?

By item name
player:target_Object("Insert Item Name", nil, nil, true);
or by item ID
player:target_Object(######, nil, nil, true);
Scout/Knight/Rogue 70/66/66

Romplayer
Posts: 120
Joined: Wed Jan 11, 2012 10:07 am

Re: how can i? need coding

#3 Post by Romplayer » Wed Jan 11, 2012 2:33 pm

no i just use
player:target_Object("Edible Wild Plant");sendMacro("ChoiceOption(1);");

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: how can i? need coding

#4 Post by kanta » Wed Jan 11, 2012 5:47 pm

Romplayer wrote:no i just use
player:target_Object("Edible Wild Plant");sendMacro("ChoiceOption(1);");

Use this instead:

Code: Select all

player:target_Object("Edible Wild Plant", nil, nil, true);
Don't use the ChoiceOption. That's for choosing a popup dialog like when you use Snoop to transport and you are asked to verify you want to spend gold, or like entering Goblin Mines.

From the wiki:
player:target_Object(_objname, _waittime, _harvestall, _donotignore, _evalFunc);

This will target an object similarly to target_NPC but this function has more options to cater for the different behaviors of different objects.

_objname = name or id of object to target. Accepts partial names or a table of names and ids.(Required)

_waittime = time to wait if the object takes time to action, in ms. By default will wait until casting bar is gone. Only really necessary if you want it to wait longer than it takes to collect.(Optional)

_harvestall = true if you wish to collect all in the immediate area. Only use if the object disappears once collected. (Default is false ie. opens/collects only once)

_donotignore = If false, will target an object once then move onto the next object. If true, will continue to target object until it disappears or moves away. Only set to true if the target disappears or moves away or you might end up in an infinite loop.(if _harvestall = true then the default is false, else it is true).

_evalFunc = A user created custom function that can be used to evaluate whether objects are valid or not. Should except an address as an argument and return true or false. (Optional)
Scout/Knight/Rogue 70/66/66

Romplayer
Posts: 120
Joined: Wed Jan 11, 2012 10:07 am

Re: how can i? need coding

#5 Post by Romplayer » Thu Jan 12, 2012 9:52 am

ok i used
player:target_Object("Edible Wild Plant", nil, nil, true);
but it still skips if i am interrupted by combat
I need something that can recognize "You did not gain any items" and then repeat the WP

Romplayer
Posts: 120
Joined: Wed Jan 11, 2012 10:07 am

Re: how can i? need coding

#6 Post by Romplayer » Thu Jan 12, 2012 9:58 am

maybe the "You did not gain any items" is an registered event? or can i write something that reads the general log for that string?

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: how can i? need coding

#7 Post by kanta » Fri Jan 13, 2012 11:42 pm

I honestly do not know. I've never messed around with in game event code. I also do a WP for this daily. I use the following code in my <onLoad>:

Code: Select all

   function getewp()
   player:update()
   		if wolf then
   		player:target(104724)
   		player:update()
   		player:fight()
   		end
   		if condor then
   		player:target(104725)
   		player:update()
   		player:fight()
   		end
   		if (inventory:itemTotalCount(208547) ~= 10) then
      player:target_Object("Edible Wild Plant", nil, nil, true);
      else
      __WPL:setForcedWaypointType("RUN")
      end
      end
Pretty basic coding compared to what some people do here, but it does the trick. Just put "getewp()" at the points where the plant is. Just remember to set WPtype back to NORMAL somewhere if you also collect the fox meat in the same WP file.
Last edited by kanta on Fri Jan 13, 2012 11:46 pm, edited 2 times in total.
Scout/Knight/Rogue 70/66/66

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: how can i? need coding

#8 Post by lisa » Fri Jan 13, 2012 11:45 pm

wouldn't it be easier to check if you received the item?

So do a count of item in inventory.

or if it is a quest and only need that item to complete quest then you can check if quest has been completed.

or check if the object itself has dissappeared?
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: how can i? need coding

#9 Post by kanta » Fri Jan 13, 2012 11:49 pm

I know which one this is for. The daily quest "If I Persevere". He needs both wild fox meat and edible wild plants.
Scout/Knight/Rogue 70/66/66

Romplayer
Posts: 120
Joined: Wed Jan 11, 2012 10:07 am

Re: how can i? need coding

#10 Post by Romplayer » Mon Jan 16, 2012 9:52 am

I'd do an inventory update check but it seems that it is always lagged or slowed when it popups onscreen that u gained a quest item. Meaning I gain +1 of quest item but it waits till the notification fades away. By then it is too late having gained another item or moved on to a next waypoint.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 47 guests