I am searching for one shloka which means : If you take gods name in anger , in happiness , in timepass etc it still reaches god unfortunately I am not able to find the shloka , it will be great if someone could tell me the original shloka.
The concept you're talking about is called as "Virodha-Bhakti" or "Nindā-Stuti" - both of which in terms of the figure of Speech in a Language, falls under the cateogry of "Vyājastuti".
These two shlokas seem to match the description asked in the question:
1. From the Śrīmad-Bhāgavatam (Bhāgavata Purāṇa):
कामं क्रोधं भयं स्नेहमैक्यं सौहृदमेव च ।
नित्यं हरौ विदधतो यान्ति तन्मयतां हि ते ॥ १५ ॥
kāmaṃ krodhaṃ bhayaṃ snehamaikyaṃ sauhṛdameva ca ।
nityaṃ harau vidadhato yānti tanmayatāṃ hi te ॥ 15 ॥
Persons who constantly direct their lust, anger, fear, protective affection, feeling of impersonal oneness or friendship toward Lord Hari are sure to become absorbed in thought of Him.
2. From the Śhiva Gītā found in the Padma Purāṇa:
नियामद्यस्तु कुर्वीत भक्तिं वा द्रोहमेव वा ।
तस्यापि चेत्प्रसन्नोऽसौ फलं यच्छति वाञ्चितम् ।। २२ ।।
niyāmadyastu kurvīta bhaktiṃ vā drohameva vā ।
tasyāpi cetprasanno'sau phalaṃ yacchati vāñcitam ।। 22 ।।
Even if one is steadfast either in devotion or (even) in hatred (towards Lord Śhiva), Śhiva (being himself bhagwān Āśhutoṣha) is still pleased (not only with the 'loving devotee' but, even towards the hateful person), and grants all the desired wishes.
Another Śhloka (which is being ascribed to the Śhiva Gītā by several "online-sources", conveys the same meaning as the above Śhloka, however, I'm unable to find its exact source.)
अनादरेण शाठ्येन परिहासेन मायया ।
शिवभक्तिरतश्चेत्स्यादन्त्यजोऽपि विमुच्यते ।।
anādareṇa śāṭhyena parihāsena māyayā ।
śivabhaktirataścetsyādantyajo'pi vimucyate ।।
Anyone while doing criticism, or while disrespecting, or due to jealousy, if gets devoted or gains devotion for Shiva, he would get cleansed of all the Sins immediately.