Results 1 to 5 of 5

[RELEASE] Trick Functions

This is a discussion on [RELEASE] Trick Functions within the AutoHotKey Help/Training forums, part of the General/Help category; Well here are some functions that I quickly made that allow people to use various tricks easier in AHK. I ...

  1. #1
    Ian
    Ian is offline Junior Member
    Join Date
    Feb 2009
    Posts
    110

    Default [RELEASE] Trick Functions

    Well here are some functions that I quickly made that allow people to use various tricks easier in AHK. I know some of these are incredibly simple but you'd be surprised by what people can't figure out on there own. Includes function and example:

    Gmail Plus Trick:

    Changes [example_email] into [example_email+randomnumber@gmail.com]

    Function:
    Code:
    GPT(Email, Max, S){
    global SequentialVar
    Random, N, 1, %Max%
    If(S=1){
    SequentialVar++
    N:= SequentialVar
    }
    Return Email "+" N "@gmail.com"
    }
    Example:
    Code:
    EmailAddress:= "Iansemail"
    TrickedEmail:= GPT(EmailAddress)
    Send, %TrickedEmail%
    Gmail Dot Trick:

    Changes [example_email] into [e.xa.m.ple_e.ma.i.l@gmail.com]

    Function:
    Code:
    GmailDotTrick(email) {
    IfNotInString, email, @gmail.com
    	return "error"
    StringTrimRight, email, email, 10
    Random, r, 0, % 2**(StrLen(Email)-1)
    VarSetCapacity(S,65,0)
    DllCall("msvcrt\_i64toa", Int64,r, Str,s, Int,2)
    Loop, Parse, Email
    {
    StringMid, l, s, %A_Index%, 1
    if(l = 1)
    	t.= a_loopfield "."
    else
    	t.= a_loopfield
    }
    return t "@gmail.com"
    }
    Example:
    Code:
    Msgbox, % GmailDotTrick("testingemail@gmail.com")
    Order Number Trick:

    Generates a random order number

    Function:
    Code:
    ONT(Max, S){
    global SequentialVar
    Random, N, 1, %Max%
    If(S=1){
    SequentialVar++
    N:= SequentialVar
    }
    Return "Order #" N
    }
    }
    Example:
    Code:
    OrderNum:= ONT("1000")
    Send, %OrderNum%
    Letter Address Trick:

    Appends a random number to the end of an address
    Changes 123 Bubblebee Rd. to 123C Bubblebee Rd.


    Function:
    Code:
    LAT(Number, Street, Amount){
    Loop, %Amount%{
    Random, L, 97, 112
    Number.= Chr(L)
    }
    Return Number Street 
    }
    Example:
    Code:
    Num:= "123"
    St:= "BubbleBee Rd"
    TrickedAddress:= LAT(Num, St, 2)
    Apartment Trick:

    Generates a random apartment number

    Function:
    Code:
    AT(Max){
    Random, N, 1, %Max%
    Return "Apt. #" N
    }
    Example:
    Code:
    AptTrick:= AT("1000")
    Send, %AptTrick%
    If your unsure of how to use functions: http://www.autohotkey.com/docs/Functions.htm
    If you know a trick that I didn't cover then please PM me and I'll try and make a function for it
    If you use these in your bot I would greatly appreciate it if you just thanked me in your thread
    Last edited by Ian; 07-10-2010 at 10:38 AM.

  2.   Alt These ads help cover server costs and such.


  3. #2
    7usabball is offline Secret Undercover *****
    Join Date
    Jan 2009
    Posts
    1,462

    Default

    ehhh, no need for a gmail + trick function I think, but nice

    for plus trick, simply do:

    M = 1
    send, %email%+%M%@gmail.com
    M ++

    or you could just use a_index for the number... as long as ur using a loop
    ▀█ █▄█ ▄█▀ ▐▀▌


  4. #3
    Ian
    Ian is offline Junior Member
    Join Date
    Feb 2009
    Posts
    110

    Default

    Quote Originally Posted by 7usabball View Post
    ehhh, no need for a gmail + trick function I think, but nice

    for plus trick, simply do:

    M = 1
    send, %email%+%M%@gmail.com
    M ++

    or you could just use a_index for the number... as long as ur using a loop
    Do you think I don't know that? I just made these functions for people who were using bad methods like getting emails from a text file (Sound familiar?) or other methods.
    Last edited by Ian; 10-11-2009 at 12:36 PM.

  5. #4
    deejannon is offline Banned
    Join Date
    Aug 2009
    Posts
    200

    Default

    For the order number trick i used.

    Code:
    AptNumber = 1
     
    loop %amount%
    {
    JS3 := "javascript:document.getElementById('address'). value='" Address " " AptNumber "';void(0)"
    
    COM_Invoke(pwb, "Navigate", JS1)
    Sleep, 100
    AptNumber++

  6. #5
    Ian
    Ian is offline Junior Member
    Join Date
    Feb 2009
    Posts
    110

    Default

    Quote Originally Posted by deejannon View Post
    For the order number trick i used.

    Code:
    AptNumber = 1
     
    loop %amount%
    {
    JS3 := "javascript:document.getElementById('address'). value='" Address " " AptNumber "';void(0)"
    
    COM_Invoke(pwb, "Navigate", JS1)
    Sleep, 100
    AptNumber++
    Like I said to 7usabball, I know there are other ways to do it. No need to post them. Added sequential option to the ONT function.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Facebook Bots | Admin Forum