Buggy War (card game) Bot Simulation I Need Help Debugging

I have been working on a simulation in which two bots play the card game War.

Rules of War

If you aren't already aware of the rules, basically the premise of the game is to get all of the cards. You split one deck evenly (though I just gave them both one 53 card decks to start out with), and every round you both place a card from your deck (deck has to be face down). Whichever card's bigger gets to keep its card and the opponent's card.
If both cards are the same, you go into a War. You both place down another card, rinse and repeat until someone has the bigger card, then the winner gets all of the placed cards in that round. Every used card goes into a discard pile faced up. When your deck runs out, you shuffle the discard pile and use that. The winner is decided when only one person has all the cards.

Basically, the first deck always wins for some reason, and with more cards than what is possible (both start with 53, 53*2 is 106, it's impossible to have 109 cards at the end) and I can't figure out why.

I think you may have calculated the number of cards wrong, since there's 13 cards in each suit (1-10, jack, queen, and king), and 134 is 52, which also means that 2 decks (522) is 104.

After looking in the code, it just looks like there were some cases where it adds the card to the wrong discard list, most likely due to copy/pasting, and forgetting to change the variable name.

I also noticed that you have been doing

Which is probably not doing what you expect. It's deleting the first item, which then moves the second item to the first item, resulting in the next item being deleted not the item that you want deleted. You should instead just delete the first item twice.

war nbot ism script pic (1)

However what I presume to be the actual cause for this issue, is the fact that when it's a draw, there's no check to see if the deck only has 1 card, resulting in the second card being an empty string, which also means that an extra, non-existent, item is being added to the discard list.