Jump to content

Trying to make a script


Recommended Posts

OK so I am trying to understand how to use AIT but my learning curve is slow.

I am trying to build a MySpace mass thread deleter to clean up spam that can be thousands of pages of posts.

I tried to utilize this script to be able to log in automatically but it is not working.

#include <IE.au3>

$sEmail = "your@email.com"

$sPassword = "yourpassword"

$sURL = "http://www.myspace.com/"

$oIE = _IECreate($sURL)

$oForm = _IEFormGetObjByName($oIE, "theForm")

$oEmail = _IEFormElementGetObjByName($oForm, "email")

$oPassword = _IEFormElementGetObjByName($oForm, "password")

$oButton = _IEGetObjByName($oForm, "ctl00_Main_SplashDisplay_login_loginbutton")

_IEFormElementSetValue($oEmail, $sEmail)

_IEFormElementSetValue($oPassword, $sPassword)

_IEAction($oButton, "click")

I can make it work like this though and manually log in:

#include <IE.au3>

#RequireAdmin

$oIE =_IECreate("http://myspace.com", 1)

sleep(30000) ;; gives you 30 seconds to log in before starting

_IENavigate($oIE, "http://forum.myspace.com/index.cfm?fuseaction=messageboard.viewcategory&groupID=107737288") ;; put the ID for a group you moderate in this URL

for $i=71677957 to 71677955 ;; these numbers are the first and last topic IDs to delete

_IENavigate($oIE,"java script:deleteTopic(" & $i &",true)")

next

It will log in and take me to the topic page but it does not open the topics and delete them.

Can you tell me how to fix it?

The goal is to end up with a mass thread deleter that will have a GUI for moderators to use to clean up spam from groups. Anyone be willing to help me get this thing functional?

I have it mostly planned with the needed functions listed in this mockup:

Posted Image

If anyone is interested and needs the log in for the test group and password let me know.

Link to comment
Share on other sites

I have it to where it will log in to the profile and then go to the topic page, from there I want to be able to search and delete topics by the topic ID#s. What is the next step?

#include <IE.au3>
#RequireAdmin
$oIE =_IECreate("http://myspace.com")
WinWait("MySpace - Microsoft Internet Explorer","")
If Not WinActive("MySpace - Microsoft Internet Explorer","") Then WinActivate("MySpace - Microsoft Internet Explorer","")
WinWaitActive("MySpace - Microsoft Internet Explorer","")
MouseMove(901,623)
MouseDown("left")
MouseUp("left")
Send("passklass{SHIFTDOWN}2{SHIFTUP}yahoo.com{TAB}12345a")
MouseClick("left",1024,692,2)
sleep(20000)
_IENavigate($oIE, "http://forum.myspace.com/index.cfm?fuseaction=messageboard.viewcategory&groupID=107737288")
Link to comment
Share on other sites

I was almost there and I got bumped by the site for too many tries... lol

#include <IE.au3>

$sEmail = "mine@email.com"
$sPassword = "yourpassword"

$sURL = "http://www.myspace.com/"
$oIE = _IECreate($sURL)
$oForm = _IEFormGetObjByName($oIE, "aspnetForm")
$oEmail = _IEFormElementGetObjByName($oForm, "ctl00$cpMain$LoginBox$Email_Textbox")
$oPassword = _IEFormElementGetObjByName($oForm, "ctl00$cpMain$LoginBox$Password_Textbox")
_IEFormElementSetValue($oEmail, $sEmail)
_IEFormElementSetValue($oPassword, $sPassword)


$oSubmit = _IEGetObjByName ($oIE, "dlb")
_IEAction ($oSubmit, "click")

8)

NEWHeader1.png

Link to comment
Share on other sites

I tried to install it but I get an error message

need to change the includes to these

#include <IE.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <ButtonConstants.au3>

... I am not a mind reader and you can help.. when there is an error, state what the error says ( or just copy it form the bottom window pane in SciTe.

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

By the way your script did the log in great. I added the topic url to the next line and it opened it and I am now experimenting getting it to delete the topic then I need to figure out hos to do it with a series of topic ID numbers.

Thanks again for the help.

Welcome!!

After you get that, then you need to explore and work with Koda Form Designer. It's located in SciTe under "tools". This is a great way to designer your GUI.

8)

NEWHeader1.png

Link to comment
Share on other sites

Ok So I thought I would try something other than the thread deleter I am trying to build for MySpace groups and I figured an easy project would be good to help me learn a little more about commands. I decided to make an automated reply to a post but I have a couple of glitches in it.

First this is the code I have up to the point that it needs to be submitted the final time before being posted:

#include <IE.au3>

$sEmail = "passklass@yahoo.com" 
$sPassword = "12345a"  

$sURL = "http://www.myspace.com"
$oIE = _IECreate($sURL)
$oForm = _IEFormGetObjByName($oIE, "aspnetForm")
$oEmail = _IEFormElementGetObjByName($oForm, "ctl00$cpMain$LoginBox$Email_Textbox")
$oPassword = _IEFormElementGetObjByName($oForm, "ctl00$cpMain$LoginBox$Password_Textbox")
_IEFormElementSetValue($oEmail, $sEmail)
_IEFormElementSetValue($oPassword, $sPassword)

