The electrical switch on top of the starter motor housing is often the problem when the contact will close under some circumstances and won't close under other circumstances.
I would try disconnecting the battery, removing the switch, turning the contact plate inside the switch, hooking everything back up, and give that a try. If the contact switch or the contact stud on the top of the starter motor are pitted or worn down, that is the most likely culprit, and flipping the switch contact is really a temporary fix.
One way to check for wear in the linkages between the foot pedal and the starter motor is to mash the pedal down slowly (maybe with your hand, as long as you got it in neutral!) and check for sloppiness in the linkage.
Figure that you and whoever all had the truck before you have mashed that starter pedal several thousand times. The mechanical linkage is remarkably sturdy for you and all the previous yeahwhos that have been startin' the truck for all these years, but things do wear out.