Page 2 of 7
Re: Rock5's BuyFromItemShop userfunction
Posted: Mon Oct 31, 2011 9:42 pm
by rock5
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.
Re: Rock5's BuyFromItemShop userfunction
Posted: Tue Nov 01, 2011 2:17 am
by OneofMany
I can try again today, after maintenance...
Re: Rock5's BuyFromItemShop userfunction
Posted: Tue Nov 01, 2011 6:11 am
by OneofMany
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.
Re: Rock5's BuyFromItemShop userfunction
Posted: Tue Nov 01, 2011 6:18 am
by OneofMany
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..??
Re: Rock5's BuyFromItemShop userfunction
Posted: Tue Nov 01, 2011 6:55 am
by D1mAnn
don't buy
if delete this string says that is not enough space in your backpack, the backpack is free
Re: Rock5's BuyFromItemShop userfunction
Posted: Tue Nov 01, 2011 7:54 am
by OneofMany
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...
Re: Rock5's BuyFromItemShop userfunction
Posted: Tue Nov 01, 2011 8:45 am
by rock5
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.
Re: Rock5's BuyFromItemShop userfunction
Posted: Tue Nov 01, 2011 8:50 am
by D1mAnn
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
Re: Rock5's BuyFromItemShop userfunction
Posted: Tue Nov 01, 2011 8:57 am
by rock5
D1mAnn wrote:need open itemshop and cut function))
Sorry, why did you post this code?
Re: Rock5's BuyFromItemShop userfunction
Posted: Tue Nov 01, 2011 9:21 am
by OneofMany
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.
Re: Rock5's BuyFromItemShop userfunction
Posted: Tue Nov 01, 2011 9:36 am
by OneofMany
3 accounts, 3 successes.
so opening itemshop and closing it again each transaction seems needed it seems.
Re: Rock5's BuyFromItemShop userfunction
Posted: Tue Nov 01, 2011 9:59 am
by D1mAnn
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
Re: Rock5's BuyFromItemShop userfunction
Posted: Tue Nov 01, 2011 10:04 am
by rock5
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?
Re: Rock5's BuyFromItemShop userfunction
Posted: Tue Nov 01, 2011 10:07 am
by D1mAnn
D1mAnn wrote:don't buy
if delete this string says that is not enough space in your backpack, the backpack is free
because of this error
Re: Rock5's BuyFromItemShop userfunction
Posted: Tue Nov 01, 2011 10:08 am
by OneofMany
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
Re: Rock5's BuyFromItemShop userfunction
Posted: Tue Nov 01, 2011 10:22 am
by rock5
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.
Re: Rock5's BuyFromItemShop userfunction
Posted: Tue Nov 01, 2011 10:42 am
by rock5
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.
Re: Rock5's BuyFromItemShop userfunction
Posted: Sat Jan 07, 2012 7:23 pm
by Germangold
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?
Re: Rock5's BuyFromItemShop userfunction
Posted: Sat Jan 07, 2012 10:33 pm
by rock5
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 )
Re: Rock5's BuyFromItemShop userfunction
Posted: Mon Jan 09, 2012 5:43 pm
by Germangold
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