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
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's BuyFromItemShop userfunction

#21 Post by rock5 » Mon Oct 31, 2011 9:42 pm

When I was just trying the obvious command "CIMF_ShoppingBuy" it didn't quite behave the way I expected. Don't remember now exactly what it did but it was causing me trouble. So I used more of the code I found in the fdb. Where "CIMF_ShoppingBuy" is used, it's preceeded by "ItemMallFrame.lock=1" and followed by "ItemMall_LockUpdate(ItemMallFrame)". When I tried that, it worked as expected. I don't really know what it does.
  • 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
OneofMany
Posts: 119
Joined: Mon May 09, 2011 2:30 am

Re: Rock5's BuyFromItemShop userfunction

#22 Post by OneofMany » Tue Nov 01, 2011 2:17 am

I can try again today, after maintenance...
Its not about cheating. Its about being smarter than the game...

User avatar
OneofMany
Posts: 119
Joined: Mon May 09, 2011 2:30 am

Re: Rock5's BuyFromItemShop userfunction

#23 Post by OneofMany » Tue Nov 01, 2011 6:11 am

Ok, did a bit of testing.

Item ID 453 = 10 charges --> works perfectly

Code: Select all

if inventory:itemTotalCount("Phirius Token Coin") > 1469 then 
			BuyFromItemShop(453,"2ndpass")
			inventory:useItem(202928)
		end
Item ID 436 = Purified Fusion Stone --> tells me item shop backpack is full

Code: Select all

if inventory:itemTotalCount("Phirius Token Coin") > 1169 then 
			BuyFromItemShop(436,"2ndpass")
		end
tried it with item shop backpack open, opening packages so that i could put something in the IS backpack. No avail.
Last edited by OneofMany on Tue Nov 01, 2011 6:18 am, edited 1 time in total.
Its not about cheating. Its about being smarter than the game...

User avatar
OneofMany
Posts: 119
Joined: Mon May 09, 2011 2:30 am

Re: Rock5's BuyFromItemShop userfunction

#24 Post by OneofMany » Tue Nov 01, 2011 6:18 am

And now the strangest thing:

i did put the 2 together in the code

Code: Select all

        if inventory:itemTotalCount("Phirius Token Coin") > 1469 then 
			BuyFromItemShop(453,"2ndpass")
			inventory:useItem(202928)
		end
		
		if inventory:itemTotalCount("Phirius Token Coin") > 1169 then 
			BuyFromItemShop(436,"2ndpass")
		end
and now it works...

EDIT: Cheering to early

it logged in to next character and again i get the error: Item shop backpack full

BUT

When i manually buy the charges, it works, and then the bot will buy the puri too...

so the Buyfromitemshop works for me when i manually buy something first..??
Its not about cheating. Its about being smarter than the game...

D1mAnn
Posts: 37
Joined: Mon Jul 04, 2011 4:56 am

Re: Rock5's BuyFromItemShop userfunction

#25 Post by D1mAnn » Tue Nov 01, 2011 6:55 am

don't buy

Image

if delete this string says that is not enough space in your backpack, the backpack is free

User avatar
OneofMany
Posts: 119
Joined: Mon May 09, 2011 2:30 am

Re: Rock5's BuyFromItemShop userfunction

#26 Post by OneofMany » Tue Nov 01, 2011 7:54 am

so i need to alter something in the .lua to make it work?

Because i see the secondary password popup, and get filled in. Then it says "Item shop backpack full"

Then i just buy something manually, and i dont have to fill in the password.

when i resume the bot, and it comes to its next check for coins > 1469

then the buying succeeds...
Its not about cheating. Its about being smarter than the game...

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

Re: Rock5's BuyFromItemShop userfunction

#27 Post by rock5 » Tue Nov 01, 2011 8:45 am

That would suggest there is something wrong with the password entry. But buying charges works, which also requires the password.

It doesn't make sense.

Unless the password is wrong when buying puris. But the error message is wrong.
  • 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

