Sign in to follow this  
Followers 0
Dethredic

Reshearch Bot

36 posts in this topic

#1 ·  Posted (edited)

Hi

im trying to make a reshearch bot.

this is what i have so far:

#include <IE.au3> 
#include <GuiConstants.au3>

GuiCreate("Rreasherch Bot", 308, 124,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Label_1 = GuiCtrlCreateLabel("What do you want to research?", 80, 30, 150, 20)
$input = GuiCtrlCreateInput("*your reshearch topich here*", 20, 60, 270, 20)
$Label_3 = GuiCtrlCreateLabel("Joe", 110, 0, 90, 20)
$go = GuiCtrlCreateButton("GO", 90, 90, 130, 30)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $go 
        $o_IE = _IECreate ("www.google.ca")
        $info = GuiCtrLReaD($input)
        WinWaitActive("Google - Microsoft Internet Explorer")
        Sleep(300)
        Send($info)
        Sleep(100)
        Send("{enter}")
        Sleep(300)
    EndSelect
WEnd
Exit

i don t know how i am going to make it open a website it finds. any ideas?

im going to make it the search the site for $info then copy and paste some of the info into a text document.

it might sux but some of my friends would pay me for this thing.

p.s. how do i make it so you can press "enter" it does the same this as if you clicked "go"

thanks

Edited by Dethredic

"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

Share this post


Link to post
Share on other sites



thanks manadar


"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

Share this post


Link to post
Share on other sites

No problem, i still think it's better to go with the way you were thinking. But starting the search in wikipedia is still a good idea :) I can't help you, because i'm no good with IE.

Share this post


Link to post
Share on other sites

ya i need more than 1 source

any other ideas


"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

Share this post


Link to post
Share on other sites

kk


"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

Share this post


Link to post
Share on other sites

anyone know how i can make it open a link once im at the search results display


"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

Share this post


Link to post
Share on other sites

ok i think i can use the

_IELinkGetCollection function but i dont konw how...

help plz


"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

Share this post


Link to post
Share on other sites

ok i came up with this

While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $go 
        $oIE = _IECreate ($google)
        $info = GuiCtrLReaD($input)
        WinWaitActive("Google - Microsoft Internet Explorer")
        Sleep(300)
        Send($info)
        Sleep(100)
        Send("{enter}")
        Sleep(300)
$oLinks = _IELinkGetCollection ($oIE)
For $oLink In $oLinks
    MsgBox(0, "Link Info", $oLink.href)
Next
    
    EndSelect
WEnd
Exit

this gives me liek 20 links tho.

i want to open the first one do some stuff the close and open the second one nad so on


"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

Share this post


Link to post
Share on other sites

You might have to use _IELinkGetCollection, with _IELinkClickByName, (like use the results from _IELinkGetCollection to click on a link by its name) or, you could just use

$1stlink = _IELinkClickByIndex($IE,1)

;do some stoof

_IEQuit($IE, $1stlink)

and so on, and so fourth


What goes around comes around... Payback's a bitch.

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

i would suggest putting them in an array :lmao: could help you out there

#include <IE.au3>
#include <Array.au3>
$IE = _IECreate("http://www.google.com/")
_IELoadWait($IE)
$form = _IEFormGetObjByName($IE,"f")
$search = _IEFormElementGetObjByName($form,"q")
_IEFormElementSetValue($search,InputBox("What to search for","What would you like to search for today"))
_IEFormSubmit($form)
$links = _IELinkGetCollection($IE)
$NumLinks = @extended
$ArryaLinks = _ArrayCreate($NumLinks)
For $Link In $Links
     _ArrayAdd($ArryaLinks,$Link.href)
 Next
 _ArrayDisplay($ArryaLinks,"Updated Array")
Edited by thatsgreat2345

Share this post


Link to post
Share on other sites

ok, i used Kickassjoe's idea and i know get links and it goes to them, a couple problems:

-the first couple links are just google so i have to set the link number to about 20

-the first link is different everythime dempening on the amount of pay advertisements

- sometimes i get links for "simialr pages" ect that i dont want

- other small problems

p.s. useing a Gui how do i make it so that if i press "enter" it will act as if i clicked a button (without useing a hotkey)


"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

Share this post


Link to post
Share on other sites

I don't know how to make it click on the right link every time (unless there is a pattern of the links in every page that you go to from a search, then it might be possible)

and you could use _ispressed() instead of using a hotkey, but I think using a hotkey is simpler...

HotKeySet("{enter}", "whatever")

Func whatever()

HotKeySet("{enter}", "")

Send("{enter}")

$msg = $WhateverTheButtonYouWantPressedOnTheGUIIs

HotKeySet("{enter}", "whatever")

EndFunc

^not tested^ you might have to make $msg global.


What goes around comes around... Payback's a bitch.

Share this post


Link to post
Share on other sites

hmm

fo the links part, i can make it go to a site(just by sending the link), but it sometimes goes to a bad one ie "simialr pages"


"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

heres my script so far

#include <IE.au3> 
#include <GuiConstants.au3>
Dim $google = "www.google.ca"


GuiCreate("Rreasherch Bot", 308, 124,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Label_1 = GuiCtrlCreateLabel("What do you want to  research?", 80, 30, 170, 20)
$input = GuiCtrlCreateInput("*your  research topich here*", 20, 60, 270, 20)
$Label_3 = GuiCtrlCreateLabel("joe", 110, 0, 90, 20)
$go = GuiCtrlCreateButton("GO", 90, 90, 130, 30)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $go 
        $oIE = _IECreate ($google)
        $info = GuiCtrLReaD($input)
        Sleep(200)
        Send($info)
        Sleep(200)
        Send("{enter}")
        Sleep(200)
$oLinks = _IELinkGetCollection ($oIE)
$1link = _IELinkClickByIndex($oIE,20)
    EndSelect
WEnd
Exit

try searching "bobbert" and youll see wat i mean by bad links

Edited by Dethredic

"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Im not good with those techy stuff, I used to have something similr for yahoo search, and I just had the bot hit tab a bunch of times, the highlight everything, paste it into a .txt file, hit back, go to next link, ect.

as for your enter prob...

HotKeySet("{enter}","function")
#include <IE.au3> 
#include <GuiConstants.au3>

GuiCreate("Reasearch Bot", 308, 124,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Label_1 = GuiCtrlCreateLabel("What do you want to research?", 80, 30, 150, 20)
$input = GuiCtrlCreateInput("*your research topich here*", 20, 60, 270, 20)
$Label_3 = GuiCtrlCreateLabel("Joe", 110, 0, 90, 20)
$go = GuiCtrlCreateButton("GO", 90, 90, 130, 30)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $go 
        $o_IE = _IECreate ("www.google.ca")
        $info = GuiCtrLReaD($input)
        WinWaitActive("Google - Microsoft Internet Explorer")
        Sleep(300)
        Send($info)
        Sleep(100)
        Send("{enter}")
        Sleep(300)
    EndSelect
WEnd
Exit
Func function()
Send("{tab}")
Send("{enter}")
EndFunc

sorry bout the spelling corrections, they were buggin me...

Edited by MethodZero

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Share this post


Link to post
Share on other sites

thanks

the enter problem i dont really want to set a hotkey, otherwise they now cannot use the button,

Im not good with those techy stuff, I used to have something similr for yahoo search, and I just had the bot hit tab a bunch of times, the highlight everything, paste it into a .txt file, hit back, go to next link, ect.

thats exactly wat im trying to do


"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

Share this post


Link to post
Share on other sites

HotKeySet("{enter}", "whatever")

Func whatever()
HotKeySet("{enter}", "")
Send("{enter}")
If WinExists("However you go on to misspell research") Then
$msg = $WhateverTheButtonYouWantPressedOnTheGUIIs
Endif
HotKeySet("{enter}", "whatever")
EndFunc

and there you have it, the enter button works and presses the button if its there(after u fix your spelling error, and change $WhateverTheButtonYouWantPressedOnTheGUIIs) !

P.S.: do you ever look in the help file, or think before you post?


What goes around comes around... Payback's a bitch.

Share this post


Link to post
Share on other sites

yes i do look in the help file


"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

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