elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Curso de javascript por TickTack


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  Alguna Idea de este codigo batch??
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Alguna Idea de este codigo batch??  (Leído 2,944 veces)
xBart

Desconectado Desconectado

Mensajes: 33



Ver Perfil
Alguna Idea de este codigo batch??
« en: 16 Abril 2011, 18:39 pm »

ola buenos dias a todos, hace unos dias, comprobe errores en mi usb, con la herramienta de windows que trae por defecto.

Encontre una carpeta llenas de archivos bat, con nombres como FILE0034.bat, FILE0035.bat, y asi sucesivamente, la carpeta no recuerdo como se llamaba pero tambien era un nombre rraro.

Al grano, espero y alguien de me diga que significa, que de batch le entiendo poco, y solo le entiendo algo asi de conversacion, jajaja. pero no encuentro respuesta.

De antremano Gracias...

Código
  1. cls
  2. @echo off
  3. setlocal enabledelayedexpansion
  4. if /i "%1"=="SecondWindow" goto SecondWindow
  5. goto Start
  6.  
  7. :Process_Options
  8. for /f "tokens=1* delims=~" %%I in ("!data!") do (
  9. echo %%I | find /i "ConversationDirectory" >nul
  10. if /i !errorlevel!==0 set Convdir=%%J& exit /b
  11. )
  12.  
  13. for /f "tokens=1* delims=~" %%I in ("!data!") do (
  14. echo %%I | find /i "SavePath" >nul
  15. if /i !errorlevel!==0 set SavePath=%%J& exit /b
  16. )
  17.  
  18. for /f "tokens=1* delims=~" %%I in ("!data!") do (
  19. echo %%I | find /i "DoubleWindow" >nul
  20. if /i !errorlevel!==0 set DoubleWindow=%%J& exit /b
  21. )
  22.  
  23.  
  24. :start
  25. for /f "delims=" %%I in ("%0") do set ProgFilePath=%%~sI
  26. if not exist chatencode.ini set DoubleWindow=1& goto Fileusername
  27.  
  28. set counterE=0
  29. for /f "skip=1 delims=" %%I in (Chatencode.ini) do (set data=%%I& call :Process_Options)
  30.  
  31. :Fileusername
  32.  
  33. title ChatEncode
  34.  
  35. set Fileusername=
  36. echo Enter your username.
  37. set /p Fileusername=
  38. if not defined Fileusername cls& goto Fileusername
  39. if /i "%Fileusername%"==" " goto Fileusername
  40.  
  41.  
  42. :choice
  43. title ChatEncode
  44. echo Enter the number of your choice.
  45. echo 1. Start Conversation
  46. echo 2. Join Conversation
  47. echo 3. Options
  48. echo 4. Single Encode
  49. echo 5. Single Decode
  50. echo 6. Delete Conversations
  51. echo 7. Credits
  52. set choice=
  53. set /p choice=
  54. if not defined choice cls& goto choice
  55. if /i "%choice%"==" " cls& goto choice
  56. set choice=%choice:~0,1%
  57. if /i not %choice% geq 1 cls& goto choice
  58. if /i not %choice% leq 7 cls& goto choice
  59.  
  60. goto choice%choice%
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76. :choice1
  77. Title Start a conversation
  78. echo Choose type of session (in !convdir!).
  79. echo 1. Public conversation (Anyone can join or read)
  80. echo 2. Encrypted conversation (Can only be read or joined with correct password)
  81. echo Or change the directory.
  82. echo 3. Change the conversation directory. (Current is !convdir!)
  83. set choice=
  84. set /p choice=
  85. if not defined choice cls& goto choice1
  86. if /i "%choice%"==" " cls& goto choice1
  87. set choice=%choice:~0,1%
  88. if /i not %choice% geq 1 cls& goto choice1
  89. if /i not %choice% leq 3 cls& goto choice1
  90. goto choice1-%choice%
  91.  
  92.  
  93. :choice1-1
  94.  
  95. :Conversationsetup
  96. set /a counter1=counter1
  97. set timestart=%time:~0,-3%
  98. set timestart=%timestart::=.%
  99. if /i "%time:~0,1%"==" " set timestart=0%timestart:~1%
  100. if exist !convdir!\ChatEncode% style="color: #448888;">counter1%* (
  101. set /a counter1= !counter1! + 1
  102. goto conversationsetup
  103. )
  104.  
  105. set conversationpath=!convdir!\ChatEncode!counter1!_% style="color: #448888;">date:/=-%_%timestart%.log
  106.  
  107. set message=Members: %Fileusername%
  108. if defined encryptedconvo (
  109. set encodedmessage=
  110. call :startencode
  111. set message=!encodedmessage!
  112. set encodedmessage=
  113. )
  114.  
  115. >!conversationpath! echo %message%
  116. title !Conversationpath!
  117. echo Conversation set up: !conversationpath!
  118. echo Waiting for other participants...
  119.  
  120. set message=Members: %Fileusername%,
  121.  
  122. if defined encryptedconvo (
  123. set encodedmessage=
  124. call :startencode
  125. set message=!encodedmessage!
  126. set encodedmessage=
  127. )
  128.  
  129. :nonewmembersyet
  130. type "!conversationpath!" | find /i "%message%" >nul
  131. if %errorlevel% neq 0 goto nonewmembersyet
  132. set tokenoffset=3
  133. set usernumber=2
  134. for /f "delims=" %%I in (!conversationpath!) do set message=%%I
  135. if defined encryptedconvo (
  136. set decodedmessage=
  137. set encodedmessage=!message!
  138. call :startdecode
  139. set message=!decodedmessage!
  140. )
  141. echo %message%
  142.  
  143. if defined DoubleWindow (
  144. start cmd /k !ProgFilePath! Secondwindow !Conversationpath! % style="color: #448888;">encryptedconvo%
  145. goto FirstWindow
  146. )
  147. goto Unencrypted_Conversation
  148.  
  149.  
  150.  
  151.  
  152.  
  153. :Choice1-2
  154. call :setupencoding
  155. set EncryptedConvo=1
  156. goto conversationsetup
  157.  
  158.  
  159. :choice1-3
  160. call :Set_Temp_Path
  161. goto choice1
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168. :choice2
  169. title Join a conversation
  170. echo Select conversation location.
  171. echo 1. !convdir!
  172. echo 2. Other
  173. set choice=
  174. set /p choice=
  175. if not defined choice cls& goto choice2
  176. if /i "%choice%"==" " cls& goto choice2
  177. set choice=%choice:~0,1%
  178. if /i not %choice% geq 1 cls& goto choice2
  179. if /i not %choice% leq 2 cls& goto choice2
  180. goto choice2-%choice%
  181.  
  182.  
  183. :choice2-1
  184. echo Choose type of existing session.
  185. echo 1. Public conversation
  186. echo 2. Encrypted conversation
  187. set choice=
  188. set /p choice=
  189. if not defined choice cls& goto choice2-1
  190. if /i "%choice%"==" " cls& goto choice2-1
  191. set choice=%choice:~0,1%
  192. if /i not %choice% geq 1 cls& goto choice2-1
  193. if /i not %choice% leq 2 cls& goto choice2-1
  194. goto choice2-1-%choice%
  195.  
  196. :choice2-2
  197. call :Set_Temp_Path
  198. goto choice2-1
  199.  
  200. :choice2-1-2
  201. call :setupencoding
  202. set EncryptedConvo=1
  203. goto join_conversation
  204.  
  205.  
  206. :choice2-1-1
  207. set encryptedconvo=
  208.  
  209.  
  210. :Join_Conversation
  211. setlocal enabledelayedexpansion
  212. set counterQ=0
  213. set count=0
  214. for %%I in (!convdir!\ChatEncode*) do set /a count= !count! + 1
  215.  
  216. title Currently open conversations
  217.  
  218. echo If the members in a conversation aren't shown, your encoding settings are wrong for that conversation.
  219.  
  220. if /i %count%==0 (echo No conversations here.& pause>nul& cls& goto choice2)
  221. if /i %count%==1 (
  222. echo There is 1 open conversation:
  223. ) else (
  224. echo There are %count% open conversations:
  225. )
  226.  
  227.  
  228. set MemberMessage=Members:
  229. if defined encryptedconvo (
  230. set message=Members:
  231. set encodedmessage=
  232. call :startencode
  233. set MemberMessage=!encodedmessage!
  234. set encodedmessage=
  235. )
  236. for %%I in (!convdir!\ChatEncode*) do set /a counterQ= !CounterQ! + 1& echo Conversation Number !counterQ!. % style="color: #448888;">%~nI& set openconvpath=%%~sI& call :JoinUnencryptedMembers
  237. echo Enter number of desired conversation or press enter to refresh.
  238. set choice=
  239. set /p choice=
  240.  
  241. if not defined choice cls& goto choice2-1-1
  242. if /i "%choice%"==" " cls& goto choice2-1-1
  243. set choice=%choice:~0,1%
  244. if /i not %choice% geq 1 cls& goto choice2-1
  245. if /i not %choice% leq %counterQ% cls& goto choice2-1-1
  246. set conversationpath=!openconv% style="color: #448888;">choice%!
  247.  
  248. set skipthisone=1
  249. type "!conversationpath!" | find /v /i "%Membermessage%" >!conversationpath!.temp
  250.  
  251. set counterB=0
  252. for /f "delims=" %%I in ('type "!openconvpath!"') do set /a counterB= !counterB! + 1& set ConvoData!counterB!=%% style="color: #448888;">I& set memberline=%convodata1%
  253.  
  254. set message=, %Fileusername%
  255.  
  256. if defined encryptedconvo (
  257. set encodedmessage=
  258. call :startencode
  259. set message=!encodedmessage!
  260. set encodedmessage=
  261. )
  262.  
  263. >!conversationpath!.temp2 echo %memberline%%message%
  264.  
  265. set memberline=
  266. set message=
  267.  
  268. >!conversationpath! type "!conversationpath!.temp2"
  269. >>!conversationpath! type "!conversationpath!.temp"
  270.  
  271. del !conversationpath!.temp2
  272. del !conversationpath!.temp
  273. set message=~~~User %Fileusername% Joined Conversation [%time:~0,-3%]
  274.  
  275. if defined encryptedconvo (
  276. set encodedmessage=
  277. call :startencode
  278. set message=!encodedmessage!
  279. set encodedmessage=
  280. )
  281. >>!conversationpath! echo !message!
  282.  
  283. if defined DoubleWindow (
  284. start cmd /c !ProgFilePath! Secondwindow !Conversationpath! % style="color: #448888;">encryptedconvo%
  285. goto FirstWindow
  286. )
  287.  
  288. goto Unencrypted_Conversation
  289.  
  290.  
  291. :JoinUnencryptedMembers
  292. if defined encryptedconvo (
  293. set decodedmessage=
  294. set encodedmessage=
  295. )
  296.  
  297. set CounterL=0
  298.  
  299. for /f "delims=" %%I in ('type "!openconvpath!"') do set /a counterL= !counterL! + 1& set ConvoData!counterL!=%% style="color: #448888;">I
  300. for /f "delims=" %%I in ("!convodata1!") do set ConvoData=%%I
  301.  
  302. if defined encryptedconvo (
  303. set encodedmessage=!Convodata!
  304. set decodedmessage=
  305. call :startdecode
  306. echo !decodedmessage! | find /i "members"
  307. set decodedmessage=
  308. ) ELSE (
  309. echo !Convodata! | Find /i "members"
  310. )
  311.  
  312.  
  313. set openconv%counterQ%=!openconvpath!
  314. exit /b
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336. :makedirectory
  337. echo Directory not found, create directory?
  338. set /p yesno=
  339. if not defined yesno goto makedirectory
  340. if /i NOT "%yesno:~0,1%"=="Y" (goto choice3%numbertwo%) ELSE for /f "delims=" %%I in ("!% style="color: #448888;">workpath%!") do mkdir %%I
  341. exit /b
  342.  
  343.  
  344. :Choice3
  345. title Options
  346. echo Use the DoubleWindow feature? [Y/N] (Type HELP for help)
  347. set yesno=
  348. set /p yesno=
  349. if not defined yesno goto :choice3
  350. if /i "!yesno!"=="HELP" (
  351. echo The DoubleWindow feature is on by default. This option makes the session
  352. echo appear in two windows, one window for the conversation and one window
  353. echo for you to enter your messages in. Without this feautre enabled, there
  354. echo is only be one window, but you must refresh to recieve messages
  355. echo [by pressing return]
  356. echo Having DoubleWindow disabled means you can't recieve messages in real time,
  357. echo they will only show when you press enter.
  358. goto choice3
  359. )
  360.  
  361.  
  362. if /i "%yesno:~0,1%"=="Y" (set DoubleWindow=1) else (set Errors=1)
  363. if /i "%yesno:~0,1%"=="N" (set DoubleWindow=) else (set /a errors= %errors% + 1)
  364. if /i "%errors%"=="2" goto choice3
  365.  
  366.  
  367. :DW_YesNo
  368. echo Save this settings for next time? (Y/N)
  369. set /p yesno=
  370.  
  371. if not defined yesno goto DW_YesNo
  372. if /i "%yesno:~0,1%" neq "Y" goto DW_No
  373.  
  374. if not exist ChatEncode.ini (
  375. >Chatencode.ini echo ***ChatEncode Options***
  376. )
  377. attrib "Chatencode.ini" -s -h -r
  378.  
  379. type Chatencode.ini | find /i /v "DoubleWindow~" >Chatencode.ini.temp
  380. type Chatencode.ini.temp >Chatencode.ini
  381. del Chatencode.ini.temp
  382.  
  383. >>Chatencode.ini echo.
  384. >>Chatencode.ini echo DoubleWindow~%doublewindow%
  385. attrib "Chatencode.ini" +s +h +r
  386. echo Options Saved.
  387.  
  388.  
  389.  
  390.  
  391. :Dw_No
  392.  
  393.  
  394.  
  395. call :Set_Temp_Path
  396.  
  397.  
  398. call :Set_Save_Path
  399.  
  400. for /l %%I in (1,1,10) do echo.
  401.  
  402. goto choice
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419. :Set_Temp_Path
  420. echo Enter conversation temp path (Must be a path that all participants can access)
  421. set choice=
  422. set /p choice=
  423. for /f "delims=" %%I in ("%choice%") do set choice=%%~I
  424. if not defined choice cls& goto choice3
  425. if /i "%choice%"==" " cls& goto choice3
  426. for /f "delims=" %%I in ('echo "%choice%"') do set choice=%%I
  427. for /f "delims=" %%I in ("%choice:"=%") do set convdir=%%~sI
  428. for /f "delims=" %%I in ("%convdir%") do set convdir=%%~sI
  429. set workpath=Convdir
  430. set numbertwo=
  431. if not exist !convdir! (call :makedirectory)
  432. echo Directory Assigned.
  433.  
  434. :STP_YesNo
  435.  
  436. echo Save these settings for next time? (Y/N)
  437. set /p yesno=
  438. if not defined yesno goto STP_YesNo
  439. if /i not "%yesno:~0,1%"=="Y" (exit /b)
  440.  
  441. if not exist ChatEncode.ini (
  442. >Chatencode.ini echo ***ChatEncode Options***
  443. )
  444. attrib "Chatencode.ini" -s -h -r
  445.  
  446. type Chatencode.ini | find /i /v "conversationDirectory~" >Chatencode.ini.temp
  447. type Chatencode.ini.temp >Chatencode.ini
  448. del Chatencode.ini.temp
  449.  
  450. >>Chatencode.ini echo.
  451. >>Chatencode.ini echo ConversationDirectory~!Convdir!
  452. attrib "Chatencode.ini" +s +h +r
  453. echo Options Saved.
  454.  
  455.  
  456. exit /b
  457.  
  458.  
  459. :Set_Save_Path
  460. echo Enter conversation save path (For when you want a personal copy saved to your computer)
  461. set choice=
  462. set /p choice=
  463. for /f "delims=" %%I in ("%choice%") do set choice=%%~I
  464. if not defined choice cls& goto choice3-2
  465. if /i "%choice%"==" " cls& goto choice3-2
  466. for /f "delims=" %%I in ('echo "%choice%"') do set choice=%%I
  467. for /f "delims=" %%I in ("%choice:"=%") do set savepath=%%~sI
  468. for /f "delims=" %%I in ("%savepath%") do set savepath=%%~sI
  469. set workpath=Savepath
  470. set numbertwo=-2
  471. if not exist !savepath! (call :makedirectory)
  472. echo Directory Assigned.
  473.  
  474.  
  475. :SSP_YesNo
  476.  
  477. echo Save these settings for next time? (Y/N)
  478. set /p yesno=
  479. if not defined yesno goto SSP_YesNo
  480. if /i not "%yesno:~0,1%"=="Y" (exit /b)
  481.  
  482. if not exist ChatEncode.ini (
  483. >Chatencode.ini echo ***ChatEncode Options***
  484. )
  485. attrib "Chatencode.ini" -s -h -r
  486.  
  487. type Chatencode.ini | find /i /v "SavePath~" >Chatencode.ini.temp
  488. type Chatencode.ini.temp >Chatencode.ini
  489. del Chatencode.ini.temp
  490.  
  491. >>Chatencode.ini echo.
  492. >>Chatencode.ini echo SavePath~!SavePath!
  493. attrib "Chatencode.ini" +s +h +r
  494. echo Options Saved.
  495.  
  496.  
  497.  
  498. exit /b
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513. :choice5
  514. title Decode Message
  515. call :setupencoding
  516. set countera=-1
  517. set counterc=-1
  518.  
  519. :choice5-Decode
  520. echo Enter Message To Decode:
  521. set encodedmessage=
  522. set /p encodedmessage=
  523. echo Decoded message:
  524. set decodedmessage=
  525. call :Startdecode
  526. echo "%decodedmessage%"
  527. :DM_YesNo
  528. echo Encode another message with these encoding setting? (Y/N)
  529. set yesno=
  530. set /p yesno=
  531. if not defined yesno goto DM_YesNo
  532. if /i not "%yesno:~0,1%"=="Y" (
  533. call :clearup_encoding
  534. )
  535. goto Choice5-Decode
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552. :choice4
  553. Title Encode Message
  554. set countera=-1
  555. set counterc=-1
  556. call :setupencoding
  557. echo Encoding Ready!
  558.  
  559. :choice4-Encode
  560. echo Enter Message To Encode:
  561. set message=
  562. set /p message=
  563. set encodedmessage=
  564. call :startencode
  565. echo Your message encoded is:
  566. echo %encodedmessage%
  567. echo Your decoded message will look like this:
  568. set decodedmessage=
  569. call :Startdecode
  570. echo "%decodedmessage%"
  571. :EM_YesNo
  572. echo Encode another message with these encoding setting? (Y/N)
  573. set /p yesno=
  574. if not defined yesno goto EM_YesNo
  575. if /i not "%yesno:~0,1%"=="Y" (
  576. call :clearup_encoding
  577. )
  578. goto Choice4-Encode
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585. :Choice6
  586. Title Delete conversations
  587. echo. Delete all conversations where?
  588. echo 1. !Convdir!
  589. echo 2. Other
  590. echo 3. Return to menu
  591. set choice=
  592. set /p choice=
  593. if not defined choice cls& goto choice6
  594. if /i "!choice!"==" " cls& goto choice6
  595. set choice=!choice:~0,1!
  596. if /i not !choice! geq 1 cls& goto choice6
  597. if /i not !choice! leq 3 cls& goto choice6
  598.  
  599. if /i !choice! equ 3 goto Choice
  600.  
  601. goto choice6-%choice%
  602.  
  603. :choice6-1
  604. for %%I in (!Convdir!\ChatEncode*) do echo Deleting %%I& del %%I
  605. goto choice
  606.  
  607.  
  608. :choice6-2
  609. echo Enter the directory of the conversations you wish to delete or type /Back to cancel
  610. set /p choice=
  611. if /i "!choice!"=="/Back" goto choice
  612.  
  613. for /f "delims=" %%I in ("%choice%") do set choice=%%~I
  614. if not defined choice cls& goto choice6-2
  615. if /i "%choice%"==" " cls& goto choice6-2
  616. for /f "delims=" %%I in ('echo "%choice%"') do set choice=%%I
  617. for /f "delims=" %%I in ("%choice:"=%") do set tempdel=%%~sI
  618. for /f "delims=" %%I in ("!tempdel!") do set tempdel=%%~sI
  619.  
  620. if NOT exist !tempdel! echo Directory does not exist.& goto choice6
  621. )
  622. set CounterV=0
  623. for %%I in (!TempDel!\ChatEncode*.log) do set /a CounterV= !counterv! + 1
  624. if /i %counterv%==1 (echo 1 Conversation found.& goto choice) else (Echo %counterv% conversations found.)
  625. for %%I in (!TempDel!\ChatEncode*.log) do echo Deleting %%I& del %%I
  626.  
  627. goto choice
  628.  
  629.  
  630.  
  631. :choice7
  632. echo Written, developed, tested, debugged and ScrewTheLotOfYou.
  633. echo Any comments, questions or suggestions would be appreciated
  634. echo Contact me at youtube.com/ScrewTheLotOfYou
  635. goto Choice
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642. :Unencrypted_Conversation
  643. title !Conversationpath!
  644. set lineoffset=2
  645. echo Enter your message or press enter to refresh.
  646. echo Enter /Exit to quit.
  647. if defined skipthisone (
  648. echo Press enter to join this conversation.
  649. set skipthisone=
  650. )
  651. for /L %%I in (1,1,21) do echo.
  652.  
  653.  
  654. :Unencrypted_StartSpeaking
  655.  
  656. set gotnewmsg=
  657. set newmessagecount=0
  658. set testmessagecount=0
  659. set usermessage=
  660.  
  661. set /p usermessage=
  662.  
  663. if defined usermessage echo.
  664.  
  665. if not exist !conversationpath! cls& echo Conversation Deleted...& pause& goto choice
  666. if /i "%usermessage%"=="/exit" goto Unencrypted_Exit
  667. for /f "skip=%lineoffset% delims=" %%I in (!conversationpath!) do (
  668. set /a newmessagecount= !newmessagecount! + 1
  669. set newmessage!newmessagecount!=%% style="color: #448888;">I
  670. call :foundmessages
  671. )
  672.  
  673. if messagefailed==1 (
  674. set messagefailed=
  675. goto unencrypted_NoNewMessages
  676. )
  677. goto Unencrypted_MoreNewMessages
  678.  
  679. :foundmessages
  680. if defined encryptedconvo call :decryptfoundmessages
  681. echo "!newmessage% style="color: #448888;">newmessagecount%!" | find /i "~" >nul
  682. if /i %errorlevel% neq 0 set messagefailed=1
  683. exit /b
  684.  
  685. :decryptfoundmessages
  686. set encodedmessage=
  687. set encodedmessage=!newmessage% style="color: #448888;">newmessagecount%!
  688. set decodedmessage=
  689. call :startdecode
  690. for /f "delims=" %%I in ("%decodedmessage%") do set newmessage!newmessagecount!=%% style="color: #448888;">I
  691. exit /b
  692.  
  693.  
  694.  
  695.  
  696. :Unencrypted_MoreNewMessages
  697. if /i %testmessagecount% equ %newmessagecount% goto Unencrypted_NoNewMessages
  698. set /a testmessagecount= !testmessagecount! + 1
  699.  
  700. echo "!newmessage% style="color: #448888;">testmessagecount%!" | find /i "~~~User " >nul
  701.  
  702. if /i !errorlevel! equ 0 (
  703. echo !newmessage% style="color: #448888;">testmessagecount%!
  704. set /a lineoffset= !lineoffset! + 1
  705. goto Unencrypted_MoreNewMessages
  706. )
  707.  
  708. for /f "tokens=1,* delims=~" %%I in ("!newmessage% style="color: #448888;">testmessagecount%!") do set nameofspeaker=%%I& set sortedmessage=%%J
  709. set newmessage%testmessagecount%=
  710. echo !nameofspeaker! says:
  711. echo !sortedmessage:~1!
  712. set /a lineoffset=!lineoffset! + 2
  713. if /i not %testmessagecount% equ %newmessagecount% goto Unencrypted_MoreNewMessages
  714.  
  715. :Unencrypted_NoNewMessages
  716.  
  717. if not defined usermessage goto Unencrypted_StartSpeaking
  718.  
  719. set message=%Fileusername% [%time:~0,-3%]~ !usermessage!
  720. if defined encryptedconvo (
  721. set encodedmessage=
  722. call :startencode
  723. set message=!encodedmessage!
  724. set encodedmessage=
  725. )
  726. >>!conversationpath! echo.
  727. >>!conversationpath! echo %message%
  728. set /a lineoffset= lineoffset + 2
  729.  
  730. goto Unencrypted_Startspeaking
  731.  
  732.  
  733. :Unencrypted_exit
  734. Echo Choose Option:
  735. echo 1. Exit and delete conversation
  736. echo 2. Exit and save conversation
  737. echo 3. Resume
  738. set choice=
  739. set /p choice=
  740. if not defined choice echo.& goto Unencrytped_exit
  741. if /i "%choice%"==" " echo.& goto Unencrytped_exit
  742. set choice=%choice:~0,1%
  743. if /i not %choice% geq 1 echo.& goto Unencrytped_exit
  744. if /i not %choice% leq 3 echo.& goto Unencrytped_exit
  745.  
  746. if %choice%==1 del "!conversationpath!"& cls& goto Choice
  747. if %choice%==2 copy "!conversationpath!" !Savepath!\% style="color: #448888;">FileUsername%-%User1%-ChatEncode.log& cls& goto FileUsername
  748. if %choice%==3 goto unencrypted_startspeaking
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767. :Clearup_encoding
  768. set seconddecode=
  769. set encodedmessage=
  770. set decodedmessage=
  771. set counterI=
  772. set countery=
  773. set counterz=
  774. set counterx=
  775. set second_encode=
  776. for /L %%I in (0,1,257) do for /f %%K in ("!L%%I!") do set %%K=
  777. cls
  778. goto choice
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801. :setupencoding
  802. echo How many layers of encryption to use? (Default=2) (Type HELP for help)
  803. set choice=
  804. set /p choice=
  805. if not defined choice set choice=2
  806. if /i "%choice%"==" " set choice=2
  807. if /i "%choice%"=="help" (
  808. echo More layers of encryption means data is much more secure and much
  809. echo harder to crack. However, each new layer doubles the size of the
  810. echo encoded message and makes encoding and decoding slower.
  811. echo A single character with 1 layer of encryption would be encrypted
  812. echo to two characters, With two layers it would come out as four, with
  813. echo three layers as eight etc.
  814. echo More layers means much more secure data, but larger files and
  815. echo slower encoding and decoding.
  816. echo The default number of layers is two, this is used if you enter nothing,
  817. echo The maximum is ten, which produces one kilobyte of code for each
  818. echo character.
  819. goto setupencoding
  820. )
  821. set choice=%choice:~0,2%
  822. if /i not %choice% geq 1 set choice=2
  823. if /i not %choice% leq 10 set choice=2
  824. set encodinglayers=%choice%
  825.  
  826. :askforpass
  827. echo Enter password to encode with (lowercase only)
  828. set password=
  829. set /p password=""
  830. if not defined password cls& goto askforpass
  831. cls
  832.  
  833.  
  834.  
  835. set choice=
  836. echo Setting up encoding...
  837.  
  838.  
  839. set countery=0
  840. :PEnumerator
  841. set Pchar%counterY%=!password:~% style="color: #448888;">counterY%,1!
  842. if "!Pchar% style="color: #448888;">counterY%!"=="" set /a counterY= %counterY% - 1& goto Usernumerator
  843. set /a counterY= !counterY! + 1
  844. goto Penumerator
  845.  
  846. :Usernumerator
  847. set /a counterz= counterz
  848. set Uchar%counterz%=!Fileusername:~% style="color: #448888;">counterz%,1!
  849. if "!Uchar% style="color: #448888;">counterz%!"=="" set /a counterz= %counterz% - 1& goto Enumdone
  850. set /a counterz= !counterz! + 1
  851. goto Usernumerator
  852.  
  853.  
  854. :enumdone
  855. for /f %%I in ("(") do set L0=%%I
  856. for /f %%I in (")") do set L1=%%I
  857. for /f %%I in ("*") do set L2=%%I
  858. for /f %%I in ("+") do set L3=%%I
  859. for /f %%I in (",") do set L4=%%I
  860. for /f %%I in ("-") do set L5=%%I
  861. for /f %%I in (".") do set L6=%%I
  862. for /f %%I in ("/") do set L7=%%I
  863. for /f %%I in ("0") do set L8=%%I
  864. for /f %%I in ("1") do set L9=%%I
  865. for /f %%I in ("2") do set L10=%%I
  866. for /f %%I in ("3") do set L11=%%I
  867. for /f %%I in ("4") do set L12=%%I
  868. for /f %%I in ("5") do set L13=%%I
  869. for /f %%I in ("6") do set L14=%%I
  870. for /f %%I in ("7") do set L15=%%I
  871. for /f %%I in ("8") do set L16=%%I
  872. for /f %%I in ("9") do set L17=%%I
  873. for /f %%I in (":") do set L18=%%I
  874. set L19=;
  875. for /f %%I in ("<") do set L20=%%I
  876. for /f %%I in ("equals") do set L21=%%I
  877. for /f %%I in (">") do set L22=%%I
  878. for /f %%I in ("?") do set L23=%%I
  879. for /f %%I in ("@") do set L24=%%I
  880. for /f %%I in ("a") do set L25=%%I
  881. for /f %%I in ("b") do set L26=%%I
  882. for /f %%I in ("c") do set L27=%%I
  883. for /f %%I in ("d") do set L28=%%I
  884. for /f %%I in ("e") do set L29=%%I
  885. for /f %%I in ("f") do set L30=%%I
  886. for /f %%I in ("g") do set L31=%%I
  887. for /f %%I in ("h") do set L32=%%I
  888. for /f %%I in ("i") do set L33=%%I
  889. for /f %%I in ("j") do set L34=%%I
  890. for /f %%I in ("k") do set L35=%%I
  891. for /f %%I in ("l") do set L36=%%I
  892. for /f %%I in ("m") do set L37=%%I
  893. for /f %%I in ("n") do set L38=%%I
  894. for /f %%I in ("o") do set L39=%%I
  895. for /f %%I in ("p") do set L40=%%I
  896. for /f %%I in ("q") do set L41=%%I
  897. for /f %%I in ("r") do set L42=%%I
  898. for /f %%I in ("s") do set L43=%%I
  899. for /f %%I in ("t") do set L44=%%I
  900. for /f %%I in ("u") do set L45=%%I
  901. for /f %%I in ("v") do set L46=%%I
  902. for /f %%I in ("w") do set L47=%%I
  903. for /f %%I in ("x") do set L48=%%I
  904. for /f %%I in ("y") do set L49=%%I
  905. for /f %%I in ("z") do set L50=%%I
  906. for /f %%I in ("[") do set L51=%%I
  907. for /f %%I in ("\") do set L52=%%I
  908. for /f %%I in ("]") do set L53=%%I
  909. for /f %%I in ("_") do set L54=%%I
  910. for /f %%I in ("`") do set L55=%%I
  911. for /f %%I in ("POINTUP") do set L56=%%I
  912. for /f %%I in ("b") do set L57=%%I
  913. for /f %%I in ("c") do set L58=%%I
  914. for /f %%I in ("d") do set L59=%%I
  915. for /f %%I in ("e") do set L60=%%I
  916. for /f %%I in ("f") do set L61=%%I
  917. for /f %%I in ("g") do set L62=%%I
  918. for /f %%I in ("h") do set L63=%%I
  919. for /f %%I in ("i") do set L64=%%I
  920. for /f %%I in ("j") do set L65=%%I
  921. for /f %%I in ("k") do set L66=%%I
  922. for /f %%I in ("l") do set L67=%%I
  923. for /f %%I in ("m") do set L68=%%I
  924. for /f %%I in ("n") do set L69=%%I
  925. for /f %%I in ("o") do set L70=%%I
  926. for /f %%I in ("p") do set L71=%%I
  927. for /f %%I in ("q") do set L72=%%I
  928. for /f %%I in ("r") do set L73=%%I
  929. for /f %%I in ("s") do set L74=%%I
  930. for /f %%I in ("t") do set L75=%%I
  931. for /f %%I in ("u") do set L76=%%I
  932. for /f %%I in ("v") do set L77=%%I
  933. for /f %%I in ("w") do set L78=%%I
  934. for /f %%I in ("x") do set L79=%%I
  935. for /f %%I in ("y") do set L80=%%I
  936. for /f %%I in ("z") do set L81=%%I
  937. for /f %%I in ("{") do set L82=%%I
  938. for /f %%I in ("|") do set L83=%%I
  939. for /f %%I in ("}") do set L84=%%I
  940. for /f %%I in ("~") do set L85=%%I
  941. for /f %%I in ("") do set L86=%%I
  942. for /f %%I in ("€") do set L87=%%I
  943. for /f %%I in ("") do set L88=%%I
  944. for /f %%I in ("‚") do set L89=%%I
  945. for /f %%I in ("ƒ") do set L90=%%I
  946. for /f %%I in ("„") do set L91=%%I
  947. for /f %%I in ("…") do set L92=%%I
  948. for /f %%I in ("†") do set L93=%%I
  949. for /f %%I in ("‡") do set L94=%%I
  950. for /f %%I in ("ˆ") do set L95=%%I
  951. for /f %%I in ("‰") do set L96=%%I
  952. for /f %%I in ("Š") do set L97=%%I
  953. for /f %%I in ("‹") do set L98=%%I
  954. for /f %%I in ("Œ") do set L99=%%I
  955. for /f %%I in ("") do set L100=%%I
  956. for /f %%I in ("Ž") do set L101=%%I
  957. for /f %%I in ("") do set L102=%%I
  958. for /f %%I in ("") do set L103=%%I
  959. for /f %%I in ("‘") do set L104=%%I
  960. for /f %%I in ("’") do set L105=%%I
  961. for /f %%I in ("“") do set L106=%%I
  962. for /f %%I in ("”") do set L107=%%I
  963. for /f %%I in ("•") do set L108=%%I
  964. for /f %%I in ("–") do set L109=%%I
  965. for /f %%I in ("—") do set L110=%%I
  966. for /f %%I in ("˜") do set L111=%%I
  967. for /f %%I in ("™") do set L112=%%I
  968. for /f %%I in ("š") do set L113=%%I
  969. for /f %%I in ("›") do set L114=%%I
  970. for /f %%I in ("œ") do set L115=%%I
  971. for /f %%I in ("") do set L116=%%I
  972. for /f %%I in ("ž") do set L117=%%I
  973. for /f %%I in ("Ÿ") do set L118=%%I
  974. for /f %%I in ("¡") do set L119=%%I
  975. for /f %%I in ("¢") do set L120=%%I
  976. for /f %%I in ("£") do set L121=%%I
  977. for /f %%I in ("¤") do set L122=%%I
  978. for /f %%I in ("¥") do set L123=%%I
  979. for /f %%I in ("¦") do set L124=%%I
  980. for /f %%I in ("§") do set L125=%%I
  981. for /f %%I in ("¨") do set L126=%%I
  982. for /f %%I in ("©") do set L127=%%I
  983. for /f %%I in ("ª") do set L128=%%I
  984. for /f %%I in ("«") do set L129=%%I
  985. for /f %%I in ("¬") do set L130=%%I
  986. for /f %%I in ("­") do set L131=%%I
  987. for /f %%I in ("®") do set L132=%%I
  988. for /f %%I in ("¯") do set L133=%%I
  989. for /f %%I in ("°") do set L134=%%I
  990. for /f %%I in ("±") do set L135=%%I
  991. for /f %%I in ("²") do set L136=%%I
  992. for /f %%I in ("³") do set L137=%%I
  993. for /f %%I in ("´") do set L138=%%I
  994. for /f %%I in ("µ") do set L139=%%I
  995. for /f %%I in ("¶") do set L140=%%I
  996. for /f %%I in ("·") do set L141=%%I
  997. for /f %%I in ("¸") do set L142=%%I
  998. for /f %%I in ("¹") do set L143=%%I
  999. for /f %%I in ("º") do set L144=%%I
  1000. for /f %%I in ("»") do set L145=%%I
  1001. for /f %%I in ("¼") do set L146=%%I
  1002. for /f %%I in ("½") do set L147=%%I
  1003. for /f %%I in ("¾") do set L148=%%I
  1004. for /f %%I in ("¿") do set L149=%%I
  1005. for /f %%I in ("À") do set L150=%%I
  1006. for /f %%I in ("Á") do set L151=%%I
  1007. for /f %%I in ("") do set L152=%%I
  1008. for /f %%I in ("Ã") do set L153=%%I
  1009. for /f %%I in ("Ä") do set L154=%%I
  1010. for /f %%I in ("Å") do set L155=%%I
  1011. for /f %%I in ("Æ") do set L156=%%I
  1012. for /f %%I in ("Ç") do set L157=%%I
  1013. for /f %%I in ("È") do set L158=%%I
  1014. for /f %%I in ("É") do set L159=%%I
  1015. for /f %%I in ("Ê") do set L160=%%I
  1016. for /f %%I in ("Ë") do set L161=%%I
  1017. for /f %%I in ("Ì") do set L162=%%I
  1018. for /f %%I in ("Í") do set L163=%%I
  1019. for /f %%I in ("Î") do set L164=%%I
  1020. for /f %%I in ("Ï") do set L165=%%I
  1021. for /f %%I in ("Ð") do set L166=%%I
  1022. for /f %%I in ("Ñ") do set L167=%%I
  1023. for /f %%I in ("Ò") do set L168=%%I
  1024. for /f %%I in ("Ó") do set L169=%%I
  1025. for /f %%I in ("Ô") do set L170=%%I
  1026. for /f %%I in ("Õ") do set L171=%%I
  1027. for /f %%I in ("Ö") do set L172=%%I
  1028. for /f %%I in ("×") do set L173=%%I
  1029. for /f %%I in ("Ø") do set L174=%%I
  1030. for /f %%I in ("Ù") do set L175=%%I
  1031. for /f %%I in ("Ú") do set L176=%%I
  1032. for /f %%I in ("Û") do set L177=%%I
  1033. for /f %%I in ("Ü") do set L178=%%I
  1034. for /f %%I in ("Ý") do set L179=%%I
  1035. for /f %%I in ("Þ") do set L180=%%I
  1036. for /f %%I in ("ß") do set L181=%%I
  1037. for /f %%I in ("à") do set L182=%%I
  1038. for /f %%I in ("á") do set L183=%%I
  1039. for /f %%I in ("â") do set L184=%%I
  1040. for /f %%I in ("ã") do set L185=%%I
  1041. for /f %%I in ("ä") do set L186=%%I
  1042. for /f %%I in ("å") do set L187=%%I
  1043. for /f %%I in ("æ") do set L188=%%I
  1044. for /f %%I in ("ç") do set L189=%%I
  1045. for /f %%I in ("è") do set L190=%%I
  1046. for /f %%I in ("é") do set L191=%%I
  1047. for /f %%I in ("ê") do set L192=%%I
  1048. for /f %%I in ("ë") do set L193=%%I
  1049. for /f %%I in ("ì") do set L194=%%I
  1050. for /f %%I in ("í") do set L195=%%I
  1051. for /f %%I in ("î") do set L196=%%I
  1052. for /f %%I in ("ï") do set L197=%%I
  1053. for /f %%I in ("ð") do set L198=%%I
  1054. for /f %%I in ("ñ") do set L199=%%I
  1055. for /f %%I in ("ò") do set L200=%%I
  1056. for /f %%I in ("ó") do set L201=%%I
  1057. for /f %%I in ("ô") do set L202=%%I
  1058. for /f %%I in ("õ") do set L203=%%I
  1059. for /f %%I in ("ö") do set L204=%%I
  1060. for /f %%I in ("÷") do set L205=%%I
  1061. for /f %%I in ("ø") do set L206=%%I
  1062. for /f %%I in ("ù") do set L207=%%I
  1063. for /f %%I in ("ú") do set L208=%%I
  1064. for /f %%I in ("û") do set L209=%%I
  1065. for /f %%I in ("ü") do set L210=%%I
  1066. for /f %%I in ("ý") do set L211=%%I
  1067. for /f %%I in ("þ") do set L212=%%I
  1068. for /f %%I in ("ÿ") do set L213=%%I
  1069. for /f %%I in ("'") do set L214=%%I
  1070. for /f %%I in ("And") do set L215=%%I
  1071. for /f %%I in ("%%") do set L216=%%I
  1072. for /f %%I in ("$") do set L217=%%I
  1073. for /f %%I in ("#") do set L218=%%I
  1074. set L219=Quote
  1075. for /f %%I in ("!") do set L220=%%I
  1076. for /f %%I in ("§") do set L221=%%I
  1077. for /f %%I in ("¶") do set L222=%%I
  1078. for /f %%I in ("¤") do set L223=%%I
  1079. for /f %%I in ("£") do set L224=%%I
  1080. for /f %%I in ("Ø") do set L225=%%I
  1081. for /f %%I in ("×") do set L226=%%I
  1082. for /f %%I in ("ƒ") do set L227=%%I
  1083. for /f %%I in ("á") do set L228=%%I
  1084. for /f %%I in ("í") do set L229=%%I
  1085. for /f %%I in ("ó") do set L230=%%I
  1086. for /f %%I in ("ú") do set L231=%%I
  1087. for /f %%I in ("ñ") do set L232=%%I
  1088. for /f %%I in ("Ñ") do set L233=%%I
  1089. for /f %%I in ("ª") do set L234=%%I
  1090. for /f %%I in ("º") do set L235=%%I
  1091. for /f %%I in ("¿") do set L236=%%I
  1092. for /f %%I in ("®") do set L237=%%I
  1093. for /f %%I in ("¬") do set L238=%%I
  1094. for /f %%I in ("½") do set L239=%%I
  1095. for /f %%I in ("¼") do set L240=%%I
  1096. for /f %%I in ("¡") do set L241=%%I
  1097. for /f %%I in ("«") do set L242=%%I
  1098. for /f %%I in ("»") do set L243=%%I
  1099. for /f %%I in ("Á") do set L244=%%I
  1100. for /f %%I in ("") do set L245=%%I
  1101. for /f %%I in ("À") do set L246=%%I
  1102. for /f %%I in ("©") do set L247=%%I
  1103. for /f %%I in ("¢") do set L248=%%I
  1104. for /f %%I in ("¥") do set L249=%%I
  1105. for /f %%I in ("ã") do set L250=%%I
  1106. for /f %%I in ("Ã") do set L251=%%I
  1107. for /f %%I in ("¤") do set L252=%%I
  1108. for /f %%I in ("ð") do set L253=%%I
  1109. for /f %%I in ("Ð") do set L254=%%I
  1110. for /f %%I in ("Ê") do set L255=%%I
  1111. for /f %%I in ("Ë") do set L256=%%I
  1112. set L257=Space
  1113.  
  1114. set J0=qw
  1115. set J1=we
  1116. set J2=er
  1117. set J3=rt
  1118. set J4=ty
  1119. set J5=yu
  1120. set J6=io
  1121. set J7=op
  1122. set J8=as
  1123. set J9=sd
  1124. set J10=df
  1125. set J11=fg
  1126. set J12=gh
  1127. set J13=hj
  1128. set J14=jk
  1129. set J15=kl
  1130. set J16=zx
  1131. set J17=xc
  1132. set J18=cv
  1133. set J19=vb
  1134. set J20=bn
  1135. set J21=nm
  1136. set J22=qa
  1137. set J23=ws
  1138. set J24=ed
  1139. set J25=rf
  1140. set J26=tg
  1141. set J27=yh
  1142. set J28=uj
  1143. set J29=ik
  1144. set J30=ol
  1145. set J31=az
  1146. set J32=sx
  1147. set J33=dc
  1148. set J34=fv
  1149. set J35=gb
  1150. set J36=hn
  1151. set J37=jm
  1152. set J38=wa
  1153. set J39=es
  1154. set J40=rd
  1155. set J41=tf
  1156. set J42=yg
  1157. set J43=uh
  1158. set J44=ij
  1159. set J45=ok
  1160. set J46=pl
  1161. set J47=sz
  1162. set J48=dx
  1163. set J49=fc
  1164. set J50=gv
  1165. set J51=hb
  1166. set J52=jn
  1167. set J53=km
  1168. set J54=po
  1169. set J55=oi
  1170. set J56=iu
  1171. set J57=uy
  1172. set J58=yt
  1173. set J59=tr
  1174. set J60=re
  1175. set J61=ew
  1176. set J62=wq
  1177. set J63=lk
  1178. set J64=kj
  1179. set J65=jh
  1180. set J66=hg
  1181. set J67=gf
  1182. set J68=fd
  1183. set J69=ds
  1184. set J70=sa
  1185. set J71=mn
  1186. set J72=nb
  1187. set J73=bv
  1188. set J74=vc
  1189. set J75=cx
  1190. set J76=xz
  1191. set J77=aq
  1192. set J78=sw
  1193. set J79=de
  1194. set J80=fr
  1195. set J81=gt
  1196. set J82=hy
  1197. set J83=ju
  1198. set J84=ki
  1199. set J85=lo
  1200. set J86=za
  1201. set J87=xs
  1202. set J88=cd
  1203. set J89=vf
  1204. set J90=bg
  1205. set J91=nh
  1206. set J92=mj
  1207. set J93=aw
  1208. set J94=se
  1209. set J95=dr
  1210. set J96=ft
  1211. set J97=gy
  1212. set J98=hu
  1213.  
  1214. set J99=ji
  1215. set J100=ko
  1216. set J101=lp
  1217. set J102=zs
  1218. set J103=xd
  1219. set J104=cf
  1220. set J105=vg
  1221. set J106=bh
  1222. set J107=nj
  1223. set J108=mk
  1224. set J109=qz
  1225. set J110=wx
  1226. set J111=ec
  1227. set J112=rv
  1228. set J113=tb
  1229. set J114=yn
  1230. set J115=um
  1231. set J116=om
  1232. set J117=in
  1233. set J118=ub
  1234. set J119=yv
  1235. set J120=tc
  1236. set J121=rx
  1237. set J122=ez
  1238. set J123=zq
  1239. set J124=xw
  1240. set J125=ce
  1241. set J126=vr
  1242. set J127=bt
  1243. set J128=ny
  1244. set J129=mu
  1245. set J130=mo
  1246. set J131=ni
  1247. set J132=bu
  1248. set J133=vy
  1249. set J134=ct
  1250. set J135=xr
  1251. set J136=ze
  1252. set J137=qe
  1253. set J138=wr
  1254. set J139=et
  1255. set J140=ry
  1256. set J141=tu
  1257. set J142=yi
  1258. set J143=uo
  1259. set J144=ip
  1260. set J145=ad
  1261. set J146=sf
  1262. set J147=dg
  1263. set J148=fh
  1264. set J149=gj
  1265. set J150=hk
  1266. set J151=jl
  1267. set J152=zc
  1268. set J153=xv
  1269. set J154=cb
  1270. set J155=vn
  1271. set J156=bm
  1272. set J157=eq
  1273. set J158=rw
  1274. set J159=te
  1275. set J160=yr
  1276. set J161=ut
  1277. set J162=iy
  1278. set J163=ou
  1279. set J164=pi
  1280. set J165=da
  1281. set J166=fs
  1282. set J167=gd
  1283. set J168=hf
  1284. set J169=jg
  1285. set J170=kh
  1286. set J171=lj
  1287. set J172=cz
  1288. set J173=vx
  1289. set J174=bc
  1290. set J175=nv
  1291. set J176=mb
  1292. set J177=rq
  1293. set J178=tw
  1294. set J179=ye
  1295. set J180=ur
  1296. set J181=it
  1297. set J182=oy
  1298. set J183=pu
  1299. set J184=fa
  1300. set J185=gs
  1301. set J186=hd
  1302. set J187=jf
  1303. set J188=kg
  1304. set J189=lh
  1305. set J190=vz
  1306. set J191=bx
  1307. set J192=nc
  1308. set J193=mv
  1309. set J194=qr
  1310. set J195=wt
  1311. set J196=ey
  1312. set J197=ru
  1313. set J198=ti
  1314. set J199=yo
  1315. set J200=up
  1316. set J201=af
  1317. set J202=sg
  1318. set J203=dh
  1319. set J204=fj
  1320. set J205=gk
  1321. set J206=hl
  1322. set J207=zv
  1323. set J208=xb
  1324. set J209=cn
  1325. set J210=vm
  1326. set J211=qt
  1327. set J212=wy
  1328. set J213=eu
  1329. set J214=ri
  1330. set J215=to
  1331. set J216=yp
  1332. set J217=ag
  1333. set J218=sh
  1334. set J219=dj
  1335. set J220=fk
  1336. set J221=gl
  1337. set J222=zb
  1338. set J223=xn
  1339. set J224=cm
  1340. set J225=tq
  1341. set J226=yw
  1342. set J227=ue
  1343. set J228=ir
  1344. set J229=ot
  1345. set J230=py
  1346. set J231=ga
  1347. set J232=hs
  1348. set J233=jd
  1349. set J234=kf
  1350. set J235=lg
  1351. set J236=bz
  1352. set J237=nx
  1353. set J238=mc
  1354. set J239=qy
  1355. set J240=wu
  1356. set J241=ei
  1357. set J242=ro
  1358. set J243=tp
  1359. set J244=ah
  1360. set J245=sj
  1361. set J246=dk
  1362. set J247=fl
  1363. set J248=zn
  1364. set J249=xm
  1365. set J250=mx
  1366. set J251=nz
  1367. set J252=lf
  1368. set J253=kd
  1369. set J254=js
  1370. set J255=ha
  1371. set J256=pt
  1372. set j257=zp
  1373.  
  1374. set countera=-1
  1375. set counterb=-1
  1376. set counterc=-1
  1377.  
  1378.  
  1379. :pcharloop
  1380. set /a countera= %countera% + 1
  1381. set /a counterc= %counterc% + 1
  1382. set templ=!pchar% style="color: #448888;">countera%!
  1383. set pchar%countera%=
  1384. if not defined templ goto allcharloop
  1385. if defined %templ% goto pcharloop
  1386. for /f %%I in ("%templ%") do set %%I=!J%counterc%!
  1387. for /f %%I in ("!J%counterc%!") do set %%I=%templ%
  1388. if not defined %templ% goto backupset
  1389. goto pcharloop
  1390.  
  1391.  
  1392. :allcharloop
  1393. set /a counterb= %counterb% + 1
  1394. set /a counterc= %counterc% + 1
  1395. if /i %counterB% geq 258 exit /b
  1396. if /i %counterB% equ 20 goto backupset
  1397.  
  1398. set templ=!L%counterb%!
  1399. set tempj=!J%counterc%!
  1400.  
  1401. for /f %%I in ("%templ%") do if defined %%I set /a counterc=%counterc% - 1& goto allcharloop
  1402. for /f "delims=" %%I in ("%templ%") do (
  1403. set %%I=%tempj%
  1404. set %tempj%=%%I
  1405. )
  1406. goto allcharloop
  1407.  
  1408. :backupset
  1409. set !templ!=!J%counterc%!
  1410. set !J%counterc%!=!templ!
  1411. goto allcharloop
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418. :startencode
  1419.  
  1420. set layersdone=1
  1421. set counterx=0
  1422. set counterI=0
  1423.  
  1424. :MEnumerator
  1425. set Mchar%counterx%=!message:~% style="color: #448888;">counterX%,1!
  1426. if "!Mchar% style="color: #448888;">counterx%!"=="" goto encodemessage
  1427. set /a counterx= !counterx! + 1
  1428. goto Menumerator
  1429.  
  1430. :encodemessage
  1431. if /i %counterI% equ %counterX% goto FirstEncodeDone
  1432. set temp=!Mchar% style="color: #448888;">counterI%!
  1433. set Mchar%counterI%=
  1434. if "%temp:"=Quote%"=="Quote" set temp=Quote
  1435. if /i "%temp%"==" " set temp=Space
  1436. if "%temp%"=="=" set temp=Equals
  1437. if "%temp%"=="&" set temp=And
  1438. if "%temp%"=="^" set temp=POINTUP
  1439. set encodedmessage=!encodedmessage!!% style="color: #448888;">temp%!
  1440. set /a counterI= %counterI% + 1
  1441. goto encodemessage
  1442.  
  1443. :FirstEncodeDone
  1444. if /i %layersdone% equ %encodinglayers% (
  1445. set layersdone=
  1446. exit /b
  1447. )
  1448. set counterx=0
  1449. set counterI=0
  1450. set second_encode=1
  1451. set message=!encodedmessage!
  1452. set encodedmessage=
  1453. set /a layersdone= %layersdone% + 1
  1454. goto MEnumerator
  1455.  
  1456.  
  1457.  
  1458.  
  1459. :startdecode
  1460. set layersdone=1
  1461. set counterx=0
  1462. set countery=0
  1463. set counterI=0
  1464.  
  1465.  
  1466. :DEnumerator
  1467. set Dchar%counterY%=!encodedmessage:~% style="color: #448888;">counterX%,2!
  1468. if "!Dchar% style="color: #448888;">counterY%!"=="" set /a counterx=(counterx/2)& goto Decodemessage
  1469. set /a counterx= !counterx! + 2
  1470. set /a counterY= !counterY! + 1
  1471. goto Denumerator
  1472.  
  1473. :Decodemessage
  1474. if /i %counterI% equ %counterX% goto Dmessagefinished
  1475. set temp=!Dchar% style="color: #448888;">counterI%!
  1476. set Dchar%counterI%=
  1477. if /i "!% style="color: #448888;">temp%!"=="Quote" set %temp%="
  1478. if /i "!% style="color: #448888;">temp%!"=="Space" set %temp%=
  1479. if /i "!% style="color: #448888;">temp%!"=="Equals" set %temp%==
  1480. if /i "!% style="color: #448888;">temp%!"=="POINTUP" for /f %%I in ("^") do set %temp%=%%I
  1481. SET decodedmessage=!decodedmessage!!% style="color: #448888;">temp%!
  1482. set /a counterI= %counterI% + 1
  1483. goto Decodemessage
  1484.  
  1485.  
  1486. :Dmessagefinished
  1487. if /i NOT %layersdone% equ %encodinglayers% (
  1488. set /a layersdone= !layersdone! + 1
  1489. set encodedmessage=!decodedmessage!
  1490. set counterI=0
  1491. set countery=0
  1492. set counterx=0
  1493. set decodedmessage=
  1494. goto DEnumerator
  1495. )
  1496. ::for /f %%I in ("&") do set and=%%I
  1497. ::for /f %%I in ("%decodedmessage:&=!and!%") set decodedmessage=%%I
  1498. ::echo !decodedmessage!&pause
  1499. set layersdone=
  1500. exit /b
  1501.  
  1502.  
  1503. ::##########################################################################################
  1504.  
  1505.  
  1506.  
  1507.  
  1508. ::##########################################################################################
  1509.  
  1510.  
  1511.  
  1512.  
  1513. ::##########################################################################################
  1514.  
  1515.  
  1516.  
  1517. :SecondWindow
  1518. title !ConversationPath!
  1519. set lineoffset=2
  1520. for /f "delims=" %%I in ("%2") do set ConversationPath=%%I
  1521. if /i "%3" equ 1 do set encryptedconvo=1
  1522.  
  1523.  
  1524.  
  1525. :DoubleWindow_StartSpeaking
  1526.  
  1527. set gotnewmsg=
  1528. set newmessagecount=0
  1529. set testmessagecount=0
  1530.  
  1531.  
  1532.  
  1533. if not exist !conversationpath! echo Conversation Deleted...& pause& exit /b
  1534.  
  1535. for /f "skip=%lineoffset% delims=" %%I in (!conversationpath!) do (
  1536. set /a newmessagecount= !newmessagecount! + 1
  1537. set newmessage!newmessagecount!=%% style="color: #448888;">I
  1538. call :foundmessages
  1539. )
  1540.  
  1541. if messagefailed==1 (
  1542. set messagefailed=
  1543. goto DoubleWindow_NoNewMessages
  1544. )
  1545. goto DoubleWindow_MoreNewMessages
  1546.  
  1547.  
  1548.  
  1549. :DoubleWindow_MoreNewMessages
  1550. if /i %testmessagecount% equ %newmessagecount% goto DoubleWindow_NoNewMessages
  1551. set /a testmessagecount= !testmessagecount! + 1
  1552.  
  1553. echo "!newmessage% style="color: #448888;">testmessagecount%!" | find /i "~~~User " >nul
  1554.  
  1555. if /i !errorlevel! equ 0 (
  1556. echo !newmessage% style="color: #448888;">testmessagecount%!
  1557. set /a lineoffset= !lineoffset! + 1
  1558. goto DoubleWindow_MoreNewMessages
  1559. )
  1560.  
  1561. for /f "tokens=1,* delims=~" %%I in ("!newmessage% style="color: #448888;">testmessagecount%!") do set nameofspeaker=%%I& set sortedmessage=%%J
  1562. set newmessage%testmessagecount%=
  1563. echo !nameofspeaker! says:
  1564. echo !sortedmessage:~1!
  1565. set /a lineoffset=!lineoffset! + 2
  1566. if /i not %testmessagecount% equ %newmessagecount% goto DoubleWindow_MoreNewMessages
  1567.  
  1568. :DoubleWindow_NoNewMessages
  1569.  
  1570. if not defined usermessage goto DoubleWindow_StartSpeaking
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597. :FirstWindow
  1598. title Enter your messages here. !Conversationpath!
  1599. echo Enter your message.
  1600. echo Enter /Exit to quit.
  1601. for /L %%I in (1,1,21) do echo.
  1602.  
  1603.  
  1604. :DoubleWindow_EnterMessage
  1605. set usermessage=
  1606. set /p usermessage=
  1607. if not defined usermessage goto DoubleWindow_EnterMessage
  1608.  
  1609.  
  1610. if not exist !conversationpath! cls& echo Conversation Deleted...& pause& goto choice
  1611. if /i "%usermessage%"=="/exit" goto DoubleWindow_Exit
  1612.  
  1613.  
  1614. set message=%Fileusername% [%time:~0,-3%]~ !usermessage!
  1615. if defined encryptedconvo (
  1616. set encodedmessage=
  1617. call :startencode
  1618. set message=!encodedmessage!
  1619. set encodedmessage=
  1620. )
  1621. >>!conversationpath! echo.
  1622. >>!conversationpath! echo %message%
  1623.  
  1624. goto DoubleWindow_Entermessage
  1625.  
  1626. :Doublewindow_exit
  1627. Echo Choose Option:
  1628. echo 1. Exit and delete conversation
  1629. echo 2. Exit and save conversation
  1630. echo 3. Resume
  1631. set choice=
  1632. set /p choice=
  1633. if not defined choice echo.& goto Doublewindow_exit
  1634. if /i "%choice%"==" " echo.& goto Doublewindow_exit
  1635. set choice=%choice:~0,1%
  1636. if /i not %choice% geq 1 echo.& goto Doublewindow_exit
  1637. if /i not %choice% leq 3 echo.& goto Doublewindow_exit
  1638.  
  1639. if %choice%==1 del "!conversationpath!"& cls& goto Choice
  1640. if %choice%==2 copy "!conversationpath!" !Savepath!\% style="color: #448888;">FileUsername%-%User1%-ChatEncode.log& cls& goto FileUsername
  1641. if %choice%==3 goto DoubleWindow_Entermessage
  1642.                                                                                                                                                                                                                                                     m e d   d e t   n a m n e t   f i n n s   r e d a n .   A v b r y t   i n s t a l l a t i o n e n   o c h   f ö r s ö k   i n s t a l l e r a   p å   e n   a n n a n   p l a t s .
  1643.  
  1644. I D S _ E R R O R _ 2 4 = S ä t t   i n   d i s k e t t e n :   [ 2 ]
  1645.  
  1646. I D S _ E R R O R _ 2 5 = I n s t a l l e r   h a r   i n t e   b e h ö r i g h e t   a t t   k o m m a   å t   d e n   h ä r   k a t a l o g e n :   [ 2 ] .   I n s t a l l a t i o n e n   k a n   i n t e   f o r t s ä t t a .   L o g g a   i n   s o m   a d m i n i s t r a t ö r   e l l e r   k o n t a k t a   s y s t e m a d m i n i s t r a t ö r e n .
  1647.  
  1648. I D S _ E R R O R _ 2 6 = D e t   g i c k   i n t e   a t t   s k r i v a   t i l l   f i l e n :   [ 2 ] .   B e k r ä f t a   a t t   d u   k a n   k o m m a   å t   d e n   k a t a l o g e n .
  1649.  
  1650. I D S _ E R R O R _ 2 7 = D e t   u p p s t o d   e t t   f e l   v i d   l ä s n i n g   f r å n   f i l e n   [ 2 ] .   { {   S y s t e m f e l   [ 3 ] . } }   B e k r ä f t a   a t t   f i l e n   f i n n s   o c h   a t t   d u   k a n   k o m m a   å t   d e n .
  1651.  
  1652. I D S _ E R R O R _ 2 8 = E t t   a n n a t   p r o g r a m   h a r   e x k l u s i v   å t k o m s t   t i l l   f i l e n   [ 2 ] .   S t ä n g   a l l a   a n d r a   p r o g r a m   o c h   k l i c k a   s e d a n   p å   F ö r s ö k   i g e n .
  1653.  
  1654. I D S _ E R R O R _ 2 9 = D e t   f i n n s   i n t e   t i l l r ä c k l i g t   m e d   d i s k u t r y m m e   f ö r   a t t   i n s t a l l e r a   f i l e n :   [ 2 ] .   F r i g ö r   u t r y m m e   o c h   k l i c k a   p å   F ö r s ö k   i g e n   e l l e r   k l i c k a   p å   A v b r y t   o m   d u   v i l l   a v b r y t a   i n s t a l l a t i o n e n .
  1655.  
  1656. I D S _ E R R O R _ 3 = I n f o r m a t i o n   [ 1 ] .  
  1657.  
  1658. I D S _ E R R O R _ 3 0 = D e t   g i c k   i n t e   a t t   h i t t a   k ä l l f i l e n :   [ 2 ] .   B e k r ä f t a   a t t   f i l e n   f i n n s   o c h   a t t   d u   k a n   k o m m a   å t   d e n .
  1659.  
  1660. I D S _ E R R O R _ 3 1 = D e t   u p p s t o d


NOTA DEL MOD: Usa las etiqueta GeSHi.


« Última modificación: 16 Abril 2011, 18:52 pm por Leo Gutiérrez. » En línea

Un  usuario mas de la red...
xBart

Desconectado Desconectado

Mensajes: 33



Ver Perfil
Re: Alguna Idea de este codigo batch??
« Respuesta #1 en: 16 Abril 2011, 19:02 pm »

Perdon, no sabia cual eran esas etiquetas pero, ya las vi, gracias
Pero lo de mi codigo, solo es una duda, si no se puede no ay problema.

Gracias


En línea

Un  usuario mas de la red...
SuperDraco


Desconectado Desconectado

Mensajes: 2.505


Crew Dragon


Ver Perfil
Re: Alguna Idea de este codigo batch??
« Respuesta #2 en: 16 Abril 2011, 21:11 pm »

Es una especie de Chat hecho en batch.




saludossss
En línea

No he vuelto, solo estoy de paso.
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Introducir acentos en rutas en batch ¿alguna idea?
Scripting
gorgon12 4 10,201 Último mensaje 1 Octubre 2009, 04:07 am
por leogtz
DB me tira este error... .alguna idea? =S
Bases de Datos
XXXXXX 2 2,763 Último mensaje 14 Mayo 2010, 20:17 pm
por XXXXXX
Alguna idea para salir de este FOR y printear un mensaje?.. en C
Programación C/C++
RGT 1 1,855 Último mensaje 1 Abril 2015, 06:58 am
por RGT
por favor denme una idea como hacer este codigo
Programación C/C++
eduardo17445 2 5,353 Último mensaje 20 Noviembre 2016, 22:49 pm
por geeke
¿Alguna idea para plantear este problema?
Programación C/C++
estudianteuv 4 1,838 Último mensaje 5 Marzo 2019, 00:51 am
por Serapis
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines