A fun MapleStory Private Server.
 
HomeHome  CalendarCalendar  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log in  

Share | 
 

 .VBS (Visual Basic Script, nothing like the program VB)

View previous topic View next topic Go down 
AuthorMessage
Bloodfeast
Cookie
avatar

Posts : 26
Points : 3023
Join date : 2009-07-17
Location : Im a Bitch

PostSubject: .VBS (Visual Basic Script, nothing like the program VB)   Wed Aug 12, 2009 12:35 am

Instead of some kind of tutorial, I'll give you a couple codes I have of .vbs. Copy em, paste em in notepad, and name it something.vbs, then open it.

Seeing what it does, go back to the .vbs file, right click > Edit, And see what you want to change. After you're done editing that, you'll want to try some stuff of your own, and then you'll know as much as meee Very Happy

My Auto Permanent File Deleter(Careful)
It's a bit messy, but hey, it's great for learning really cool things for you to try out on your own.

Code:
 set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "notepad"
WScript.Sleep 500
WshShell.SendKeys "INTRUCTIONS:          *WARNING, DO NOT EXIT OUT OF THIS FILE UNTIL IT SAYS TO!*"
WScript.Sleep 100
WshShell.SendKeys "{ENTER} "
WScript.Sleep 500
WshShell.SendKeys "Okay, so, you have to doubleclick this file, and this will "
WScript.Sleep 500
WshShell.SendKeys "{ENTER} "
WScript.Sleep 500
WshShell.SendKeys "always come up. After this message, make sure the file "
WScript.Sleep 500
WshShell.SendKeys "{ENTER} "
WScript.Sleep 500
WshShell.SendKeys "you want to permanently delete is highlighted. I will "
WScript.Sleep 500
WshShell.SendKeys "{ENTER} "
WScript.Sleep 500
WshShell.SendKeys "give you a little bit of time before I permanently delete it. "
WScript.Sleep 500
WshShell.SendKeys "{ENTER} "
WScript.Sleep 500
WshShell.SendKeys "If you didn't have enough time, simply click Cancel or "
WScript.Sleep 500
WshShell.SendKeys "{ENTER} "
WScript.Sleep 500
WshShell.SendKeys "No when it asks to delete. We give you more time to "
WScript.Sleep 500
WshShell.SendKeys "{ENTER} "
WScript.Sleep 500
WshShell.SendKeys "choose that option. If it's the right file, sit back and "
WScript.Sleep 500
WshShell.SendKeys "{ENTER} "
WScript.Sleep 500
WshShell.SendKeys "watch me delete it. "
WScript.Sleep 10000
WshShell.SendKeys "{ENTER} "
WScript.Sleep 500
WshShell.SendKeys "So, "
WScript.Sleep 500
WshShell.SendKeys "note "
WScript.Sleep 500
WshShell.SendKeys "that "
WScript.Sleep 500
WshShell.SendKeys "you'll "
WScript.Sleep 500
WshShell.SendKeys "have "
WScript.Sleep 500
WshShell.SendKeys "a "
WScript.Sleep 500
WshShell.SendKeys "couple "
WScript.Sleep 500
WshShell.SendKeys "seconds "
WScript.Sleep 500
WshShell.SendKeys "before "
WScript.Sleep 500
WshShell.SendKeys "{ENTER} "
WScript.Sleep 500
WshShell.SendKeys "that file "
WScript.Sleep 500
WshShell.SendKeys "gets deleted. "
WScript.Sleep 500
WshShell.SendKeys "So make sure you want to delete it!"
WScript.Sleep 10000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 100
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys "Highlight the file needing deletion now!"
WScript.Sleep 5000
WshShell.SendKeys "+{DEL}"
WScript.Sleep 4000
WshShell.SendKeys "{ENTER}"

lol=msgbox("File successfully permanently deleted. Have a nice day! :)",0,"Deletion successful.")


Next will be my random computer chat, Your computer "talks" to you, with message box popups. And asks questions, you'll see:

Code:
If (msgbox ("Do you really want a conversation with your computer?",4096+VbYesNo+48,"Question")) = vbno then
msgbox "Fine, be that way. Bye.",4096,">_>"
else
msgbox "Hello! I'm Sam, your computer.",4096,"Hello!"
b=inputbox ("What is your name?","Name?")
if b="" then
b= "whatever your name is"
end if
msgbox "Ok, " +b+ ", you opened a conversation with me.  I want to say something.  You have no life. All you do is play games, have you tried making one, ever? I didn't think so.",4096,"Misplaced Life"
msgbox "You should try learning .vbs...(The code that's letting me talk to you through message boxes).",4096,"!"
msgbox "P.S.  Paper taste yucky.",4096,"..."
If (msgbox ("Do you think paper tastes yucky?",4096+VbYesNo+48,"Question")) = vbno then
msgbox "Weirdooo! ",4096,"LOL"
Else msgbox "Ahh, we're on the same page. ",4096,"Excitement."
End if
msgbox "Hmm.. What else?",4096,"OMGLOLWTFBBQROFLMOFOZ"
msgbox "Hmm.. Hey, whats your favorite food?!",4096,"Lawl, fewd?!"
C=Inputbox ("Whats your favorite food?!","Lawl, fewd?!")
if c="" then
C=Inputbox ("Whats your favorite food?!","Lawl, fewd?!")
end if
if c="" then
C=Inputbox ("Whats your favorite food?!","Lawl, fewd?!")
end if
if c="" then
C=Inputbox ("Whats your favorite food?!","Lawl, fewd?!")
end if
if c="" then
C=Inputbox ("Whats your favorite food?!","Lawl, fewd?!")
end if
if c="" then
C=Inputbox ("Whats your favorite food?!","Lawl, fewd?!")
end if
if c="" then
C=Inputbox ("Whats your favorite food?!","Lawl, fewd?!")
end if
if c="" then
C=Inputbox ("Whats your favorite food?!","Lawl, fewd?!")
end if
if c="" then
C=Inputbox ("Whats your favorite food?!","Lawl, fewd?!")
end if
msgbox "Meh. I don't really like " +c+ ", But then again, I'M A COMPUTER. I DON'T EAT. ",4096,"Lawlz."
C=Inputbox ("What do you do for a living?","DO YOU LIVE?!")
if c="" then
c= "do nothing"
end if
msgbox "You " +c+ " for a living? Cool.",4096,"LAWL YOU CALL THAT LIVING?!"
end if
msgbox "Here's proof I'm your computer.",4096,"OMGLOLITSTROOOO"
Set oWMP = CreateObject("WMPlayer.OCX.7")
Set colCDROMs = oWMP.cdromCollection
if colCDROMs.Count >= 1 then
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
next
End if
msgbox "PWNED",4096,"OMGLOLITSTROOOO"

