TriggerBot

Posts 1–9 of 9 · Page 1 of 1
TriggerBot
So is a trigger bot a script? If so could someone give me one? Also any trigger bots like the one in reDarkstorm? Thanks in advance.
Code:
static const float s_fStickyMaxDmg = 120;
static const float s_fStickyMaxDistance = 150;
static const float s_fDmgRamp = s_fStickyMaxDistance / s_fStickyMaxDmg / 2;

inline float ApproxStickyDamage(float distance)
{
	if (distance > s_fStickyMaxDistance)
		return 0;
	return (s_fStickyMaxDistance - distance) * s_fDmgRamp + s_fStickyMaxDmg / 2;
};

void Stickybot(CUserCmd* cmd)
{
	if (!CONFIG.m_bStickyTrigger)
		return;

	static float prevEstimatedDmg = 0;
	float estimatedDmg = 0;
	for (auto sticky = LOGIC.m_vOwnedStickies.begin(); sticky != LOGIC.m_vOwnedStickies.end(); ++sticky)
	{
		NetVar::CTFGrenadePipebombProjectile* pSticky = *sticky;
		if (!IsStickyArmed(pSticky))
			continue;

		for (auto player = LOGIC.m_vEnemyTeam.begin(); player != LOGIC.m_vEnemyTeam.end(); ++player)
		{
			NetVar::CTFPlayer* pPlayer = *player; 

			if (!CanBeDamaged(pPlayer))
				continue;

			Vector targetpoint = GetEyePosition(pPlayer);
			Vector startpoint  = pSticky->GetAbsOrigin();

			Vector min, max;
			pPlayer->GetRenderBoundsWorldspace(min, max);

			// may be excessive
			if (!IsBoxIntersectingSphere(min, max, startpoint, s_fStickyMaxDistance))
				continue;
			float dist = pPlayer->GetAbsOrigin().DistTo(startpoint); 
			if (dist > s_fStickyMaxDistance)
				continue;
			
			trace_t		tr;
			MYUTIL_TraceLine(startpoint, targetpoint, MASK_EXPLOSION, pSticky, &tr);

			bool traceable = (tr.m_pEnt == pPlayer);

			if (traceable) 
				estimatedDmg += ApproxStickyDamage(dist);
			
			if (traceable && CONFIG.m_bStickyTriggetAtBest && (dist > CONFIG.m_fStickyTriggerBound))
			{
				__log("Trigger'd @ best!\n");
				cmd->buttons |= IN_ATTACK2;
				return;
			};
		};
	};

	if (prevEstimatedDmg > estimatedDmg)
	{
		__log("Trigger'd!\n");
		cmd->buttons |= IN_ATTACK2;
		prevEstimatedDmg = 0;
	}
	else 
		prevEstimatedDmg = estimatedDmg;
};
Enjoy.
Quote Originally Posted by kozelnono12 View Post
Enjoy.

Unfortunately most of us have no idea what that code does or how to use it.
Can somebody tell me how to use this? Thanks!
Is there a tutorial on how to use that code? If so please tell me.
I think you put that code and make it into a .dll file. I wouldnt do this if your a noob either, ask somebody who knows their shit. It could also be cmd, but im not sure i think it opens a cmd window.
Go to your Steam folder then SteamApps then into your name then at team fortress 2 then at tf then go into cfg then you take like if you want it for pyro the pyro.cfg (open it wth notepad++) and paste the script in it // save and finished!
enjoy

---------- Post added at 02:08 PM ---------- Previous post was at 02:07 PM ----------

Quote Originally Posted by schlabie View Post
I think you put that code and make it into a .dll file. I wouldnt do this if your a noob either, ask somebody who knows their shit. It could also be cmd, but im not sure i think it opens a cmd window.
Its false you put it in the cordinates i posted ....
this is not a script. i know what a tf2 script looks like. like it was said on the auto backstab thread, you probably need to know C++ to use this code. don't bother asking for a tut on this because the only response you'll get will be 'learn C++'.
Your explanation is not clear...
This is what i did, in the folder: "Steam\SteamApps\common\Team Fortress 2\tf\cfg" i had made a file named "spy.cfg" and "sniper.cfg" and in both files i had pasted the script. they did not work.
if that is not what what intended please clarify and provide help.
Posts 1–9 of 9 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us