Page 1 of 7

Rock5's BuyFromItemShop userfunction

Posted: Mon Oct 17, 2011 8:16 am
by rock5
These 2 functions allow you to buy items from the Item Shop for yourself and as a present.

There are instruction in the file on how to use them which I will copy here.

Code: Select all

--  Syntax:
--  BuyFromItemShop(itemGUID, secondaryPassword [, number] )
--  BuyPresentFromItemShop(itemGUID, secondaryPassword, recipient [,subject] [,body])
--  guid = FindItemShopGUID(nameOrId, currency [,ammount])
--
--  Arguments:
--    itemGUID (type number) - The uniquie id of the item selection. Use FindItemShopGUID to find.
--    secondaryPassword (type string) - Your secondary password for that account
--    number (type number) - The number you want to buy of that selection. Optional. If not specified will, buy only one.
--    recipient (type string) - The person you want to send the present to.
--    subject (type string) - The subject of the message sent with the present. Optional.
--    body (type string) - The body of the message sent with the present. Optional.
--    nameOrId (type string or number) - The full name or id of the item. Not the GUID.
--    currency (type string) - The currency you wish to use. Can be "diamond", "ruby", "coin" or variations.
--    ammount (type number) - Number of items you receive, "Ammount:n". Optional. Assumes 1.
--
--  Examples:
--    To buy 2 items with GUID of 100
--       BuyFromItemShop(100, "secpass', 2)
--    To buy an item with GUID of 100 and send it as a present
--       BuyPresentFromItemShop(100, "secpass', "recipientName")
--    To find the guid of the 10 pack of charges you buy with coins.
--       guid = FindItemShopGUID(202928,"coin")

Re: Rock5's BuyFromItemShop userfunction

Posted: Mon Oct 17, 2011 8:53 am
by sdude13
sounds nice will try it out. Does it also work with phirius coin items and ruby items ?

Re: Rock5's BuyFromItemShop userfunction

Posted: Mon Oct 17, 2011 9:06 am
by rock5
sdude13 wrote:sounds nice will try it out. Does it also work with phirius coin items and ruby items ?
It should work with any items. Just make sure you select the right item in the shop when getting the itemGUID.

Re: Rock5's BuyFromItemShop userfunction

Posted: Tue Oct 18, 2011 2:12 am
by OneofMany
Rock! you rock!

When i can login again i will test this out immediatly, current working on a project that can surely use this!

OneofMany

Re: Rock5's BuyFromItemShop userfunction

Posted: Tue Oct 18, 2011 2:21 am
by OneofMany
i suppose, when i check if theres more than 1200 tokens in my backpack and i run:

Code: Select all

if inventory:itemTotalCount("Phirius Coins") > 1170 then 
	BuyFromItemShop(0,"2ndpass",1)
end
Where 0 has to be the phirius coin shop itemid, but i cant log in now :)

it will run? Also i see that the secondarypass is with quotes, that has to be?

Or do i have to put something in onload too, this will save me so much time.

Thnx

Re: Rock5's BuyFromItemShop userfunction

Posted: Tue Oct 18, 2011 2:40 am
by rock5
For starters I think they are called 'Phirius Token Coin'. You can also use their Id 203038.

To make sure you have 1200 coins you would use

Code: Select all

if inventory:itemTotalCount("Phirius Token Coin") > 1199 then
The secondary password is a string so it needs quotes. I added the secondary password as an argument because some people might have different passwords for different accounts.

Re: Rock5's BuyFromItemShop userfunction

Posted: Tue Oct 25, 2011 4:34 pm
by OneofMany
If my character trys to buy something from the item shop. I get the error : Item shop backpack is full. There are 1 item transaction not completed or something

Is this a common error? im buying purified fusion stones.

Re: Rock5's BuyFromItemShop userfunction

Posted: Thu Oct 27, 2011 3:16 am
by OneofMany
this is my code i use btw:

Code: Select all

if inventory:itemTotalCount("Phirius Token Coin") >= 1200 then 
BuyFromItemShop(436,"2ndpassword",1)
end
Still getting the error "item shop backpack full"

And there is nothing in there...

Re: Rock5's BuyFromItemShop userfunction

Posted: Thu Oct 27, 2011 6:33 am
by rock5
OneofMany wrote:Still getting the error "item shop backpack full"
Is that the exact error message? Because I don't see that anywhere in the bot. Or are you getting that error in game?

Re: Rock5's BuyFromItemShop userfunction

Posted: Thu Oct 27, 2011 8:00 am
by OneofMany
The error i get ingame, should have told that :-)

