~~Mog13's VB for noobs!~~

Discussion in 'Archives' started by mog13, Apr 30, 2007.

~~Mog13's VB for noobs!~~
  1. Unread #1 - Apr 30, 2007 at 2:33 PM
  2. mog13
    Referrals:
    0

    mog13 Guest

    ~~Mog13's VB for noobs!~~

    hey

    well im trying to give a super n00b friendly guide to vb, its simple but hope you like it.
    also i am trying to upload examples of each project so that you can compare it to help if youres doesn't work.don't steal them, there small and unimportant so it wouldnt matter if you did its just unethical.

    1)HELLO WORLD!
    2)AUTO SPAMMER-(usless but fun :p)
    3)jazzing it up,frames and the like
    ------ 3.1)frames
    ------ 3.2)colour
    ------ 3.3)_'s
    ------ 3.4)layout
    ------ 3.5)finishing touches
    4)upgrading our spammer part 1, changing the speed
    5)upgrading our spammer part 2, antiban
    6)upgrading our spammer part 3, multiple forms (a license agreement screen and a help one)
    7)upgrading our spammer part 4, window focus and setting the mouse relative to a window
    8)mouse manipulation

    1)hello world

    ok we will start by opening up vb :p this should be simple, if not pm me.
    [​IMG]
    ok, now we will create a button to do this click this button
    [​IMG]
    now click on the form then, drag it out to where you want it. now we will change the name that shows up on the button.simply edit the name bit here.make sure the button is selected! not the form itself! also make sure its the bit in the picture utherwise it may brake youre programme.
    [​IMG]
    ok now for the coding!!

    double click the button and a new window should come up with,
    <Code>Private Sub Command1_Click()

    End Sub
    <Code>

    writen on it. ok inbetween this you will need to write

    <Code>msgbox("hello world")<Code>

    ok well that code should be simple. and even if you dont know any code you should be able to figure it out.

    well thats the end of part one! you have just created youre first programm,congratulations!.all you have to do to run it is click the blue arrow on the top bar.
    [​IMG]

    Example is here

    2)auto spammer

    ok. using the first part of this tutorial you need to make a button saying "start spamming"or somthing like that.
    so you have a button to start the spamming? but what about stopping. make another button and label it "stop"
    now you need a textbox. if you didn't know this is a box where a user can add text:p.do the same as you did for the button but make sure you have this selected
    [​IMG]
    now create a text box underneath the button. this will be for the user to write what he wants spammed.change the text option at the side to say what you want youre spammer to say by defualt.
    [​IMG]
    now we need a timer,which should be farley obviousto make this will controll how quickly the message is sent. do the same as the button and text box but use this.
    [​IMG]
    and edit the settings so it looks like this.
    [​IMG]
    however the 3 bit is 3 milliseconds so you may want to change that :p i just think its funny being that fast ;)
    ok so you should now have 3 things. a button, a text box and a timer.

    now double click the button to bring the code window up and were gona need to

    write this
    <Code>timer1.enabled = true<Code>

    Now to the timer,double click it and add this
    <Code>SendKeys (Txtsentence.Text)
    SendKeys "{enter}"
    <Code>

    Finally double click the stop button. and add this
    <Code>timer1.enabled = false<Code>

    Ok, so youll never learn how to code unles you find out what it means:p so here it goes
    <explanation> well lets see, well start with the start button. well this is basicly making the timer turn on which leads to the next bit, the timer. the timer executes a piece of code at a set interval. this code writes whats in the textbox and then presses enter. and finaly the stop button turns the timer back of <explanation>

    and that is basicly it =) press the blue arrow to play it ;) its very simple but later youl learn to make it look better and run better

    Example is here

    3)jazzing it up
    ok now were gona find out how to add things to make programmes look a bit more professional and nice so that you don't have to follow the tutorials strictly after this (in the sense you can make them look completly difernt!)

    3.1)frames

    frames are just like borders for things. it is common to put buttons of all the same type in one frame e.g start, stop and exit would all be together.also it is possible and widely done to put a frame within a frame and infact you can put as many as you want all inside each other.yet again the frame works the same way as everything else so far you click the button then click and drag the button is located here
    [​IMG]
    and heres an example, from one of my first programmes, of frames inside frames holding things that are similar together
    [​IMG]
    also there are a few usefull options you may want down at the side. the first is appearance, i personaly prefer 3d but 2d is fine you just need to edit the colours:p,which you'll find out about soon;) if you already havn't figured it.next is caption. this is important because its like leaving a button saying command1, lame and stupid,no ofence XP. next is font whitch should be kinda obvious. and thats about all the major things :p

    3.2)colour

    fairly simple but a few words of advice. colouring is in the settings bit. the bit backcolour. click it and then a dropdown arrow will apear. however it will give you only standard greyish silverish colours. just press the pallet bit next to it and you'l get some other colours.
    [​IMG]
    however it is not always brillaint as it may seem. things like frames leave greyish marks around the side. clever colouring can get past most of it (as in not having drastic changes in colour), but not all of it. there are ways to fix this but ill tell you how to later:p. for now just make sure youre not stupid and colour carefuly like this. (an example of both good and bad, bad on the left good on right.
    [​IMG]
    you may sometimes need drastic colour changes but not usaly.
    ohh and finaly when you change the colour of a button it wont change colour you need to change the style bit to graphical. incase you dont get that,you should at this stage but if you dont,dont worry,a example is here

    also you may be wondering how i changed the text colour simply edit the forecolour option.

    3.3)_'s

    well this is very simple but im my personal opinion it makes it seem alot more professional. what it is, is adding a _ under a letter to indicate things like hotkeys. although we wont be adding hotkeys for a while, it still makes it look more profesional
    [​IMG]
    to do this its incredibly easy in the caption part of somthing just type a & before the letter ao if you want to have a _ under the s in start it would be &start
    [​IMG]
    ohh by the way you can only have 1 in each caption.


    3.4/3.5)presentation & finishing touches.

    well this isnt really programming just a few tips. i mixed them together because there the same type of thing. make sure things genraly are lined up and fit neatly into the form. so dont leave huge blank spaces everwhere. also make sure the colouring is nice and that the spelling is right. also try and use good grammar(and dont point out all the spelling and grammar mistakes in this tutorial:p) but it makes the programme youre making seem more profesional ;)also for the same reason make sure you dont leave youre form labeld form1. to change this click the background and change the caption option to what you want it to say ;)

    4)upgrading our spammer part 1, changing the speed

    ok well for the next few bits of the tutorial were gona be learning through upgrading the spammer. in this part we will be ading two things. 1 a option to change how fast the message is sent and a super simple antiban. well since this spammer acually isnt strictly for neopets, there is not antiban for neopets its for, say you are selling somthing on a online game, you can repeat selling somthing over and over and ocasionaly say things like "comon i want to sell this" so it seems more human ;P ok now onto the actuall making it.you will probably need to resize youre form. to do this click anywhere without a controll on it (any bit with black dots on it). like this.
    [​IMG]
    now resize it to whatever you want. now we are going to need another text box add one. at this point you may also whant to add a label below each textbox. labels are just peices of text. usaly they are used to tell the user things. in this case we are going to tell them what we want them to type in the text box's. this is the label button
    [​IMG]
    and,surpris-suprise, it works the same as the other controlls so far, just click and drag.add one label under the bit where we want them to put what they want to spam, and change its caption to what you want it to say.now create another text box and add it and add a label under it saying somthing like "the speed it should click"and add the default text in the textbox to somthing like 5.(if you cant rember this please check 2.) again ) it should look somthing like this
    [​IMG]
    so now were gona need to change a bit of code so that it all works properly.double click the start spamming button again and add this just below where it says "timer1.enabled = true"

    <Code>timer1.interval = text2.text * 1000<Code>

    ok firstly let me just clear up some things cause this is where most people will go wrong. when you create somthing ,e.g a textbox it will automaticly call it text1 and then text2 for the next one and so on. so if this isnt working just change the text2 to what the name of the textbox we just created is. to find this is simple,its the name setting here
    [​IMG]
    you can have the name as almost anything. some things will throw up erorrs so just name them sensibly:p. ok so now onto the explanation of this code

    <explanation> this piece of code should be relitivly simple if you have coded before, if you dont understand it dont worry thats why i am explaining it:p. what it is doing is making timer1's (you know the timer we made) interval (the amount of time it counts down till executing the code in it) is. it is setting the interval to what is in textbox2.text (what the user put in or the default you put in.)you may be wondering why put the x 1000 bit? well timers are in milliseconds and if somone puts it as 1 thinking its seconds that will umm well be a very "interesting" result of it being typed every 100th of a second.:p so its just more user friendly to turn it into seconds and if they want to have milliseconds they can always enter stuff like 0.25 or somthing like that <explanation>

    well now you have a spammer with a option to change how fast it sends the message. Example is here

    well thats all for now enjoy, maybe more later.
     
  3. Unread #2 - Apr 30, 2007 at 5:43 PM
  4. superman1478
    Joined:
    Jan 21, 2007
    Posts:
    701
    Referrals:
    2
    Sythe Gold:
    0

    superman1478 Apprentice

    ~~Mog13's VB for noobs!~~

    looks like an easy to follow guide, except the dark blue text is hard to read.
     
  5. Unread #3 - May 1, 2007 at 12:38 PM
  6. mog13
    Referrals:
    0

    mog13 Guest

    ~~Mog13's VB for noobs!~~

    ohh ok ill change it thanks.
     
  7. Unread #4 - May 7, 2007 at 3:54 PM
  8. Thief
    Referrals:
    0

    Thief Guest

    ~~Mog13's VB for noobs!~~

    This is a great tutorial! It helped me alot as I am getting back into VB. Thank you very much. Can this be added to the tutorial list?
     
  9. Unread #5 - May 7, 2007 at 8:47 PM
  10. Teizhcial
    Referrals:
    0

    Teizhcial Guest

    ~~Mog13's VB for noobs!~~

    KIK AZZ Auto-Spammers RULE
     
  11. Unread #6 - May 8, 2007 at 7:54 AM
  12. mog13
    Referrals:
    0

    mog13 Guest

    ~~Mog13's VB for noobs!~~

    XD thank you, both of you. i was/might do some more so you can make better programms. but im not sure
     
< Spending 2M on a pure! | lvl 27 Guildminer + Wcer >

Users viewing this thread
1 guest


 
 
Adblock breaks this site