supag Posted April 20, 2005 Posted April 20, 2005 Umm yeah, like it says, its a myspace bot. This is my first bot ive made and i need someone to help me recode it. The ideas and method is there, but the code isnt. Ive only been using what ive been able to figure out. For looping im using $i = 0 Do (code) $i = $i + 1 Until $i = 1000 but in order to make the bot better, due to myspace lag; sometimes a page wont load and etc. I need to add a check, a check what will check to see if "Myspace.com - Microsoft Internet Explorer" is still open, and if not, then reopen and relogin. I dont know how to do this without messing up the bot, because like i said before, my coding is very limited, it's my first bot. If you have a lot more experience then me and would like to help me out, please email me at "xx1337xx@hotmail.com" or aim "ssuuppaag". Thanx
Insolence Posted April 20, 2005 Posted April 20, 2005 If you want to do an infinite loop, use this: While 1 ;code here WEnd You can scan for colors to check whether or not the page is fully loaded. "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
supag Posted April 20, 2005 Author Posted April 20, 2005 I have pixelsearch and my code is one big ball of shit. I need someone to help me fix it up and make it right. I tried while 1 and wend, got some error. Do you think you could help me out?
Insolence Posted April 20, 2005 Posted April 20, 2005 But of course, everyone here _can_ help you Run tidy on it, and post it here, I'm sure it can't be that big. "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
supag Posted April 20, 2005 Author Posted April 20, 2005 Its not that big, but its like a lot of random stuff put into 1 big loop. Whats tidy?
Insolence Posted April 20, 2005 Posted April 20, 2005 I assume you have SciTE (AutoIt script editor), it's in the 'Tools' menu.If you don't have SciTE, get it here: http://www.autoitscript.com/forum/index.php?showtopic=10277Also, I just noticed, this is in the wrong forum. "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
supag Posted April 20, 2005 Author Posted April 20, 2005 (edited) lmao, nooo. Ive been using notepad, but im dling it right now. Ohh, sorry didnt know that. The mods can move it tho. Edited April 20, 2005 by supag
supag Posted April 20, 2005 Author Posted April 20, 2005 expandcollapse popupRun("C:\Program Files\Internet Explorer\IEXPLORE.EXE") Sleep(5000) WinSetState("Welcome to MSN.com - Microsoft Internet Explorer", "", @SW_MAXIMIZE) Sleep(800) MouseClick("left", 190, 100, 2) Send("http://myspace.com{ENTER}") Sleep(10000) MouseClick("left", 693, 340, 2) Send("password{ENTER}") Sleep(15000) MouseClick("left", 365, 256, 2) Sleep(9000) MouseClick("left", 358, 328) Sleep(800) Send("{DOWN}") Sleep(2000) MouseClick("left", 461, 328) MouseClick("left", 461, 328) Sleep(800) Send("{DOWN}") Sleep(800) MouseClick("left", 356, 363, 2) Sleep(800) MouseMove(340, 120) Sleep(800) Send("{ENTER}") Sleep(2000) MouseClick("left", 450, 363, 2) Sleep(5000) MouseClick("Left", 450, 400) sleep(1000) Send("^f") Sleep(500) send("View Profile{ENTER}") Sleep(500) $Co_ord1 = PixelSearch( 20, 500, 450, 710, 0x335EA8) If Not @Error Then MouseMove ($Co_ord1[0], $Co_ord1[1],0) MouseClick("Right") Sleep(500) Send("n") EndIf Sleep(15000) WinSetState("Myspace.com - Microsoft Internet Explorer", "", @SW_MAXIMIZE) Sleep(800) $Co_ord1 = PixelSearch( 20, 500, 450, 700, 0x955127) If Not @Error Then MouseMove ($Co_ord1[0], $Co_ord1[1],0) MouseClick("Left") EndIf Sleep(7000) $Co_ord1 = PixelSearch( 120, 240, 380, 520, 0xE3EBF3) If Not @Error Then MouseMove ($Co_ord1[0], $Co_ord1[1],0) MouseClick("Left") EndIf Sleep(7000) WinClose("Myspace.com - Microsoft Internet Explorer") Sleep(200) $i = 0 Do WinActivate("Myspace.com - Microsoft Internet Explorer", "") If WinActive("Myspace.com - Microsoft Internet Explorer") Then Sleep(800) WinClose("Find") Sleep(800) send("{PGUP}") send("{PGUP}") Sleep(200) MouseClick("left", 450, 363, 2) Sleep(5000) MouseClick("Left", 450, 400) sleep(1000) Send("^f") Sleep(500) send("View Profile{ENTER}") Sleep(500) $Co_ord1 = PixelSearch( 20, 500, 450, 710, 0x335EA8) If Not @Error Then MouseMove ($Co_ord1[0], $Co_ord1[1],0) MouseClick("Right") Sleep(500) Send("n") EndIf Sleep(15000) WinSetState("Myspace.com - Microsoft Internet Explorer", "", @SW_MAXIMIZE) Sleep(800) $Co_ord1 = PixelSearch( 20, 500, 450, 700, 0x955127) If Not @Error Then MouseMove ($Co_ord1[0], $Co_ord1[1],0) MouseClick("Left") EndIf Sleep(7000) $Co_ord1 = PixelSearch( 120, 240, 380, 520, 0xE3EBF3) If Not @Error Then MouseMove ($Co_ord1[0], $Co_ord1[1],0) MouseClick("Left") EndIf Sleep(7000) WinClose("Myspace.com - Microsoft Internet Explorer") Sleep(200) $i = $i + 1 Until $i = 25 WinClose("Myspace.com - Microsoft Internet Explorer") Sleep(1000) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
quick_sliver007 Posted April 20, 2005 Posted April 20, 2005 Umm yeah, like it says, its a myspace bot. This is my first bot ive made and i need someone to help me recode it. The ideas and method is there, but the code isnt. Ive only been using what ive been able to figure out. For looping im using $i = 0Do(code)$i = $i + 1Until $i = 1000but in order to make the bot better, due to myspace lag; sometimes a page wont load and etc. I need to add a check, a check what will check to see if "Myspace.com - Microsoft Internet Explorer" is still open, and if not, then reopen and relogin. I dont know how to do this without messing up the bot, because like i said before, my coding is very limited, it's my first bot.If you have a lot more experience then me and would like to help me out, please email me at "xx1337xx@hotmail.com" or aim "ssuuppaag". Thanx<{POST_SNAPBACK}>try something like this$i = 0 Do If PixelGetColor ( x , y ) = dec number for color Then (code) $i = $i + 1 EndIf Until $i = 1000Find the X,Y and number for color using the win get info tool that came with autoit. .
supag Posted April 20, 2005 Author Posted April 20, 2005 line 88 where it says "$i = 0" thats where the looping starts (duh). The first part is just to login then load the settings. The bot clicks on a profile which popups as a new page, then adds that person as a friend and closes that page. Then it goes back to the first page and click "go", which brings up a new person. Sometimes the site will lag and it wont open that persons profile, so it ends up closing the page. I need the bot to check to see if the page is still active, if not then reopen and relogin. Login Does settings CLicks the persons profile, opens in new window Adds as friend then closes window Then goes back to original window Clicks "go" (brings a new person up) Then opens the new persons profile (this is where the loop begins)
supag Posted April 20, 2005 Author Posted April 20, 2005 quick_sliver007: The bot uses 2 windows, then closes the 2nd, goes back to the 1st, which will load a 2nd window again, then closes. Sometimes due to lag, the 2nd window wont load, so the bot closes the first window thinking its the 2nd. What i need it to do is something like "If not winactive("Myspace.com - Microsoft Internet Explorer") then (xxxxxxxxx (blahs) to run the first part of my code, which is to "open a new internet explorer and to relog in and start looping again"
supag Posted April 20, 2005 Author Posted April 20, 2005 My coding sinks, is there any way to clean it up?
quick_sliver007 Posted April 20, 2005 Posted April 20, 2005 (edited) My coding sinks, is there any way to clean it up?<{POST_SNAPBACK}>From my Exp with this kind of script. It is just Trail and error. In the past I have had chunks of code that look like.Do Sleep(100) Until PixelGetColor ( x , y ) = colorAnd use If,Else,Then statements with WinGetText ( "title" [, "text"] ) = "textI hope this helps.**edit**LikeIf WinGetText ( "title" [, "text"] ) = "text1" Then (code1) ElseIF WinGetText ( "title" [, "text"] ) = "text2" Then (code2) else (code3) endIf Edited April 20, 2005 by quick_sliver007 .
supag Posted April 20, 2005 Author Posted April 20, 2005 I know what u mean its almost the same as "if not winactive..." but how do i get it to run from line 1 to line 88 all over again ? i can just copy and paste the code below the "else" it gives me an error "no until statement" how can i make it do lines 1-88 for the else statement?
quick_sliver007 Posted April 20, 2005 Posted April 20, 2005 I know what u mean its almost the same as "if not winactive..." but how do i get it to run from line 1 to line 88 all over again ? i can just copy and paste the code below the "else" it gives me an error "no until statement" how can i make it do lines 1-88 for the else statement?<{POST_SNAPBACK}>Make lines 1-88 a function and call the function like;func _myfunction() lines 1 though 88 EndFuncThen call the function like_myfunction() .
supag Posted April 20, 2005 Author Posted April 20, 2005 func _myfunction() lines 1 though 88 EndFunc i put that where? and then after the Else i just put "_myfunction"?
quick_sliver007 Posted April 20, 2005 Posted April 20, 2005 (edited) func _myfunction()lines 1 though 88EndFunci put that where? and then after the Else i just put "_myfunction"?<{POST_SNAPBACK}>Like thisexpandcollapse popupFunc _myfunction() Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE") Sleep(5000) WinSetState("Welcome to MSN.com - Microsoft Internet Explorer", "", @SW_MAXIMIZE) Sleep(800) MouseClick("left", 190, 100, 2) Send("http://myspace.com{ENTER}") Sleep(10000) MouseClick("left", 693, 340, 2) Send("password{ENTER}") Sleep(15000) MouseClick("left", 365, 256, 2) Sleep(9000) MouseClick("left", 358, 328) Sleep(800) Send("{DOWN}") Sleep(2000) MouseClick("left", 461, 328) MouseClick("left", 461, 328) Sleep(800) Send("{DOWN}") Sleep(800) MouseClick("left", 356, 363, 2) Sleep(800) MouseMove(340, 120) Sleep(800) Send("{ENTER}") Sleep(2000) MouseClick("left", 450, 363, 2) Sleep(5000) MouseClick("Left", 450, 400) Sleep(1000) Send("^f") Sleep(500) Send("View Profile{ENTER}") Sleep(500) $Co_ord1 = PixelSearch(20, 500, 450, 710, 0x335EA8) If Not @error Then MouseMove($Co_ord1[0], $Co_ord1[1], 0) MouseClick("Right") Sleep(500) Send("n") EndIf Sleep(15000) WinSetState("Myspace.com - Microsoft Internet Explorer", "", @SW_MAXIMIZE) Sleep(800) $Co_ord1 = PixelSearch(20, 500, 450, 700, 0x955127) If Not @error Then MouseMove($Co_ord1[0], $Co_ord1[1], 0) MouseClick("Left") EndIf Sleep(7000) $Co_ord1 = PixelSearch(120, 240, 380, 520, 0xE3EBF3) If Not @error Then MouseMove($Co_ord1[0], $Co_ord1[1], 0) MouseClick("Left") EndIf Sleep(7000) WinClose("Myspace.com - Microsoft Internet Explorer") Sleep(200) $i = 0 EndFunc _myfunction() Do WinActivate("Myspace.com - Microsoft Internet Explorer", "") If WinActive("Myspace.com - Microsoft Internet Explorer") Then Sleep(800) WinClose("Find") Sleep(800) Send("{PGUP}") Send("{PGUP}") Sleep(200) MouseClick("left", 450, 363, 2) Sleep(5000) MouseClick("Left", 450, 400) Sleep(1000) Send("^f") Sleep(500) Send("View Profile{ENTER}") Sleep(500) $Co_ord1 = PixelSearch(20, 500, 450, 710, 0x335EA8) If Not @error Then MouseMove($Co_ord1[0], $Co_ord1[1], 0) MouseClick("Right") Sleep(500) Send("n") EndIf Sleep(15000) WinSetState("Myspace.com - Microsoft Internet Explorer", "", @SW_MAXIMIZE) Sleep(800) $Co_ord1 = PixelSearch(20, 500, 450, 700, 0x955127) If Not @error Then MouseMove($Co_ord1[0], $Co_ord1[1], 0) MouseClick("Left") EndIf Sleep(7000) $Co_ord1 = PixelSearch(120, 240, 380, 520, 0xE3EBF3) If Not @error Then MouseMove($Co_ord1[0], $Co_ord1[1], 0) MouseClick("Left") EndIf Sleep(7000) WinClose("Myspace.com - Microsoft Internet Explorer") Sleep(200) $i = $i + 1 ;### Tidy Error: Level error -> Until is closing previous If Until $i = 25 WinClose("Myspace.com - Microsoft Internet Explorer") Sleep(1000) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Then yes then after the Else just put _myfunction, with no quote.Also one of your If staments is missing a Endif. I don't know where you want to end the if statement. Edited April 20, 2005 by quick_sliver007 .
supag Posted April 20, 2005 Author Posted April 20, 2005 line 86, after the If Not Winactive("myspace.com blah") then and i put before it _myfunction but it gave me a error
quick_sliver007 Posted April 20, 2005 Posted April 20, 2005 line 86, after the If Not Winactive("myspace.com blah") then and i put before it _myfunctionbut it gave me a error<{POST_SNAPBACK}>Show me your updated coded .
supag Posted April 20, 2005 Author Posted April 20, 2005 expandcollapse popupFunc _myfunction() Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE") Sleep(5000) WinSetState("Welcome to MSN.com - Microsoft Internet Explorer", "", @SW_MAXIMIZE) Sleep(800) MouseClick("left", 190, 100, 2) Send("http://myspace.com{ENTER}") Sleep(10000) MouseClick("left", 693, 340, 2) Send("password{ENTER}") Sleep(15000) MouseClick("left", 365, 256, 2) Sleep(9000) MouseClick("left", 358, 328) Sleep(800) Send("{DOWN}") Sleep(2000) MouseClick("left", 461, 328) MouseClick("left", 461, 328) Sleep(800) Send("{DOWN}") Sleep(800) MouseClick("left", 356, 363, 2) Sleep(800) MouseMove(340, 120) Sleep(800) Send("{ENTER}") Sleep(2000) MouseClick("left", 450, 363, 2) Sleep(5000) MouseClick("Left", 450, 400) Sleep(1000) Send("^f") Sleep(500) Send("View Profile{ENTER}") Sleep(500) $Co_ord1 = PixelSearch(20, 500, 450, 710, 0x335EA8) If Not @error Then MouseMove($Co_ord1[0], $Co_ord1[1], 0) MouseClick("Right") Sleep(500) Send("n") EndIf Sleep(15000) WinSetState("Myspace.com - Microsoft Internet Explorer", "", @SW_MAXIMIZE) Sleep(800) $Co_ord1 = PixelSearch(20, 500, 450, 700, 0x955127) If Not @error Then MouseMove($Co_ord1[0], $Co_ord1[1], 0) MouseClick("Left") EndIf Sleep(7000) $Co_ord1 = PixelSearch(120, 240, 380, 520, 0xE3EBF3) If Not @error Then MouseMove($Co_ord1[0], $Co_ord1[1], 0) MouseClick("Left") EndIf Sleep(7000) WinClose("Myspace.com - Microsoft Internet Explorer") Sleep(200) $i = 0 EndFunc _myfunction() Do WinActivate("Myspace.com - Microsoft Internet Explorer", "") If Not WinActive("Myspace.com - Microsoft Internet Explorer") Then _myfunction Sleep(800) WinClose("Find") Sleep(800) Send("{PGUP}") Send("{PGUP}") Sleep(200) MouseClick("left", 450, 363, 2) Sleep(5000) MouseClick("Left", 450, 400) Sleep(1000) Send("^f") Sleep(500) Send("View Profile{ENTER}") Sleep(500) $Co_ord1 = PixelSearch(20, 500, 450, 710, 0x335EA8) If Not @error Then MouseMove($Co_ord1[0], $Co_ord1[1], 0) MouseClick("Right") Sleep(500) Send("n") EndIf Sleep(15000) WinSetState("Myspace.com - Microsoft Internet Explorer", "", @SW_MAXIMIZE) Sleep(800) $Co_ord1 = PixelSearch(20, 500, 450, 700, 0x955127) If Not @error Then MouseMove($Co_ord1[0], $Co_ord1[1], 0) MouseClick("Left") EndIf Sleep(7000) $Co_ord1 = PixelSearch(120, 240, 380, 520, 0xE3EBF3) If Not @error Then MouseMove($Co_ord1[0], $Co_ord1[1], 0) MouseClick("Left") EndIf Sleep(7000) WinClose("Myspace.com - Microsoft Internet Explorer") Sleep(200) $i = $i + 1 Until $i = 25 WinClose("Myspace.com - Microsoft Internet Explorer") Sleep(1000) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now