Re: Rock5's BuyFromItemShop userfunction

Posted: Thu Oct 27, 2011 8:43 am
by rock5
I'd say if your item shop backpack is not full then it's some sort of bug with the game. I can't see how the bot could cause such an error.

Re: Rock5's BuyFromItemShop userfunction

Posted: Thu Oct 27, 2011 8:55 am
by OneofMany
Was allready thinking the same, as i can buy stuff manually. and the function did work initially. dont know when the function stopped working tho

Re: Rock5's BuyFromItemShop userfunction

Posted: Thu Oct 27, 2011 9:19 am
by rock5
Are you sure the GUID is correct? For me it's different but I'm assuming they might be differrent on different servers.

Re: Rock5's BuyFromItemShop userfunction

Posted: Thu Oct 27, 2011 9:23 am
by rock5
Just had an idea. Is that code you posted part of a loop where it buys more that one puri at a time? Because, probably, if you buy them fast enough you might fill the incoming stack. Although this seems very unlikely.

Re: Rock5's BuyFromItemShop userfunction

Posted: Fri Oct 28, 2011 1:06 am
by OneofMany
I have the code just before logging to next character at the elfdaily.+
first checks the tokens >= 1200, then buy puri

then checks if charges are == 1 if so buy 10 charges if puris are >= 300

It does the trick, but not the buying "Item shop backpack is full"

Re: Rock5's BuyFromItemShop userfunction

Posted: Fri Oct 28, 2011 1:13 am
by OneofMany
The code:

Code: Select all

		if inventory:itemTotalCount("Phirius Token Coin") >= 1200 then 
			BuyFromItemShop(436,"2ndpass",1)
		end
		
		
		
		local ATQ = RoMScript("CheckQuest(421457);");
		if ATQ ~= 0 
		then
		charges = RoMScript("GetMagicBoxEnergy()")
		if charges == 1 then
		if inventory:itemTotalCount("Phirius Token Coin") >= 300 then
		BuyFromItemShop(453,"2ndpass",1)
		inventory:useItem(202928)
		end
		end
		end

Re: Rock5's BuyFromItemShop userfunction

Posted: Mon Oct 31, 2011 1:31 am
by botique
I can confirm the same in-game error (backpack full) when trying to buy purified fusion stones (id 11941) with phirrius tokens.
However, I have no trouble buying transmutor charges.
I used the command line.

Re: Rock5's BuyFromItemShop userfunction

Posted: Mon Oct 31, 2011 7:58 am
by rock5
Looks like I'm not going to be able to help you guys. I just tested buying a puri with phirius coins and it worked. I used

Code: Select all

BuyFromItemShop(261,"mysecpw")
from the commandline. My guid number might be different because I think guid numbers are different between servers. I left out the last argument because I know it defaults to '1'.

Re: Rock5's BuyFromItemShop userfunction

Posted: Mon Oct 31, 2011 10:05 am
by OneofMany
Im gonna try without the 1 too, maybe that helps... ill report in later...

Re: Rock5's BuyFromItemShop userfunction

Posted: Mon Oct 31, 2011 11:21 am
by D1mAnn
what is it?

Code: Select all

RoMScript("ItemMallFrame.lock=1") yrest(500)