Problem with buying items.

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
gloover
Posts: 304
Joined: Wed Jul 07, 2010 4:31 am

Problem with buying items.

#1 Post by gloover »

Hey guys,

I want to buy transmuter charges with this code

Code: Select all

   if (inventory:getItemCount(203038)) > 30 then 
		player:target_NPC("Lehman");
		sendMacro("ChoiceOption(1);");yrest(500);
		sendMacro("ChoiceOption(1);");yrest(500);
    
		while 30 > inventory:getItemCount(203038) do
			RoMScript("StoreBuyItem(1,1)");yrest(200);
			inventory:update();
		end;
		
		sendMacro("CloseWindows();"); yrest(50);
	end;
203038=Phirius Token Coin

something seems to running wrong, the bot opens the dialog window and then close those. My while-loop seems not to working - can someone me help, please!
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Problem with buying items.

#2 Post by rock5 »

You say it opens the dialog but does it open the store? Those yrests might just be too short. Try using bigger values to give time for the dialog to change pages.
  • 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
gloover
Posts: 304
Joined: Wed Jul 07, 2010 4:31 am

Re: Problem with buying items.

#3 Post by gloover »

Hi rock,

yes, the store is open and even if i increase the yrest, it seems to ignore/skip this while-loop. I have defenitely more than 30 coins.

This code

Code: Select all

	if (inventory:getItemCount(203038)) > 30 then 
		player:target_NPC("Lehman");
		sendMacro("ChoiceOption(1);");yrest(300);
		sendMacro("ChoiceOption(1);");yrest(300);

			RoMScript("StoreBuyItem(1,1)");yrest(50);
			RoMScript("StoreBuyItem(1,1)");yrest(50);
			RoMScript("StoreBuyItem(1,1)");yrest(50);
		
		sendMacro("CloseWindows();"); yrest(50);
	end;
works fine, the bot get 3 charges, but using a loop seems to make a problem :-(
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Problem with buying items.

#4 Post by rock5 »

I just went to have a look at LehMan's options. Option 1 is not the store for me. I would have to use

Code: Select all

      sendMacro("ChoiceOption(4);");yrest(300);
      sendMacro("ChoiceOption(1);");yrest(300);
You might want to double check the options.


Wait a second! You can exchange for attributes now? Since when has this been available? What are "Spirit Points"?
  • 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
gloover
Posts: 304
Joined: Wed Jul 07, 2010 4:31 am

Re: Problem with buying items.

#5 Post by gloover »

rock5 wrote: Wait a second! You can exchange for attributes now? Since when has this been available? What are "Spirit Points"?
Whaddayathink? Spirit points? I can nowhere detect this options! Lehman is the transmutor-NPC in the class-hall in Varanas.
Selecting Lehmen I have as first option "Exchange phirius coins for transmutor charges" as second "where I can buy random fusuin stones" and third "resume..." So using the first option opens the dialog "Phirius coin shop" and "resume...".
I nowhere see the 4th. option!

Code: Select all

 player:target_NPC("Lehman");
      sendMacro("ChoiceOption(1);");yrest(300);
      sendMacro("ChoiceOption(1);");yrest(300);
opens the phirius coin shop.

As allready said, this one

Code: Select all

 if (inventory:getItemCount(203038)) > 30 then
      player:target_NPC("Lehman");
      sendMacro("ChoiceOption(1);");yrest(300);
      sendMacro("ChoiceOption(1);");yrest(300);

         RoMScript("StoreBuyItem(1,1)");yrest(50);
         RoMScript("StoreBuyItem(1,1)");yrest(50);
         RoMScript("StoreBuyItem(1,1)");yrest(50);
      
      sendMacro("CloseWindows();"); yrest(50);
   end;
works fine, but how to realize this using a loop, till all phirius-coins (>30) are used?
User avatar
gloover
Posts: 304
Joined: Wed Jul 07, 2010 4:31 am

Re: Problem with buying items.

#6 Post by gloover »

Groovy!
this one works now

Code: Select all

	if (inventory:getItemCount(203038)) > 30 then 		
		player:target_NPC("Lehman");
		sendMacro("ChoiceOption(1);");yrest(300);
		sendMacro("ChoiceOption(1);");yrest(300);
				
		while (inventory:itemTotalCount(203038) > 30) do
			inventory:storeBuyItem(1,1);yrest(100);
		end
		
		sendMacro("CloseWindows();"); yrest(100);
	
	end;	
Another question: how to read out how many charges are in the magic box loaded?
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Problem with buying items.

#7 Post by rock5 »

You beat me to it. Good for you.:)

But you should change "> 30" to ">=30" otherwise it wont buy if you have exactly 30 coins.

GetMagicBoxEnergy() will give you the number of charges. Of course from the bot you would need to use RoMScript to get 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
Post Reply