New AT Charges

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Ynot
Posts: 7
Joined: Sat Aug 27, 2016 6:02 am

New AT Charges

#1 Post by Ynot » Wed Aug 31, 2016 4:09 am

I want to buy AT charges (ItemID= 202928) from the Phirius Merchant "Angus" outside the Varanas Auction House, but I can get no further than opening the Chat Window. I am new to Coding and would appreciate any assistance with this. :?:

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

Re: New AT Charges

#2 Post by Bill D Cat » Wed Aug 31, 2016 5:30 pm

Ynot wrote:I want to buy AT charges (ItemID= 202928) from the Phirius Merchant "Angus" outside the Varanas Auction House, but I can get no further than opening the Chat Window. I am new to Coding and would appreciate any assistance with this. :?:
Here you go.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
	<onload>
		if not __WPL.ResumePoint then
			__WPL:setWaypointIndex(1)
			_target = player:findNearestNameOrId(110432) -- Angus
			if not _target then
				error("Not near NPC Angus in Varanas Central.",0)
			end
		end
	</onload>
	<!-- #  1 --><waypoint x="5167" z="-1909" y="132">
		player:target_NPC(110432) -- Angus
		ChoiceOptionByName(getTEXT("ITEMSHOP_CATEGORY_UPGRADING")) -- 'Upgrading'
		store:buyItem(202928,1) -- 10 Arcane Transmutor Charges for 100 Phirius Token Coins
		RoMScript("StoreFrame:Hide()")
		error("We bought 10 AT Charges!",0)
	</waypoint>
</waypoints>

Ynot
Posts: 7
Joined: Sat Aug 27, 2016 6:02 am

Re: New AT Charges

#3 Post by Ynot » Mon Sep 05, 2016 1:18 pm

Thanks Bill, I was begining to despair :D

Ynot
Posts: 7
Joined: Sat Aug 27, 2016 6:02 am

Re: New AT Charges

#4 Post by Ynot » Mon Oct 03, 2016 3:26 am

Guys..I'm stuck with this. I cannot make my character use the AT Charges puchased from NPC Angus in Varanas Central.
I have used in various different ways:

Code: Select all

inventory:useItem("202928")
and even:

Code: Select all

if inventory:itemTotalCount("202928") >0 then
         	repeat
        	 inventory:useItem("202928")
        	 yrest(100)
        	 inventory:update()
       	 	until inventory:itemTotalCount("202928") == 0
end
but, nothing seems to work. I am using the latest patch on a public server wth MM 1.05.207 with update to 787. Am I missing something?

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

Re: New AT Charges

#5 Post by Bill D Cat » Mon Oct 03, 2016 7:03 am

Just get rid of the quotes around the numbers: inventory:useItem(202928)

You only need the quotes if the characters are alpha-numeric like the item name itself. You don't need them if you are using the item's ID number.

Ynot
Posts: 7
Joined: Sat Aug 27, 2016 6:02 am

Re: New AT Charges

#6 Post by Ynot » Fri Oct 07, 2016 3:27 am

Thanks Bill. been away a few days but, finally got a chance to try it out without quotes. However, I get
2016-10-07 09:12:41 - [string "..."]:10: attempt to call global 'itemTotalCount' (a nil value)
Here is the full coding

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
   <onload>
      if not __WPL.ResumePoint then
         __WPL:setWaypointIndex(1)
         _target = player:findNearestNameOrId(110432) -- Angus
         if not _target then
            error("Not near NPC Angus in Varanas Central.",0)
         end
      end
	  
   </onload>
   <!-- #  1 --><waypoint x="5171" z="-1890" y="137">
      player:target_NPC(110432) -- Angus
      ChoiceOptionByName(getTEXT("ITEMSHOP_CATEGORY_UPGRADING")) -- 'Upgrading'
		store:buyItem(202928,4) -- 10 Arcane Transmutor Charges for 100 Phirius Token Coins
      RoMScript("CloseAllWindows()")
		
	if inventory:itemTotalCount(202928) >0 then
   
         repeat
         print( "total item = ", itemTotalCount(202928))
         inventory:useItem(202928)
         yrest(100)
         inventory:update()
        until inventory:itemTotalCount(202928) == 0
	end

		loadPaths("Makefusion.xml")
		</waypoint>
</waypoints>
I have also tried puting the If statement into the onload section but with the same result.
Putting the quotes back in, results in the processes missing the "useitem" section completely and proceeds to load the next waypoint file. Been scratching my head so hard on this problem I now have Scars :lol:

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

Re: New AT Charges

#7 Post by Bill D Cat » Fri Oct 07, 2016 7:13 am

Ynot wrote:Thanks Bill. been away a few days but, finally got a chance to try it out without quotes. However, I get
2016-10-07 09:12:41 - [string "..."]:10: attempt to call global 'itemTotalCount' (a nil value)
Well that's a simple fix. The command is inventory:itemTotalCount(). See my notes in your code below.
Ynot wrote:Here is the full coding

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
   <onload>
      if not __WPL.ResumePoint then
         __WPL:setWaypointIndex(1)
         _target = player:findNearestNameOrId(110432) -- Angus
         if not _target then
            error("Not near NPC Angus in Varanas Central.",0)
         end
      end
	  
   </onload>
   <!-- #  1 --><waypoint x="5171" z="-1890" y="137">
      player:target_NPC(110432) -- Angus
      ChoiceOptionByName(getTEXT("ITEMSHOP_CATEGORY_UPGRADING")) -- 'Upgrading'
		store:buyItem(202928,4) -- 10 Arcane Transmutor Charges for 100 Phirius Token Coins
      RoMScript("CloseAllWindows()")
		
	if inventory:itemTotalCount(202928) >0 then    --  It is correct here
   
         repeat
         print( "total item = ", itemTotalCount(202928))  -- It is incorrect here.  Needs the inventory: prefix.
         inventory:useItem(202928)
         yrest(100)
         inventory:update()
        until inventory:itemTotalCount(202928) == 0    --  It is correct here
	end

		loadPaths("Makefusion.xml")
		</waypoint>
</waypoints>
I have also tried puting the If statement into the onload section but with the same result.
Putting the quotes back in, results in the processes missing the "useitem" section completely and proceeds to load the next waypoint file. Been scratching my head so hard on this problem I now have Scars :lol:

Ynot
Posts: 7
Joined: Sat Aug 27, 2016 6:02 am

Re: New AT Charges

#8 Post by Ynot » Sat Oct 08, 2016 6:41 pm

Thanks again Bill. I haven't had a chance to try it out yet but, I will get back you and let you know how it went. :D

Ynot
Posts: 7
Joined: Sat Aug 27, 2016 6:02 am

Re: New AT Charges

#9 Post by Ynot » Tue Oct 11, 2016 10:42 pm

That worked :D I could not see the obvious if it smacked me in the face with a frying pan :lol: mamy thanks

Post Reply

Who is online

Users browsing this forum: No registered users and 42 guests