D1mAnn
Posts: 37
Joined: Mon Jul 04, 2011 4:56 am

Re: Rock5's BuyFromItemShop userfunction

#28 Post by D1mAnn » Tue Nov 01, 2011 8:50 am

need open itemshop and cut function))

Code: Select all

function BuyFromItemShop(_itemGUID, _secondaryPassword, _number )
	if _number == nil then
		_number = 1
	end

	RoMScript("CheckPasswordState(); StaticPopup1EditBox:ClearFocus()")
	yrest(1000)
	if RoMScript("StaticPopup1:IsVisible()") then
		RoMScript("StaticPopup1EditBox:SetText(\"".._secondaryPassword.."\")") yrest(1000)
		RoMScript("StaticPopup_EnterPressed(StaticPopup1);") yrest(1000)
		RoMScript("StaticPopup1:Hide();");
	end
	RoMScript("CIMF_ShoppingBuy(".._itemGUID.." ,".._number..")"); yrest(500) -- buy items
end

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

Re: Rock5's BuyFromItemShop userfunction

#29 Post by rock5 » Tue Nov 01, 2011 8:57 am

D1mAnn wrote:need open itemshop and cut function))
Sorry, why did you post this code?
  • 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
OneofMany
Posts: 119
Joined: Mon May 09, 2011 2:30 am

Re: Rock5's BuyFromItemShop userfunction

#30 Post by OneofMany » Tue Nov 01, 2011 9:21 am

i think i got it.

I found out, when i open the itemshop (so it gets visible) and i close it again, then run the bot. it works!

so now i put

Code: Select all

RoMScript("ItemMallFrame:Show()") yrest(1000) -- time for itemshop to pop
RoMScript("ItemMallFrame:Hide()")
in the userfunction. and it works... testing multiple characters now if it will continue to work.
Its not about cheating. Its about being smarter than the game...

User avatar
OneofMany
Posts: 119
Joined: Mon May 09, 2011 2:30 am

Re: Rock5's BuyFromItemShop userfunction

#31 Post by OneofMany » Tue Nov 01, 2011 9:36 am

3 accounts, 3 successes.

so opening itemshop and closing it again each transaction seems needed it seems.
Its not about cheating. Its about being smarter than the game...

D1mAnn
Posts: 37
Joined: Mon Jul 04, 2011 4:56 am

Re: Rock5's BuyFromItemShop userfunction

#32 Post by D1mAnn » Tue Nov 01, 2011 9:59 am

yeah this good work thx)

Code: Select all

function BuyFromItemShop(_itemGUID, _secondaryPassword, _number )
	if _number == nil then
		_number = 1
	end
	
	RoMScript("ItemMallFrame:Show()") yrest(1000)
	RoMScript("ItemMallFrame:Hide()")
	
	RoMScript("CheckPasswordState(); StaticPopup1EditBox:ClearFocus()")
	yrest(1000)
	if RoMScript("StaticPopup1:IsVisible()") then
		RoMScript("StaticPopup1EditBox:SetText(\"".._secondaryPassword.."\")") yrest(1000)
		RoMScript("StaticPopup_EnterPressed(StaticPopup1);") yrest(1000)
		RoMScript("StaticPopup1:Hide();");
	end
	RoMScript("CIMF_ShoppingBuy(".._itemGUID.." ,".._number..")"); yrest(500) -- buy items
end

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

Re: Rock5's BuyFromItemShop userfunction

#33 Post by rock5 » Tue Nov 01, 2011 10:04 am

D1mAnn I notice that you removed

Code: Select all

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

Code: Select all

	RoMScript("ItemMall_LockUpdate(ItemMallFrame);")
Why is that?
  • 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

D1mAnn
Posts: 37
Joined: Mon Jul 04, 2011 4:56 am

Re: Rock5's BuyFromItemShop userfunction

#34 Post by D1mAnn » Tue Nov 01, 2011 10:07 am

D1mAnn wrote:don't buy

Image

