void script_367(int arg0,int arg1,int arg2) {
	int ivar3;
	int ivar4;
	ivar3 = 0;
	if (((boolean)arg2)) {
		ivar3 = add(arg1, 17);
	} else {
		ivar3 = arg1;
	}
	ivar4 = getWidgetActualHeight(new WidgetPointer(arg0));
	if (ivar4 < ivar3) {
		setWidgetSize(getWidgetActualWidth(new WidgetPointer(arg0)), min(add(ivar4, 2), ivar3), 0, 0, new WidgetPointer(arg0));
		if (((boolean)mod(ivar4, arg1))) {
			playSoundEffect(9840, 1, 0);
		}
	} else if (ivar4 > ivar3) {
		setWidgetSize(getWidgetActualWidth(new WidgetPointer(arg0)), max(subtract(ivar4, 2), ivar3), 0, 0, new WidgetPointer(arg0));
	} else {
		setScriptCallOnGameloop(-1, "", new WidgetPointer(arg0));
	}
	return;
}
