Automacro: Number of inventory items

All about the macro plugin can be found in this forum. This forum is intended for the macro plugin only.

Moderator: Moderators

Message
Author
Lordbalmung
Noob
Noob
Posts: 7
Joined: 25 Oct 2014, 17:12
Noob?: No

Automacro: Number of inventory items

#1 Post by Lordbalmung »

I've been trying to write a macro to trigger a pseudo autosell sell sequence which uses the @go command instead of calculating the route and walking all the way back. The biggest problem I have now is to trigger a macro based on the number of items in the inventory, ofcourse inventory trigger gives you the number of a particular item, however I would like to know the sum of all items. Is there a trigger (that I might have missed out from the macro plugin guide) which could do that?

Right now I am using the console message "Calculating route to..." to trigger the autosell and "Storage Closed" to return with a @warp command, but as a programmer that bugs me :?

User avatar
SkylorD
Moderators
Moderators
Posts: 1166
Joined: 16 Dec 2011, 02:53
Noob?: No
Location: Brazil
Contact:

Re: Automacro: Number of inventory items

#2 Post by SkylorD »

$x = @eval (return $::char->inventory->size());

You don't need to use any automacro.

Read this :

http://forums.openkore.com/viewtopic.ph ... 72#p269172
Learn rules

Lordbalmung
Noob
Noob
Posts: 7
Joined: 25 Oct 2014, 17:12
Noob?: No

Re: Automacro: Number of inventory items

#3 Post by Lordbalmung »

Thanks that a breakthrough :!: However anyway I could verify that in an automacro without using the "var" condition?

User avatar
SkylorD
Moderators
Moderators
Posts: 1166
Joined: 16 Dec 2011, 02:53
Noob?: No
Location: Brazil
Contact:

Re: Automacro: Number of inventory items

#4 Post by SkylorD »

http://wiki.openkore.com/index.php/Macro_plugin

Eval condition.

Do u want to check and sum the amount of items in your inventory ? o.O Oh Lord
Learn rules

Post Reply