Sign in to follow this  
Followers 0
Symplystyc

script to pm everyone in your friends list

8 posts in this topic

I'd like to make a script that would click the "my friends" link

select the top member and send them a pm

then select the next member and send them the same pm

and so on until everyone was pm'd with the same message.

Its not for this forum but an example that worked here could easily be used on other forums, unfortunatly I'm not sure where to start. Any suggestions?


The glass is neither half empty nor half full, it is simply twice as big as it needs to be.

Share this post


Link to post
Share on other sites

I'd like to make a script that would click the "my friends" link

select the top member and send them a pm

then select the next member and send them the same pm

and so on until everyone was pm'd with the same message.

Its not for this forum but an example that worked here could easily be used on other forums, unfortunatly I'm not sure where to start. Any suggestions?

Use the _IE* functions in the help file, they have all you would need to get you going.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Okay fumbling around but this is a learning process.

#include <IE.au3>
$oIE = _IECreate ("http://www.autoitscript.com/")
_IELinkClickByText ($oIE, "Mailing List")

So I noticed that it will click on forum, mailing list, here, graphics and wallpapers. basically anything with a link except it will not click on tabs on top like the gift shop tab. What should i use besides _IELinkClickByText?


The glass is neither half empty nor half full, it is simply twice as big as it needs to be.

Share this post


Link to post
Share on other sites

Okay fumbling around but this is a learning process.

#include <IE.au3>
$oIE = _IECreate ("http://www.autoitscript.com/")
_IELinkClickByText ($oIE, "Mailing List")

So I noticed that it will click on forum, mailing list, here, graphics and wallpapers. basically anything with a link except it will not click on tabs on top like the gift shop tab. What should i use besides _IELinkClickByText?

Lots of functions there... might use the get link collection function.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Dale Hohm has a link in his signature for the IE Developer Toolbar that will help you out quite a bit.

Another tool I like to use is (another suggestion from Dale) displaying the page's HTML in notepad.

$hFILE = FileOpen(@TempDir & "\IETemp.txt", 2)
    If $hFILE = -1 Then
        DBP($sVERSION, "File Creation Error", 0, $i_DEBUG)
        SetError(1)
        Return 0
    EndIf

#region - Function:  CrashRun() -   Debugger #1:  Displays HTML
Func CrashRun($oIE, $i_flag = 0)
    ClipPut(_IEDocReadHTML($oIE))
    If $i_flag = 0 Then
        FileWrite($hFILE, _IEDocReadHTML($oIE))
        FileClose($hFILE)
        Run('Notepad "' & @TempDir & '\IETemp.txt"')
        Sleep(1000)
        FileDelete($hFILE)
    EndIf
EndFunc   ;==>CrashRun
#endregionoÝ÷ Ù(¦¦©ºÖ­«!FéÚ~׫¶n)ඨn7¶ {*.Á©íZ­Jj${¬µ©dxn­Á«®­w¬h¥j»h¶¬jëh×6     ; ***** BEGIN BUTTON CLICKING ROUTINE
        $binFlag = False
        $oFrmItm_Btn01 = _IETagNameGetCollection($oIE, "INPUT") ; Get all tags that are of type "INPUT"
        $iInputCnt = @extended
        ConsoleWrite("Debug: Found " & $iInputCnt & " input tags" & @LF)
        If $iInputCnt Then
            For $Input In $oFrmItm_Btn01 ; For each $Input found in the $oFrmItm_Btn01 collection,
                If $Input.type = "submit"  And $Input.value = "Click Here to Claim Your Reward!"  Then ; if they match the following criteria
                    _IEAction($Input, "click") ; click the first match
                    $binFlag = True ; set the flag
                    ExitLoop ; and bail out of the loop
                EndIf
            Next
        EndIf
        If $binFlag = False Then
            _ErrorHandle($sVERSION, "Error clicking reward button", $oIE, $i_DEBUG, 1, 1060)
            SetError(@error)
            SetExtended(@extended)
            Return 0
        EndIf
        _IELoadWait($oIE) ; wait for the page to load
        Sleep(125 * Random(4, 40, 1)) ; random sleep from 0.5 to 5 seconds.
        ; ***** END BUTTON CLICKING ROUTINE

Keep in mind this button clicker is buried rather far inside my code (that's why there's odd _Functions() scattered about), but is easily adapted to your specific needs on clicking a website's tab. Most likely it's a tabular element inside of a set of <DIV type=XYZ> tags.


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Lots of functions there... might use the get link collection function.

next question, in the _IEFormGetObjByName.au3 example

#include <IE.au3>
$oIE = _IECreate ("http://www.google.com")
$oForm = _IEFormGetObjByName ($oIE, "f")
$oQuery = _IEFormElementGetObjByName ($oForm, "q")
_IEFormElementSetValue ($oQuery, "AutoIt IE.au3")
_IEFormSubmit ($oForm)

I can see where the "f" and "q" come from but on the page I'm looking at I'm not sure what names I should use.

<tr>
  <td colspan='2' class='pformstrip'>Enter your message</td>
</tr>
<tr>
  <td class="pformleft"><b>Message Title</b></td>
  <td class="pformright"><input type="text" name="msg_title" size="50" tabindex="2" maxlength="40" value="" class="forminput" /></td>
</tr><tr><td class='pformleft'>&nbsp;</td><td class='pformright'>
<table cellpadding="0" cellspacing="0" width=100%>

Posted Image

Edited by Symplystyc

The glass is neither half empty nor half full, it is simply twice as big as it needs to be.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

<td class="pformright"><input type="text" name="msg_title" size="50" tabindex="2" maxlength="40" value="" class="forminput" /></td>

Use the example I provided and search for $input.type = "text" and $input.name = "msg_title" and instead of doing an _IEAction($Input, "click"), do an _IEFormElementSetText($Input, "Text goes here") Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Use the example I provided and search for $input.type = "text" and $input.name = "msg_title" and instead of doing an _IEAction($Input, "click"), do an _IEFormElementSetText($Input, "Text goes here")

thanks I can get it to fill in the msg_title section now. The help here is amazing.

Edited by Symplystyc

The glass is neither half empty nor half full, it is simply twice as big as it needs to be.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0