Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
@echo off
title mineclicker
color f0 

:menu
cls
echo  1.start new
echo  2.credits
echo  3.exit
set /p menu=type your answer and press enter :
if %menu%==1 goto set1
if %menu%==2 goto credits
if %menu%==3 exit  
goto menu

:credits
echo made by jacob finch
pause 
goto menu

:RESET
set wood=0
set stone=0
set iron=0
set diamond=0
set go=0
set db=0
set wb=0
set sb=0
set io=0
set do=0
set bdrop=empty
set insl1=%bdrop%
set insl2=%insl1%
set insl3=%insl2%
set insl4=%insl3%
set insl5=%insl4%
set insl6=%insl5%
set insl7=%insl6%
set insl8=%insl7%
set insl9=%insl8%
set insl10=%insl9%


:set1
cls
set wood=0
set stone=0
set iron=0
set diamond=0
set 1=1
set health=20
set pichealth=100
set blockhp=10
set bhp=0
set insl10=%insl9%
set insl9=%insl8%
set insl8=%insl7%
set insl7=%insl6%
set insl6=%insl5%
set insl5=%insl4%
set insl4=%insl3%
set insl3=%insl2%
set insl2=%insl1%
set insl1=%bdrop%
set 

:rblock
set /a num=%random%
if %num% gtr 80 goto rblock
if %num% lss 1 goto rblock
if %num%==1 set block=dirt
if %num%==2 set block=dirt
if %num%==3 set block=stone
if %num%==4 set block=iron_ore
if %num%==5 set block=gold_ore
if %num%==6 set block=diamond_ore
if %num%==7 set block=wood
if %num%==8 set block=gold_ore
if %num%==9 set block=wood
if %num%==10 set block=stone
if %num%==11 set block=dirt
if %num%==12 set block=dirt
if %num%==13 set block=stone
if %num%==14 set block=iron_ore
if %num%==15 set block=gold_ore
if %num%==16 set block=diamond_ore
if %num%==17 set block=wood
if %num%==18 set block=stone
if %num%==19 set block=wood
if %num%==20 set block=stone
if %num%==21 set block=dirt
if %num%==22 set block=dirt
if %num%==23 set block=stone
if %num%==24 set block=iron_ore
if %num%==25 set block=gold_ore
if %num%==26 set block=diamond_ore
if %num%==27 set block=wood
if %num%==28 set block=gold_ore
if %num%==29 set block=wood
if %num%==30 set block=stone
if %num%==31 set block=dirt
if %num%==32 set block=dirt
if %num%==33 set block=stone
if %num%==34 set block=iron_ore
if %num%==35 set block=gold_ore
if %num%==36 set block=diamond_ore
if %num%==37 set block=wood
if %num%==38 set block=stone
if %num%==39 set block=wood
if %num%==40 set block=stone
if %num%==41 set block=dirt
if %num%==42 set block=dirt
if %num%==43 set block=stone
if %num%==44 set block=iron_ore
if %num%==45 set block=gold_ore
if %num%==46 set block=diamond_ore
if %num%==47 set block=wood
if %num%==48 set block=gold_ore
if %num%==49 set block=wood
if %num%==50 set block=stone
if %num%==51 set block=dirt
if %num%==52 set block=dirt
if %num%==53 set block=stone
if %num%==54 set block=iron_ore
if %num%==55 set block=gold_ore
if %num%==56 set block=diamond_ore
if %num%==57 set block=wood
if %num%==58 set block=stone
if %num%==59 set block=wood
if %num%==60 set block=stone
if %num%==61 set block=dirt
if %num%==62 set block=dirt
if %num%==63 set block=stone
if %num%==64 set block=iron_ore
if %num%==65 set block=gold_ore
if %num%==66 set block=diamond_ore
if %num%==67 set block=wood
if %num%==68 set block=gold_ore
if %num%==69 set block=wood
if %num%==70 set block=stone
if %num%==71 set block=dirt
if %num%==72 set block=dirt
if %num%==73 set block=stone
if %num%==74 set block=iron_ore
if %num%==75 set block=gold_ore
if %num%==76 set block=diamond_ore
if %num%==77 set block=wood
if %num%==78 set block=stone
if %num%==79 set block=wood
if %num%==80 set block=stone


