I'm looking at this script because I am trying to get this working using PHP, but.....
Where do you specify which wallet address you with to withdraw your funds to?
It's clearly written in the OP. You need to familiarize yourself with the Kraken API first.
The Kraken API is somewhat unique in that withdrawal addresses cannot be provided via it. You must add the address and name it via the Kraken web interface, and the name used in this setup is what you need for the `withdrawalkey` variable within the script.
Familiarizing yourself w/ the API documentation will not help other than to point you in this direction as ambiguously as in the OP. Just setup withdrawal via the web UI, you will see how it is supposed to work.
@OP: Useful script, thanks for sharing!