Rock5's BuyFromItemShop userfunction

Additional botting resources. Addons may be either for the game itself or for the RoM bot.
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Message
Author
User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's BuyFromItemShop userfunction

#101 Post by Desmond » Thu Apr 10, 2014 9:38 am

yes

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's BuyFromItemShop userfunction

#102 Post by rock5 » Thu Apr 10, 2014 9:39 am

Good.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's BuyFromItemShop userfunction

#103 Post by Desmond » Thu Apr 10, 2014 9:41 am

right now I try to paste into your waypoint

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's BuyFromItemShop userfunction

#104 Post by Desmond » Thu Apr 10, 2014 9:44 am

rock5 works great thanks!

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's BuyFromItemShop userfunction

#105 Post by Desmond » Thu Apr 10, 2014 9:55 am

and how to make passwords for each account to others?

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's BuyFromItemShop userfunction

#106 Post by rock5 » Thu Apr 10, 2014 10:07 am

I usually use the same secondary password so don't have that problem. But you could try this.

Code: Select all

accountpw = {
    [5] = "secondary passwors1",
    [6] = "secondary password2",
    [7] = "secondary password3",
}
BuyFromItemShop(829, accountpw[getAcc()], 1) 
'accountpw' is a list of account numbers and secondary passwords. In the example above, '5', '6' and '7' are the account numbers.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's BuyFromItemShop userfunction

#107 Post by Desmond » Thu Apr 10, 2014 10:12 am

Thanks try little pozhzhe

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's BuyFromItemShop userfunction

#108 Post by Desmond » Thu Apr 10, 2014 10:32 am

why here is a code not working he true test?


if inventory:itemTotalCount("Phirius Token Coin") > 840 then
BuyFromItemShop(829, "km80673460297", 1)
end

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's BuyFromItemShop userfunction

#109 Post by rock5 » Thu Apr 10, 2014 10:37 am

Are you playing with an English client? "Phirius Token Coin" will only work on English client.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's BuyFromItemShop userfunction

#110 Post by Desmond » Thu Apr 10, 2014 10:38 am