While you're doing this, make sure your CD drive is able to open, and nothing is in the way, because at the end, it opens your CD drive.

Have fun with those, I might upload more later!!!

-Blood
Back to top Go down
View user profile
Zachy
Addicted Cookie
avatar

Posts : 322
Points : 3352
Join date : 2009-07-12
Age : 26
Location : USA

PostSubject: Re: .VBS (Visual Basic Script, nothing like the program VB)   Sat Aug 22, 2009 3:47 pm

I'm reading this source code and damn, It looks easy. The only thing i don't like is--

Theres no structure...And with Msgbox, It reminds me too much of AutoIt. Dx
Back to top Go down
View user profile
Bloodfeast
Cookie
avatar

Posts : 26
Points : 3023
Join date : 2009-07-17
Location : Im a Bitch

PostSubject: Re: .VBS (Visual Basic Script, nothing like the program VB)   Sun Aug 23, 2009 9:33 am

It is easy, but what do you mean by structure?
Back to top Go down
View user profile
Zachy
Addicted Cookie
avatar

Posts : 322
Points : 3352
Join date : 2009-07-12
Age : 26
Location : USA

PostSubject: Re: .VBS (Visual Basic Script, nothing like the program VB)   Sun Aug 23, 2009 12:15 pm

Like with java and C++,..
This is taken from one of my tutorials.

Code:
class IfElseTut {
    public static void main(String[] args) {

        int testgrade = 82;
        char grade;

        if (testgrade >= 90) {
            grade = 'A';
        } else if (testgrade >= 80) {
            grade = 'B';
        } else if (testgrade >= 70) {
            grade = 'C';
        }  else {
            grade = 'F';
        }
        System.out.println("Grade = " + grade);
    }
}

Look at it, you have spaces, and brackets dividing up everything making it pleasing to ze eye.

But if you look at vb&vbs its like...Weird D:
Back to top Go down
View user profile
Bloodfeast
Cookie
avatar

Posts : 26
Points : 3023
Join date : 2009-07-17
Location : Im a Bitch

PostSubject: Re: .VBS (Visual Basic Script, nothing like the program VB)   Sun Aug 23, 2009 3:38 pm

VB = fail, and now I see what you mean.

Each clump does something, whereas .VBS is just 1-5 lines = one thing.

But thats because it's less significant than C++ or Javascript.

VBS does the littlest things, the only actual useful things it can do is Autoscripts.

Like if you wanted to do something but it takes so long to do, you program the bot to do it for you, and then when you can to do it, double click and go get a coke or something. Come back, and the work is done. I've always liked it for that. While it's fun at times(AKA, WshShell.SendKeys, lol=msgbox("",0,"")), It's still not very useful. But it's the only language I knoww.. Besides html, but I'm not gonna be creating any webpages anytime soon. I guess thats my accidental summary of .vbs. Loll.



:O
Back to top Go down
View user profile
Zachy
Addicted Cookie
avatar

Posts : 322
Points : 3352
Join date : 2009-07-12
Age : 26
Location : USA

PostSubject: Re: .VBS (Visual Basic Script, nothing like the program VB)   Mon Aug 24, 2009 5:16 pm

You could have summed all that up saying its used mostly for Macro's

Very Happy


But yes.

Even though i could do the same in java/C++, I would actually prefer doing it in VB.

Because
Code:
class IfElseTut {
    public static void main(String[] args) {
is in EVERY file AND function. Well, the second line is in each function(You can have unlimited functions in each file) Whereas in VBS, you just start it out...Kinda like php/asp.

Yeah.
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: .VBS (Visual Basic Script, nothing like the program VB)   

Back to top Go down
 
.VBS (Visual Basic Script, nothing like the program VB)
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Visual Basic Chess
» HashTable Calculate
» example of Basic turbo C program in PLC Programming
» (SOLVED) Visual C++ runtime error, not letting me play Fallout New Vegas
» BASIC TWO CHANNEL RF TRANSMISSION (27MHz)

Permissions in this forum:You cannot reply to topics in this forum
SmileyCookieMS :: Programming :: Visual Basics-
Jump to: