-
Desmond
- Posts: 184
- Joined: Wed Jan 08, 2014 4:39 pm
- Location: Ukraine
#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
-
BlubBlab
- Posts: 948
- Joined: Fri Nov 30, 2012 11:33 pm
- Location: My little Pony cafe
#2
Post
by BlubBlab » Mon Jan 26, 2015 9:49 am
if( 30000 > getCurrency("gold") )then
-
Desmond
- Posts: 184
- Joined: Wed Jan 08, 2014 4:39 pm
- Location: Ukraine
#3
Post
by Desmond » Mon Jan 26, 2015 10:54 am
it does not work correctly even if there is more gold still works
-
BlubBlab
- Posts: 948
- Joined: Fri Nov 30, 2012 11:33 pm
- Location: My little Pony cafe
#4
Post
by BlubBlab » Mon Jan 26, 2015 11:21 am
than you mean:
Code: Select all
if( 30000 <= getCurrency("gold") )then
-
Desmond
- Posts: 184
- Joined: Wed Jan 08, 2014 4:39 pm
- Location: Ukraine
#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
-
BlubBlab
- Posts: 948
- Joined: Fri Nov 30, 2012 11:33 pm
- Location: My little Pony cafe
#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.
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#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.”
-
Desmond
- Posts: 184
- Joined: Wed Jan 08, 2014 4:39 pm
- Location: Ukraine
#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
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#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
or
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
or
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.”
-
ZZZZZ
- Posts: 513
- Joined: Sun Oct 21, 2012 1:42 am
#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?
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#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.”
-
Desmond
- Posts: 184
- Joined: Wed Jan 08, 2014 4:39 pm
- Location: Ukraine
#12
Post
by Desmond » Tue Jan 27, 2015 12:57 pm
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?
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#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.”
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 1 guest