If the wire from the panel switch to the fuse box is melted, it's not very likely to be the switch. A melted wire is indicative of a short circuit. If your switch fails to a closed position, your lights just stay on. If it fails open, they won't come on. Inspect the wires themselves to make sure none have rubbed through on anything.
Check the plug between the front harness and the rear harness.
Check the whole harness at the rear of the truck. It's relatively short and all one piece and is easily replaceable.
Most importantly, check your ground wire at the back. They get corroded pretty easily and can cause your sypmtoms.
What year truck? What model? Any crazy options or hack jobs under the dash?