Salary automatic calculation by category of employee

Is it possible to add scripts with formula for calculating salaries,then choose the category on payroll to get everything done automatically

To understand the payroll process in ERPNext refer :

@revant_one ive checked but the salary structure is for one employee i want to set one that will be used by all employees;
it think it will require a custom script