No ru how sorry (((

Jorge
Posts: 4
Joined: Sun Apr 27, 2014 7:30 am

Re: Rock5's BuyFromItemShop userfunction

#111 Post by Jorge » Sun Apr 27, 2014 7:40 am

Hello, sorry for my ignorance, but would like to know how to use function to be tested .. because I am beginner here in entato already used it ... Rock waypoints which the first poster of this function. What necessary for it to work?

Jorge
Posts: 4
Joined: Sun Apr 27, 2014 7:30 am

Re: Rock5's BuyFromItemShop userfunction

#112 Post by Jorge » Sun Apr 27, 2014 7:45 am

I followed your instructions, but when you know the number of items ... what to do?

Jorge
Posts: 4
Joined: Sun Apr 27, 2014 7:30 am

Re: Rock5's BuyFromItemShop userfunction

#113 Post by Jorge » Sun Apr 27, 2014 7:48 am

..
Attachments
01.jpg

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's BuyFromItemShop userfunction

#114 Post by rock5 » Sun Apr 27, 2014 9:12 am

The guid number printed is 1148. So to buy that in a waypoint file you would use

Code: Select all

BuyFromItemShop(1148, secondaryPassword , number )
where secondaryPassword is your secondary password and number is how many you want to but but is optional.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Jorge
Posts: 4
Joined: Sun Apr 27, 2014 7:30 am

Re: Rock5's BuyFromItemShop userfunction

#115 Post by Jorge » Sun Apr 27, 2014 10:07 am

Rock .... So where to use this command to test? I'm watching and learning a lot from you ... but lost myself ... where to use the command? sorry

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's BuyFromItemShop userfunction

#116 Post by rock5 » Sun Apr 27, 2014 10:17 am

Well to test it the easiest way would be to start the commandline.xml. Then just type it in.

In the waypoint file all code must be between a <waypoint x... z .. y> and </waypoint> or the <onload> and </onload> at the top of the file. Just add it at the waypoint at which you want to do it.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's BuyFromItemShop userfunction

#117 Post by rock5 » Sat Aug 02, 2014 10:01 pm

Updated to version 1.4:
  • - Fixed bug that made it fail first time (because it takes sooo long for the item shop items to populate the shop).
    - Added 'FindItemShopGUID' function.
A few notes about the new function:
  • - nameOrId must be the full exact name of the item being purchased or any id that yields the correct name.
    - Supported currencies are "coin", "rub", and "dia". Some other variations you can use are "coins", "ruby", "rubies", "diamond", "diamonds", "dias", among other. Also you can use the full name in the current language, eg. in English "Phirius Tokens", in German "Phiriusmarken".
    - The "amount" is the amount shown in the tooltip. Don't get confused by the name. For example "10 Arcane Transmutor Charges" is 1 item that gives you 10 charges. In the tooltip it shows "Amount: 1". Whereas "Convenient Mailbox" can be purchased 10 at a time and shows "Amount: 10". Amount is optional and defaults to 1 so you only have to include it if the amount shown is more than 1. Don't confuse "amount" with the number you wish to buy. Don't forget his is a search function so "amount" is a search criteria.
Here is a simple example to buy charges when you have enough coins.

Code: Select all

if inventory:itemTotalCount(203038) >= 200 -- Enough coin
    coinguid = FindItemShopGUID(202928,"coin")
    BuyFromItemShop(coinguid, "secondary password",1)
end
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: Rock5's BuyFromItemShop userfunction

#118 Post by Rickster » Sun Aug 17, 2014 10:35 am

Hello,

when trying to buy something from the coins store, the bot gets stuck in the loop stating "Waiting for Item Shop database to load."

It waits until I open the shop manually AND change to the coins tab, then it continues.

So I think

Code: Select all

local function commonBuy(_itemGUID, _secondaryPassword, _numberOrRecipient, _subject, _body)
	if RoMScript("ItemMallFrame.OK") ~= true then
		RoMCode("ItemMallFrame:Show() ItemMallFrame:Hide()")
		print("Waiting for Item Shop database to load.")
		repeat
			yrest(50)
		until RoMScript("ItemMallFrame.OK") == true
	end
needs to be modified, not only to open and close the shop, but also switch to the needed tab where one wants to buy item from.

I don´t know myself how to code things to switch to the wanted tab :(

Ric

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's BuyFromItemShop userfunction

#119 Post by rock5 » Sun Aug 17, 2014 10:57 am

Nah, I don't think it has to open the right tab. Probably it just failed to open the item shop and got stuck in that loop waiting for ItemMallFrame.OK to become true, which it never will until the shop is opened. You probably think changing the tab made it go because it just happened to finish loading the database just as you clicked it.

What we can do to fix it is have it try and open the shop if it fails, eg.

Code: Select all

local function commonBuy(_itemGUID, _secondaryPassword, _numberOrRecipient, _subject, _body)
	if RoMScript("ItemMallFrame.OK") ~= true then   
		print("Waiting for Item Shop database to load.")
		repeat
			RoMCode("ItemMallFrame:Show() ItemMallFrame:Hide()")
			local starttime = getTime()
			repeat
				yrest(50)
			until RoMScript("ItemMallFrame.OK") == true or deltaTime(getTime(), starttime) > 1000
		until RoMScript("ItemMallFrame.OK") == true
	end
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: Rock5's BuyFromItemShop userfunction

#120 Post by Rickster » Sun Aug 17, 2014 1:00 pm

On my side it hang in the loop. Then I opened the shop and closed it, nothing happend. Then I opend it, changed to coins store and immediately the bot continues with the input of the secondary PW.

As I am doing that in a loop with several chars and all got stuck at the same point, I thought I found the problem :-/

I will try your fix and report back whats happening.

Thanx
Ric

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest