Jump to content

A configurable program


jtr
 Share

Recommended Posts

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.0
; Language:    English
; Platform:    Win9x / NT
; Author:        JTR <jtrthestampede@bluebottle.com>
;
; Script Function:
;   Downloads anime while afk
;
; ----------------------------------------------------------------------------

; ----------------------------------------------------------------------------
; Script Start
; ----------------------------------------------------------------------------
Opt("WinTitleMatchMode", 2);match partial title

Global $setup = IniRead("animedownload.ini", "Setup", "Setup", "0")

If $setup = 0 Then
msgbox(0, "Setup", "During the setup, firefox will open and you will run this setup screen on top of firefox.")
$program = InputBox("Firefox 1.0 Location","Put the firefox exe's full location here","""C:\Program Files\Mozilla Firefox\firefox.exe""")
IniWrite ( "animedownload.ini", "Firefox", "loc", $program )
Run($program,"", @SW_MAXIMIZE)
msgbox(0, "Setup", "Before you click ok, move the mouse to Firefox's refresh button and press enter")


$refreshpos = MouseGetPos( )
IniWrite("animedownload.ini", "Position", "refreshx", $refreshpos[0])
IniWrite("animedownload.ini", "Position", "refreshy", $refreshpos[1])

msgbox(0, "Setup", "Before you click ok, move the mouse to Firefox's address bar and press the enter")

$addressbarpos = MouseGetPos( )
IniWrite("animedownload.ini", "Position", "addressbarx", $addressbarpos[0])
IniWrite("animedownload.ini", "Position", "addressbary", $addressbarpos[1])

msgbox(0, "Setup", "Before you click ok, click F3 in Firefox, move the mouse to the find field and press the enter")

$searchpos = MouseGetPos( )
IniWrite("animedownload.ini", "Position", "searchx", $searchpos[0])
IniWrite("animedownload.ini", "Position", "searchy", $searchpos[1])

msgbox(0, "Setup", "Before you click ok, move the mouse to the topleft part of the html page and press the enter")

$searchareaupleftpos = MouseGetPos( )
IniWrite("animedownload.ini", "Position", "searcharealeftx", $searchareaupleftpos[0])
IniWrite("animedownload.ini", "Position", "searchareatopy", $searchareaupleftpos[1])    

msgbox(0, "Setup", "Before you click ok, move the mouse to the bottomright part of the html page and press the enter")

$searchareadownrightpos = MouseGetPos( )
IniWrite("animedownload.ini", "Position", "searcharearightx", $searchareadownrightpos[0])
IniWrite("animedownload.ini", "Position", "searchareabottomy", $searchareadownrightpos[1])  

EndIf


Global $refreshx = IniRead("animedownload.ini", "Position", "refreshx", "112")
Global $refreshy = IniRead("animedownload.ini", "Position", "refreshy", "72")
Global $addressbarx = IniRead("animedownload.ini", "Position", "addressbarx", "500")
Global $addressbary = IniRead("animedownload.ini", "Position", "addressbary", "68")
Global $searchx = IniRead("animedownload.ini", "Position", "searchx", "112")
Global $searchy = IniRead("animedownload.ini", "Position", "searchy", "955")
Global $searcharealeft = IniRead("animedownload.ini", "Position", "searcharealeftx", "955")
Global $searchareaup = IniRead("animedownload.ini", "Position", "searchareatopy", "955")
Global $searcharearight = IniRead("animedownload.ini", "Position", "searcharearightx", "955")
Global $searchareadown = IniRead("animedownload.ini", "Position", "searchareabottomy", "955")


;ANIMEEEEEEEEEEEEEEEEEEEEEEEE;
Global $naruto = IniRead("animedownload.ini", "Anime", "Naruto", "http://a.scarywater.net/db/")
Global $onepiece = IniRead("animedownload.ini", "Anime", "One Piece", "http://kaizoku-fansubs.com/torrent/index.php")
Global $bleach = IniRead("animedownload.ini", "Anime", "Bleach", "http://a.scarywater.net/lunar/")


;endanime

IniWrite("animedownload.ini", "Setup", "Setup", "1")
Global $program = IniRead("animedownload.ini", "Firefox", "loc", '"C:\Program Files\Mozilla Firefox\firefox.exe"')
$answer = MsgBox(4,"Slim you cute, let me up in that boot","This script will camp animesuki.com looking for latest torrents lolol")

If $answer = 7 Then
    MsgBox(0, "AutoIt", "OK.  Bye!")
    Exit
EndIf
$torrent = InputBox("torrent","The torrent name should be input here, it should be something like 'Naruto 119' or 'One Piece 127'.","Put torrent name here")
If $torrent = 2 Then
    MsgBox(0, "No u", "OK.  Bye!")
    Exit
Endif
RunWait($program,"", @SW_MAXIMIZE)
WinWaitActive("Google")
MouseClick("left", $addressbarx, $addressbary, 1, 3)
; Now that the Notepad window is active type some special characters 

Select
Case StringInStr($torrent, "Naruto")
    Send($naruto &"{ENTER}")
    WinWaitActive("BitTorrent Files for [dattebayo] Anime")
Case StringInStr($torrent, "One Piece")
    Send($onepiece &"{ENTER}")
    WinWaitActive("Kaizoku-Fansubs - BitTorrent")
Case StringInStr($torrent, "Bleach")
    Send($bleach &"{ENTER}")
    WinWaitActive("BitTorrent Files for [Lunar] Anime")
Case $torrent <> "zzzz"
    Send("http://www.animesuki.com{ENTER}")
    WinWaitActive("BitTorrent @ AnimeSuki.com")
    

EndSelect
Sleep(3000)
while 1
Sleep(500)
TrayTip("Searching...", "Searching for " & $torrent & "...", 5, 16)
MouseClick("left", $refreshx, $refreshy, 1, 3)
sleep(6000)
Send("{F3}")
MouseClick("left", $searchx, $searchy, 3, 3)
Send($torrent)
$coord = PixelSearch($searcharealeft, $searchareaup, $searcharearight, $searchareadown, 0x38D878, 2 , 1)
 If Not @error Then    ;If no error then
      If UBound($coord) = 1 Then ;If bobber was not found     
ContinueLoop
      Else   
 MouseMove($coord[0]+4, $coord[1]+4) ;Move mouse to pixel found
MouseClick("left")
sleep(5000)
Send("{TAB}")
sleep(200)
Send("{TAB}")
sleep(200)
Send("{TAB}")
sleep(200)
send("{Space}")
sleep(1000)
    MsgBox(0, "Alrighty","" & $torrent & " should be downloading in Azureus now!")
ExitLoop
 
EndIf

EndIf

Wend

animedownload.ini

[firefox]
loc="C:\Program Files\Mozilla Firefox\firefox.exe"
[Setup]
setup=1
[Position]
refreshx=165
refreshy=62
addressbarx=426
addressbary=75
searchx=103
searchy=941
searcharealeftx=0
searchareatopy=145
searcharearightx=1276
searchareabottomy=911
[anime]
naruto=http://a.scarywater.net/db/
one piece=http://kaizoku-fansubs.com/torrent/index.php
bleach=http://a.scarywater.net/lunar/

What I want to do is replace the

Select
Case StringInStr($torrent, "Naruto")
    Send($naruto &"{ENTER}")
    WinWaitActive("BitTorrent Files for [dattebayo] Anime")
Case StringInStr($torrent, "One Piece")
    Send($onepiece &"{ENTER}")
    WinWaitActive("Kaizoku-Fansubs - BitTorrent")
Case StringInStr($torrent, "Bleach")
    Send($bleach &"{ENTER}")
    WinWaitActive("BitTorrent Files for [Lunar] Anime")
Case $torrent <> "zzzz"
    Send("http://www.animesuki.com{ENTER}")
    WinWaitActive("BitTorrent @ AnimeSuki.com")
EndSelect

part of the script with something that will seperate the strings in the ini after the [Anime] section and people can add their own anime they want to watch(into the ini) and location, and have it go there. I want to still be able to use the same variables if at all possible. If you guys are even 1/2 as awesome as I think you are, you will get this figured out in no time. Please help :lmao:o:):):):):whistle:

Edited by jtr
Link to comment
Share on other sites

This is directly from one of my CLOSED SOURCE projects, so your lucky... You might have to filter out the junk to figure out how it's done:

$Main = GUICreate('Bounce /export', 300, 700, -1, -1, 0x00280000, 0x00000080)
    Global Const $Number = IniRead('levels.ini', '_GLOBAL_', 'LEVEL_NUMBER', 0)
    If $Number = 0 Then
        MsgBox(0, '', 'No levels found')
        Exit
    EndIf
    Dim $Levels[$Number + 1][7][3]
    For $Count = 1 To $Number
        $Levels[$Count][0][0] = IniRead('levels.ini', '_GLOBAL_', 'Level_' & String($Count), '')
        $Levels[$Count][0][1] = GUICtrlCreateCheckbox(String($Count) & ' - ' & $Levels[$Count][0][0], 5, ( ($Count - 1) * 30) + 5, 260, 25)
    Next
    MsgBox(0, 'Bounce /export', 'After choosing, close window to finish exporting')
    GUISetState()
    Do
        $msg = GUIGetMsg()
        Sleep(1)
    Until $msg = $GUI_EVENT_CLOSE
    GUISetState(@SW_HIDE)
    Dim $Line, $Progress = 0
    $Levels[0][0][0] = $Number
    For $Count = 1 To $Number
        $Temp = GUICtrlRead($Levels[$Count][0][1])
        If $Temp = 1 Then
            $Levels[$Count][0][2] = 1
            For $CountA = 1 To 6
                $Levels[$Count][$CountA][1] = IniRead('levels.ini', 'Level_' & $Levels[$Count][0][0], 'Box_Strength_' & String($CountA), 1)
                $Levels[$Count][$CountA][0] = IniRead('levels.ini', 'Level_' & $Levels[$Count][0][0], 'Picture_Type_' & String($CountA), '')
            Next
        Else
            $Levels[$Count][0][2] = 0
            $Levels[0][0][0] = $Levels[0][0][0] - 1
        EndIf
    Next
    If Not $Levels[0][0][0] Then
        GUICreate('Bounce /export --- Progress', 300, 40, @DesktopWidth - 300, @DesktopHeight - 70, 0x18000000, 0x00000088, $Main)
        GUICtrlSetData(GUICtrlCreateProgress(0, 0, 295, 15), 100)
        Sleep(1500)
        Exit
    EndIf

Offering any help to anyone (to my capabilities of course)Want to say thanks? Click here! [quote name='Albert Einstein']Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.[/quote][quote name='Wolvereness' date='7:35PM Central, Jan 11, 2005']I'm NEVER wrong, I call it something else[/quote]

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...