$oSubmit = _IEGetObjByName ($oIE, "dlb")
_IEAction ($oSubmit, "click")
_IELoadWait ($oSubmit)
_IENavigate($oIE, "http://forum.myspace.com/index.cfm?fuseaction=messageboard.viewThread&entryID=71683744&groupID=107728568")   
$oSubmit = _IEGetObjByName ($oIE, "topreplybtn")
_IEAction ($oSubmit, "click")
MouseMove(435,526)
MouseDown("left")
MouseUp("left")
Send("Hello{SPACE}World")
$oSubmit = _IEFormImageClick($oIE, "replyFormSubmit")
_IEAction ($oSubmit, "return")
IENavigate($oIE,"java script:doSubmit (" & $i &",true)")

I am trying to get the Java command to make the post but an error comes up:

Posted Image

This is the source code of the Java:

<script language="Javascript">
function EditPost(){
    document.forms.previewReply.action="http://forum.myspace.com/index.cfm?fuseaction=messageboard.postReply&EntryID=71683744&categoryID=0&groupID=107728568&adTopicID=1&Mytoken=3DD3977C-0FDE-4DE4-891CF8009EF2AB40254746889";
  document.forms.previewReply.submit();
    }
var oneClick = 1;
function doSubmit() {
    if (oneClick == 1) {
        oneClick = 0;
        return true;
    }
    else {
        return false;
    }
}
</script>

So what am I doing wrong wit it so that it is not posting, and the only way that I could get it to post script in the body was with the script writer. How can you get text to enter in the body of the post? I tried to use the get object for the body but it did not work.

Link to comment
Share on other sites

There are at least two things here #1, the most important, is you have not used SciTe to test this code. There is an error in the code and SciTe will tell you exactly where it is

#2

Once you understand you can not have errors in the script ( especially when working with IE.au3) then you can work on getting the actualization you want

Scite error for this line...

IENavigate($oIE,"java script:doSubmit (" & $i &",true)")

its _IENavigate()

The "$i" has no value given as a variable

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

No it is not a spammer it is just an idea I wanted to try to learn with. I wanted to make a reply to a post in my test group.

I did the code in ScITe and thought it would work. I guess I still dont understand why it will not click on the final java link to make the post though.

I will keep working on it.

Link to comment
Share on other sites

Yes I am trying to figure it out. I actually got it to post the reply buy using it.

This is the code:

#include <IE.au3>

$sEmail = "passklass@yahoo.com" 
$sPassword = "12345a"  
sleep(5000)
$sURL = "http://www.myspace.com"
$oIE = _IECreate($sURL)
$oForm = _IEFormGetObjByName($oIE, "aspnetForm")
$oEmail = _IEFormElementGetObjByName($oForm, "ctl00$cpMain$LoginBox$Email_Textbox")
$oPassword = _IEFormElementGetObjByName($oForm, "ctl00$cpMain$LoginBox$Password_Textbox")
_IEFormElementSetValue($oEmail, $sEmail)
_IEFormElementSetValue($oPassword, $sPassword)
$oSubmit = _IEGetObjByName ($oIE, "dlb")
_IEAction ($oSubmit, "click")
_IELoadWait ($oSubmit)

_IENavigate($oIE, "http://forum.myspace.com/index.cfm?fuseaction=messageboard.viewThread&entryID=71683744&groupID=107728568")   
$oSubmit = _IEGetObjByName ($oIE, "topreplybtn")
_IEAction ($oSubmit, "click")
MouseMove(435,526)
MouseDown("left")
MouseUp("left")
Send("Hello{SPACE}World")
$oSubmit = _IEFormImageClick($oIE, "replyFormSubmit")
_IEAction ($oSubmit, "return")
$oSubmit = _IEFormImageClick($oIE, "Submit")
_IEAction ($oSubmit, "return")

Now I am working on understanding how to submit the text by command rather than recorded actions. I have tried to use the replyform ID that is in the source but it is not working I will keep trying to figure it out.

I got the variables in the previous post from some code that I was given that the trolls use to pin threads, that is why you may have thought this was being made for malicious purposes but it isnt. I an just trying to understand how some of the functions work before I go too far afield in developing the thread deleter.

They utilize thread ID#s to pin the threads and I think I can use the script they are using to navigate the threads for deletion.

Here it is:

#include <IE.au3>
#RequireAdmin
$oIE =_IECreate("http://myspace.com", 1) 
sleep(45000) ;; gives you 30 seconds to log in before starting
_IENavigate($oIE, "http://forum.myspace.com/index.cfm?fuseaction=messageboard.viewcategory&groupID=107728568")   ;; put the ID for a group you moderate in this URL
for $i=71635339 to 71636539  ;; these numbers are the first and last topic IDs to pin
_IENavigate($oIE,"java script:doSticky(" & $i &",true)")    
next

Do you think the last 3 lines will work to specify the threads for deletion?

My Next thing will be to understand how to search the source and define threads by topic and user ID# and then find thos topic numbers on that page to delete them.

Is this the proper logical steps to develop what I am wanting?

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...