Checking gold

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Checking gold

#1 Post by Desmond » Mon Jan 26, 2015 8:41 am

how to make a function that will test the gold?
for example

Code: Select all

if( 30,000 > inventory:itemTotalCount(Gold) ) then

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: Checking gold

#2 Post by BlubBlab » Mon Jan 26, 2015 9:49 am

if( 30000 > getCurrency("gold") )then
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

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

Re: Checking gold

#3 Post by Desmond » Mon Jan 26, 2015 10:54 am

it does not work correctly even if there is more gold still works

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: Checking gold

#4 Post by BlubBlab » Mon Jan 26, 2015 11:21 am

than you mean:

Code: Select all

if( 30000 <= getCurrency("gold") )then
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

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

Re: Checking gold

#5 Post by Desmond » Mon Jan 26, 2015 11:45 am

BlubBlab wrote:than you mean:

Code: Select all

if( 30000 <= getCurrency("gold") )then
when the gold in a backpack "30000" then the bot has to go to sleep, but even if more gold still goes to sleep, I even put the ==

Code: Select all

      if( 90000 > getCurrency("gold") )then
	        player:sleep()
		end

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: Checking gold

#6 Post by BlubBlab » Mon Jan 26, 2015 12:10 pm

Than is what I wrote correct:
If I write it down like you speak it will look like this:

Code: Select all

	
Code:
if(  getCurrency("gold") >=  30000 )then
     player:sleep()
end
which has logical the same meaning which I wrote above.
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

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

Re: Checking gold

#7 Post by rock5 » Mon Jan 26, 2015 1:48 pm

I hate to bring this up but I don't see a "gold" option in getCurrency. Desmond, when you tried it, didn't you get the "Invalid currency type." message?

I think you can get the gold using this

Code: Select all

inventory:update()
if (inventory.Money >= 30000) then
  • 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: Checking gold

#8 Post by Desmond » Mon Jan 26, 2015 2:14 pm

well, the very same I have more gold and he still goes to sleep. Should if gold less than "30000" to go to sleep

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

Re: Checking gold

#9 Post by rock5 » Mon Jan 26, 2015 9:15 pm

If you have more than 30000 and are using your money and you want to go to sleep when you have less than or equal to 30000 because 30000 is no longer enough, then you use

Code: Select all

if inventory.Money <= 30000 then
or

Code: Select all

if 30000 >= inventory.Money then
They are the same thing.

If you have less than 30000 and you are making money and you want it to go to sleep when it reaches 30000 because it is enough money then you use

Code: Select all

if inventory.Money >= 30000 then
or

Code: Select all

if 30000 <= inventory.Money then
If you think you have it correct and it's still not working then there is probably something else wrong with your file that is not letting this line work.
  • 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

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: Checking gold

#10 Post by ZZZZZ » Tue Jan 27, 2015 8:31 am

Throw in a RoMScript('GetPlayerMoney("copper"); to check if the inventory.Money function is possibly not working correctly?

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

Re: Checking gold

#11 Post by rock5 » Tue Jan 27, 2015 9:22 am

No reason to suspect it doesn't work and it's easy enough to test.

Code: Select all

Command> inventory:update() print(inventory.Money)
122681508
Yep, that's right.
  • 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: Checking gold

#12 Post by Desmond » Tue Jan 27, 2015 12:57 pm

Code: Select all

if 30000 >= inventory.Money then
works thanks "Rock5"
I often cut off Internet whether it is possible to check that when the Internet broke character and then thrown to login to enter?

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

Re: Checking gold

#13 Post by rock5 » Tue Jan 27, 2015 10:55 pm

Desmond wrote:I often cut off Internet whether it is possible to check that when the Internet broke character and then thrown to login to enter?
If you are disconnected from the Internet then you can't log back in. You would have to wait for the Internet to be connected again before trying to log back in. I don't think that's possible with what is available at the moment.
  • 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

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 9 guests