New AT Charges
New AT Charges
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.
- Bill D Cat
- Posts: 555
- Joined: Sat Aug 10, 2013 8:13 pm
- Location: Deep in the Heart of Texas
Re: New AT Charges
Here you go.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.
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>
Re: New AT Charges
Thanks Bill, I was begining to despair
Re: New AT Charges
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:
and even:
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?
I have used in various different ways:
Code: Select all
inventory:useItem("202928")
Code: Select all
if inventory:itemTotalCount("202928") >0 then
repeat
inventory:useItem("202928")
yrest(100)
inventory:update()
until inventory:itemTotalCount("202928") == 0
end
- Bill D Cat
- Posts: 555
- Joined: Sat Aug 10, 2013 8:13 pm
- Location: Deep in the Heart of Texas
Re: New AT Charges
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.
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.
Re: New AT Charges
Thanks Bill. been away a few days but, finally got a chance to try it out without quotes. However, I get
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
Here is the full coding2016-10-07 09:12:41 - [string "..."]:10: attempt to call global 'itemTotalCount' (a nil value)
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>
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
- Bill D Cat
- Posts: 555
- Joined: Sat Aug 10, 2013 8:13 pm
- Location: Deep in the Heart of Texas
Re: New AT Charges
Well that's a simple fix. The command is inventory:itemTotalCount(). See my notes in your code below.Ynot wrote:Thanks Bill. been away a few days but, finally got a chance to try it out without quotes. However, I get2016-10-07 09:12:41 - [string "..."]:10: attempt to call global 'itemTotalCount' (a nil value)
Ynot wrote:Here is the full codingI have also tried puting the If statement into the onload section but with the same result.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>
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
Re: New AT Charges
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.
Re: New AT Charges
That worked I could not see the obvious if it smacked me in the face with a frying pan mamy thanks
Who is online
Users browsing this forum: Google [Bot] and 51 guests