:1.0
color f0
cls
echo  health:%health%                                                
echo  block:%block%        
echo  block health:%blockhp%
echo.
echo.
echo.
echo.
echo.
echo  1.mine
echo  2.inventory
echo  3.menu
echo.
echo.
echo.
echo. 
set /p input= input a number and press enter :
if %input%==1 goto mine 
if %input%==2 goto in
if %input%==3 goto IGM
goto 1.0

:IGM
cls
echo  health:%health%                                                
echo  block:%block%        
echo.
echo.
echo.
echo.
echo.
echo.
color f1
echo  1.resume
echo  2.exit
echo.
echo.
echo.
echo.
echo.
echo.
set /p input= input a number and press enter :
if %input%==1 goto 1.0
if %input%==2 exit
goto IGM



:mine
cls
echo  health:%health%                                                
echo  block:%block%        
echo  block health:%blockhp%
echo.
echo.
echo.                        mineing %block%...
echo.
echo.
echo  1.mine
echo  2.inventory
echo  3.menu
echo.
echo.
echo.
echo.
ping localhost -n 2 >nul
goto bdrops

:in
cls
echo slot 1  %insl1%
echo slot 2  %insl2%
echo slot 3  %insl3%
echo slot 4  %insl4%
echo slot 5  %insl5%
echo slot 6  %insl6%
echo slot 7  %insl7%
echo slot 8  %insl8%
echo slot 9  %insl9%
echo slot 10  %insl10%
pause
goto inv

:inv
cls
echo dirt: %dirt%
echo wood: %wood%
echo gold: %gold%
echo iron: %iron%
echo diamond: %diamonds%
echo wood picaxe: %wpic%
echo iron picaxe: %ipic%
echo diamond picaxe: %dpic%
echo wood axe: %waxe%
echo iron axe: %iaxe%
echo diamond axe: %daxe%
echo wood sword: %wsword%
echo iron sword: %isword%
echo diamond sword: %isword%
pause
goto 1.0



:bdrops
if %block%==dirt set bdrop=dirt_block
if %block%==stone set bdrop=stone_block
if %block%==gold_ore set bdrop=gold_ore
if %block%==iron_ore set bdrop=iron_ore
if %block%==diamond_ore set bdrop=diamond_ore
cls
echo  health:%health%                                                
echo  block:%block%        
echo  block health:%bhp%
echo.
echo.
echo.                        mined %block%
echo.                       picked up %bdrop%
echo.
echo  1.mine/hit
echo  2.inventory
echo  3.menu
echo.
echo.
echo.
ping localhost -n 2 >nul
if %bdrop%=gold_ore (
set %gold%=%gold%+%a1%
)
if %bdrop%=dirt_block (
set %dirt%=%dirt%+%a1%
)
if %bdrop%=wood_block (
set %wood%=%wood%+%a1%
)
if %bdrop%=stone_block (
set %stone%=%stone%+%a1%
)
if %bdrop%=iron_ore (
set %iron%=%iron%+%a1%
)
if %bdrop%=diamond_ore (
set %diamonds%=%diamonds%+%a1%
)
ping localhost -n 5 >nul
goto set1


What I have tried:

im making a game to share with friends
Posted
Updated 26-Oct-19 10:24am

Do yourself a favour and stop trying to write games in batch commands: they are very limited and aren't really suitable.

Instead, learn a programming language like C# (or even VB if you must) and write your games in that. It'll be a whole load easier and more flexible, as well as easier to understand and fix when it goes wrong.

Just because you can do something, does mean it's a good idea!
 
Share this answer
 
Comments
Nelek 26-Oct-19 16:43pm    
OP answered you in the non-solution #2 text (just in case):
[quote]
Thanks for the advice I'm working on learning python but I have been working on this game for a while and would like to see it finished
[/quote]
Maybe you could add some (colour) ascii art, see: Online Ascii Art Creator[^]

You may also be interested in: best-2d-game-engines[^]
 
Share this answer
 
Thanks for the advice I'm working on learning python but I have been working on this game for a while and would like to see it finished
 
Share this answer
 
Comments
Nelek 26-Oct-19 16:42pm    
Please don't post solutions to chat with people asking or answering. The messages are not always sorted by date, so it can be a bit difficult to follow them correctly.
The best option is to use the "Have a question or comment?" (or the tiny "reply" on another comment). Another advantage is, that the person you write to will get a notification, otherwise it could be that he/she doesn't see your additional message.
Member 14635797 29-Oct-19 15:43pm    
ok thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900