Thanks to whoever helps if(Trigger==1)
{
lpTriggerBot.StartPatch();
}
else
{
lpTriggerBot.RestorePatch();
}

bool triggerstop;
void TrigerBot()
{
DWORD ActivePL = *(DWORD*)Addy_Trigger;
if( ActivePL == 0x2){
mouse_event( MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 );
triggerstop=true;
}
else
{
if (triggerstop){
mouse_event( MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 );
triggerstop=false;
}
if (GetAsyncKeyState(VK_LBUTTON)&0x8000)
{
if (triggerstop){
mouse_event( MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 );
triggerstop=false;
}
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 );
}else{
if (triggerstop){
mouse_event( MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 );
triggerstop=false;
}
mouse_event( MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 );
}
}
}
