auto cart problem, console command for cart weight ?

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

Moderator: Moderators

hamncheese
Noob
Noob
Posts: 5
Joined: 25 Sep 2012, 10:20
Noob?: Yes

auto cart problem, console command for cart weight ?

#1 Post by hamncheese »

Hi again, i have a new problem
i cant find the console command for "Display info about current cart weight"
the only reference i can find about weight is :

Code: Select all

weight [<number>]
<number>
- any number.
Gives a report about your inventory weight.
from : http://wiki.openkore.com/index.php/Weight
and

Code: Select all

cartMaxWeight [<number>]
If you have a cart and you set Kore to automatically put items in it (see items_control.txt), Kore will stop putting items to your cart if the cart weight is greater than or equal to the specified number.
from : http://wiki.openkore.com/index.php/CartMaxWeight
what im trying to make is :
automacro, tells the bot to move items from inventory to cart with 3 conditions :
1. bot weight is >40%
2. cart weight is < 80%
3. location is NOT payon_in
when those 3 conditions arent met, the bot will do the basic sellAuto at weight > 60%

when the bot walks into pay_in to sell another automacro with location trigger
1. location IS payon_in
2. cart weight is > 20%
so the bot will keep adding item from inventory to cart until the cart reach weight 20%, while the bot will keeps selling the stuff to npc

maybe something like this ?

Code: Select all

automacro invcart {
	if (location [not] location pay_in01 && weight > 40% && cartWeight < 80%)
	class Merchant
	run-once 1
	call {	
		pause 1
		do cart add @rand(3,20)
		do cart add @rand(3,20)
		do cart add @rand(3,20)
		do cart add @rand(3,20)
		do cart add @rand(3,20)		
		pause 1
		release all
		}
}


automacro cartinv {
	if (location pay_in01 && cartWeight >20%)
	class Merchant
	run-once 1
	call {
		pause 1
		do cart add @rand(3,30)
		do cart add @rand(3,30)
		do cart add @rand(3,30)
		do cart add @rand(3,30)
		do cart add @rand(3,30)
		pause 1
		release all
		}
}
thank you for anyone willing to read and reply my questions :)

ps: thank you chocobrowny for answering my last question :D
hamncheese
Noob
Noob
Posts: 5
Joined: 25 Sep 2012, 10:20
Noob?: Yes

Re: auto cart problem, console command for cart weight ?

#2 Post by hamncheese »

sorry for double post, about the macro heres what i have come up with, and its working... sorta...
and i need your opinion on my macro here

Code: Select all

automacro cartinv {
	cartweight > 50%
	location prt_in
	weight < 90%
	class Merchant
	run-once 1
	call {
		do cart get @rand(1,100)
		do cart get @rand(1,100)
		do cart get @rand(1,100)
		do cart get @rand(1,100)
		do cart get @rand(1,100)
		pause 1
		release all
		}
}
the above macro will move items from cart > Inventory
with this condition :
cartweight > 50%
location prt_in
weight < 90%
class Merchant
this one is working as intended
*i deliberately didnt put any pause in it so the bot will spamm the macro until his weight 90%*

Code: Select all

automacro invcart {
	weight > 50%
	location prontera
	cartweight < 80%
	class Merchant
	run-once 1
	call {	
		pause 1
		do cart add @rand(3,10)
		do cart add @rand(3,10)
		do cart add @rand(3,10)
		do cart add @rand(3,10)
		do cart add @rand(3,10)
		do cart add @rand(3,10)	
		do cart add @rand(3,10)	
		do cart add @rand(3,10)	
		do cart add @rand(3,10)		
		pause 1
		do relog 3
		release all
		}
}
the above macro will do the opposite, moving items from Inventory > cart
the relog is needed so the item list can refresh itself since im only putting items 3-10 to be add into the cart

Code: Select all

automacro owgslave {
	attackAuto 2 <------ can this be a Condition ?
	class Thief
	weight > 50%
	run-once 1
	call {
		pause 3
		do pm Merchant1 x where
		do pm Merchant2 x where
		pause 20
		release all
	}
}
the above macro will make the slave pm the merchant asking where is hes location

Code: Select all

automacro respmerc {
	class Merchant
	pm /x (.*)/
	weight < 59%
	run-once 1
	call {
		do pm $.lastpm xx $.map $.pos
		release all
	}
}
the above macro will make the merchant response to the inquiry from the slaves


and now heres my problem :

Code: Select all

automacro dealslave {
	pm /xx (.*) (.*) (.*)/
	call {
		do conf attackAuto 0
		do move $.lastMatch1 $.lastMatch2 $.lastMatch3
		pause 3
	 	$player = @player ($.lastpm)	<----is this code correct ?
		do deal "$player"
		do deal add @rand(2,10)
		do deal add @rand(2,10)
		do deal add @rand(2,10)
		do deal add @rand(2,10)
		do deal add @rand(2,10)
		do deal add @rand(2,10)
		do deal add @rand(2,10)
		do deal add @rand(2,10)
		do deal add @rand(2,10)
		do deal 
		do deal
		do conf attackAuto 2
		pause 5	
		do relog 5	
		release all
		}
}
The problem is :
1. im not sure the code i put into $player = @player ($.lastpm) is correct
2. i tried putting a real name such as
$player = @player (Merchant1)
do deal "$player"
now when the macro reach the deal part, i notice that the slave will always try to deal Player no 0 in hes Player List
regardless i put whatever name for the $player
and this can be a disaster in a crowded area, so far my temporary solution is moving the merchant to a secluded location, of course this is not a real solution, i tried reading all i can in the forum to no avail
please can anyone help me with this ?

thank you :)
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: auto cart problem, console command for cart weight ?

#3 Post by EternalHarvest »

hamncheese wrote:

Code: Select all

		do deal "$player"
Due to randomness in commands syntax, it needs player index without quotes.