Hi thanks for your question.
Relax you are not pregnant
You had sex during your periods,so there is no chance of pregnancy
.Ovulation normally takes place around 14th day of cycle,but since your cycles are irregular ,it is difficult to predect the ovulation but still chances of pregnancy are nill because ovulation don't take place during periods.
There is no need for pregnancy test.
Cramps do occur before and after the periods.
There is nothing to worry,
You can take analgesic
antispasmodic(pain killer) drugs.for your pain.
Hope this answers your questionm