Code: Select all
@echo off &setlocal
set "number=12345678"
set /a x1=%random%%%8
call set "ros=%%number:~%x1%,1%%"
ECHO %ros%
pause
Code by Batmaster with help from aGerman.
Solution to the looting problem. Should generate a random number between 1 and 8