if delete this string says that is not enough space in your backpack, the backpack is free
because of this error

User avatar
OneofMany
Posts: 119
Joined: Mon May 09, 2011 2:30 am

Re: Rock5's BuyFromItemShop userfunction

#35 Post by OneofMany » Tue Nov 01, 2011 10:08 am

It does work without, but not foolproof. so i kept it in...

Also he removed the security checks. I'd like to keep those in too

And Diman, the error was because u didnt open the itemshop first. i bet it works now with only opening the itemshop and leaving the other commands in
Its not about cheating. Its about being smarter than the game...

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

Re: Rock5's BuyFromItemShop userfunction

#36 Post by rock5 » Tue Nov 01, 2011 10:22 am

Not really. It's a bit blury but there's no reason why it should be missing a '}'. Are you using the latest bot with the latest game client? Are there any conflicted files? Or maybe it's a language problem. Maybe some characters are being interpreted in some strange way.
  • 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

#37 Post by rock5 » Tue Nov 01, 2011 10:42 am

I just discovered a bug. This wont work.

Code: Select all

	RoMScript("ItemMallFrame.lock=1") yrest(500)
You can't just assign values like that. I forgot to do it properly. It's supposed to be.

Code: Select all

	RoMScript("} ItemMallFrame.lock=1 a={") yrest(500)
Try that.

Don't ask me why the function still worked for me with that bug.
  • 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

Germangold
Posts: 276
Joined: Thu Oct 22, 2009 3:58 am

Re: Rock5's BuyFromItemShop userfunction

#38 Post by Germangold » Sat Jan 07, 2012 7:23 pm

Hi Rock5
i do use your "fastLogin Revisited" to multiaccounting, each account has a differnt 2nd password but its already in logindialog.lua
does your Buying Addon works out of the box reading out the 2nd passphare for their?

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

Re: Rock5's BuyFromItemShop userfunction

#39 Post by rock5 » Sat Jan 07, 2012 10:33 pm

No. Passwords are not accessable to the game or the bot. You have to specify the password. You could do something like this

Code: Select all

local pw = {
   [1] = "passforacc1",
   [3] = "passforacc3",
   [6] = "passforacc6",
}
local curacc = RoMScript("LogID")
BuyFromItemShop(_itemGUID, pw[curacc], _number )
  • 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

Germangold
Posts: 276
Joined: Thu Oct 22, 2009 3:58 am

Re: Rock5's BuyFromItemShop userfunction

#40 Post by Germangold » Mon Jan 09, 2012 5:43 pm

rock5 wrote:No. Passwords are not accessable to the game or the bot. You have to specify the password. You could do something like this

Code: Select all

local pw = {
   [1] = "passforacc1",
   [3] = "passforacc3",
   [6] = "passforacc6",
}
local curacc = RoMScript("LogID")
BuyFromItemShop(_itemGUID, pw[curacc], _number )

that is fine so far
if i have 10 account for farming phirus token each day

Code: Select all

local secondarypasspharse = {
   [1] = "firstpass",
   [2] = "2ndpass",
   [3] = "3rdpass",
   [4] = "4thpass",
   [5] = "fithpass",
   [6] = "sixthpass",
   [7] = "7thpass",
   [8] = "8thpass",
   [9] = "9thpass",
   [10] = "10thpass",
}


local accountnames = {
    [1] = "firstacc",
   [2] = "2ndacc",
   [3] = "3rdacc",
   [4] = "4thacc",
   [5] = "fithacc",
   [6] = "sixthacc",
   [7] = "7thacc",
   [8] = "8thacc",
   [9] = "9thacc",
   [10] = "10thacc",
}
There is a build in function to read AccountName

Code: Select all

ActualAccoutname= RoMScript("GetAccountName();");
/script DEFAULT_CHAT_FRAME:AddMessage(GetAccountName());
how do I get this to work?

if actualaccountname is equal to the [9] in accountnames it should select the same row in secondarypasspharse

kind regards

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests