Rakancito

Auto Pick with filter.

9 posts in this topic

https://github.com/Rakancito/auto-pick-with-filter

 

Hi guys,

I observed that a person asked for the car pick with filters but they didn't give him the correct answer, and that some cheats have it, here is an example, i tested it in my Test Server and it works correctly, i hope not forgot to add some part of the code since. I finished the system a while ago, if you have one error tell me and i will resolve 😉.

 

270426filtros.jpg

  • Like 4
  • Thanks 2

Share this post


Link to post
Share on other sites

The idea isn't so bad, but the code has too many useless lines, here's what you can do to improve it.

On 9/27/2019 at 2:07 PM, Rakancito said:
Spoiler


	def RefreshPickupFilter(self):
		#Weapon
		if systemSetting.IsPickUpFilterWeapon():
			self.PickUpFilterList[0].Down()
		else:
			self.PickUpFilterList[0].SetUp()
		#Armor
		if systemSetting.IsPickUpFilterArmor():
			self.PickUpFilterList[1].Down()
		else:
			self.PickUpFilterList[1].SetUp()
		#Ear
		if systemSetting.IsPickUpFilterEar():
			self.PickUpFilterList[2].Down()
		else:
			self.PickUpFilterList[2].SetUp()
		#Neck
		if systemSetting.IsPickUpFilterNeck():
			self.PickUpFilterList[3].Down()
		else:
			self.PickUpFilterList[3].SetUp()
		#Foots
		if systemSetting.IsPickUpFilterFoots():
			self.PickUpFilterList[4].Down()
		else:
			self.PickUpFilterList[4].SetUp()		
		#Shield
		if systemSetting.IsPickUpFilterShield():
			self.PickUpFilterList[5].Down()
		else:
			self.PickUpFilterList[5].SetUp()		
		#Book
		if systemSetting.IsPickUpFilterBook():
			self.PickUpFilterList[6].Down()
		else:
			self.PickUpFilterList[6].SetUp()		
		#Stone
		if systemSetting.IsPickUpFilterStone():
			self.PickUpFilterList[7].Down()
		else:
			self.PickUpFilterList[7].SetUp()		
		#Etc
		if systemSetting.IsPickUpFilterEtc():
			self.PickUpFilterList[8].Down()
		else:
			self.PickUpFilterList[8].SetUp()

To:

Spoiler

def RefreshPickupFilter(self):
	checkFilterList = (
		systemSetting.IsPickUpFilterWeapon(), systemSetting.IsPickUpFilterArmor(),
		systemSetting.IsPickUpFilterEar(), systemSetting.IsPickUpFilterNeck(),
		systemSetting.IsPickUpFilterFoots(), systemSetting.IsPickUpFilterShield(),
		systemSetting.IsPickUpFilterBook(), systemSetting.IsPickUpFilterStone(),
		systemSetting.IsPickUpFilterEtc()
	)
	
	for child, flag in zip(self.PickUpFilterList, checkFilterList):
		if flag:
			child.Down()
		else:
			child.SetUp()

 

On 9/27/2019 at 2:07 PM, Rakancito said:
Spoiler


			self.PickUpFilterList.append(GetObject("Pick_Up_FilterWeapon"))
			self.PickUpFilterList.append(GetObject("Pick_Up_FilterArmor"))
			self.PickUpFilterList.append(GetObject("Pick_Up_FilterEar"))
			self.PickUpFilterList.append(GetObject("Pick_Up_FilterNeck"))
			self.PickUpFilterList.append(GetObject("Pick_Up_FilterFoots"))
			self.PickUpFilterList.append(GetObject("Pick_Up_FilterShield"))
			self.PickUpFilterList.append(GetObject("Pick_Up_FilterBook"))
			self.PickUpFilterList.append(GetObject("Pick_Up_FilterStone"))
			self.PickUpFilterList.append(GetObject("Pick_Up_FilterEtc"))

To:

Spoiler

for name in ('Weapon','Armor','Ear','Neck','Foots','Shield','Book','Stone','Etc'):
	self.PickUpFilterList.append(GetObject("Pick_Up_Filter{}".format(name)))

 

On 9/27/2019 at 2:07 PM, Rakancito said:
Spoiler


		self.PickUpFilterList[0].SetToggleUpEvent(self.__OnClickPickupFilterButtonWeapon) # Weapon
		self.PickUpFilterList[0].SetToggleDownEvent(self.__OnClickPickupFilterButtonWeapon) # Weapon
		self.PickUpFilterList[1].SetToggleUpEvent(self.__OnClickPickupFilterButtonArmor) # Armor
		self.PickUpFilterList[1].SetToggleDownEvent(self.__OnClickPickupFilterButtonArmor) # Armor
		self.PickUpFilterList[2].SetToggleUpEvent(self.__OnClickPickupFilterButtonEar) # Ear
		self.PickUpFilterList[2].SetToggleDownEvent(self.__OnClickPickupFilterButtonEar) # Ear
		self.PickUpFilterList[3].SetToggleUpEvent(self.__OnClickPickupFilterButtonNeck) # Neck
		self.PickUpFilterList[3].SetToggleDownEvent(self.__OnClickPickupFilterButtonNeck) # Neck
		self.PickUpFilterList[4].SetToggleUpEvent(self.__OnClickPickupFilterButtonFoots) # Foots
		self.PickUpFilterList[4].SetToggleDownEvent(self.__OnClickPickupFilterButtonFoots) # Foots
		self.PickUpFilterList[5].SetToggleUpEvent(self.__OnClickPickupFilterButtonShield) # Shield
		self.PickUpFilterList[5].SetToggleDownEvent(self.__OnClickPickupFilterButtonShield) # Shield
		self.PickUpFilterList[6].SetToggleUpEvent(self.__OnClickPickupFilterButtonBook) # Books
		self.PickUpFilterList[6].SetToggleDownEvent(self.__OnClickPickupFilterButtonBook) # Books
		self.PickUpFilterList[7].SetToggleUpEvent(self.__OnClickPickupFilterButtonStone) # Stone
		self.PickUpFilterList[7].SetToggleDownEvent(self.__OnClickPickupFilterButtonStone) # Stone
		self.PickUpFilterList[8].SetToggleUpEvent(self.__OnClickPickupFilterButtonEtc) # Etc
		self.PickUpFilterList[8].SetToggleDownEvent(self.__OnClickPickupFilterButtonEtc) # Etc

To:

Spoiler

eventFuncList = (
	self.__OnClickPickupFilterButtonWeapon, self.__OnClickPickupFilterButtonArmor, self.__OnClickPickupFilterButtonEar,
	self.__OnClickPickupFilterButtonNeck, self.__OnClickPickupFilterButtonFoots, self.__OnClickPickupFilterButtonShield,
	self.__OnClickPickupFilterButtonBook, self.__OnClickPickupFilterButtonStone, self.__OnClickPickupFilterButtonEtc
)

for child, event in zip(self.PickUpFilterList, eventFuncList):
	child.SetToggleUpEvent(event)
	child.SetToggleDownEvent(event)

 

  • Like 6

Share this post


Link to post
Share on other sites
En 5/11/2019 a las 5:20, Tallywa dijo:

bump

In pythonItem.cpp add after this function bool CPythonItem::GetCloseItem(const TPixelPosition & c_rPixelPosition, DWORD * pdwItemID, DWORD dwDistance)

 

bool CPythonItem::GetCloseItemVector(const std::string& myName, const TPixelPosition& c_rPixelPosition, std::vector<DWORD>& itemVidList)
{
	DWORD dwCloseItemDistance = 1000 * 1000;
	
	TGroundItemInstanceMap::iterator i;
	for (i = m_GroundItemInstanceMap.begin(); i != m_GroundItemInstanceMap.end(); ++i)
	{
		TGroundItemInstance * pInstance = i->second;

		DWORD dwxDistance = DWORD(c_rPixelPosition.x - pInstance->v3EndPosition.x);
		DWORD dwyDistance = DWORD(c_rPixelPosition.y - (-pInstance->v3EndPosition.y));
		DWORD dwDistance = DWORD(dwxDistance * dwxDistance + dwyDistance * dwyDistance);

		if (dwDistance < dwCloseItemDistance && (pInstance->stOwnership == "" || pInstance->stOwnership == myName))
		{
			itemVidList.push_back(i->first);
		}
	}

	return true;
}

 

pythonItem.h after this bool    GetCloseItem(const TPixelPosition & c_rPixelPosition, DWORD* pdwItemID, DWORD dwDistance=300); add

bool 	GetCloseItemVector(const std::string& myName, const TPixelPosition& c_rPixelPosition, std::vector<DWORD>& itemVidList);

 

Share this post


Link to post
Share on other sites

It doesnt work for me. No sysser error or something. 

I have autopick up on, and when i click on armors it pick the armor. When i dont click on armors,the system still pick the armors. 

I dont know

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.