Sign in to follow this  
Followers 0
Joseph

can someone look over this adlibenable code?

6 posts in this topic

i made this so that it searchs for a pixel in a certain spot and if its there it clicks it (thats the first adlib), then when it opens new windows from that button there is another adlib supposed to check if there is ever a window with the title "myspace.com - mozilla firefox" and if there is then controlsend alt f4 to close the window, if both the adlibs were setup right it would work but only the first one works, could someone see if there are any obvious solutions

#include <guiconstants.au3>
#include <_adlibs.au3>
$GUI = GUICreate("Friend Storm Adder", 200,60,-1,-1,-1)
$Exit = GUICtrlCreateButton("Exit",0,0,30,20)
$Start = GUICtrlCreateButton("Start",30,0,170,20)
GUICtrlCreateLabel("Press 'Pause' to stop/resume after starting", 0,20,200,20)
guictrlcreatelabel("Press 'Esc' to exit out of program",0,40,200,20)
GUISetState(@SW_SHOW)
WinSetOnTop($GUI, "", 1)

AdlibEnable("_adlibs", 1000)

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc


While 1
    $msg = GUIGetMsg()
    Select
    Case $msg= $Exit
        GUIDelete()
        Exit
    Case $msg= $Start
        _AdlibEnable("_ad1")
        _AdlibEnable("_ad2")
    
    EndSelect
WEnd


Func _ad1()
$search1=PixelSearch(32,443,273,600,0xAC4400,0)
if IsArray($search1) then
MouseMove($search1[0],$search1[1])
MouseClick("left",$search1[0],$search1[1], 1, 10)
EndIf
EndFunc

Func _ad2()
    If WinExists("MySpace.com - Mozilla Firefox") Then
        WinActive("MySpace.com - Mozilla Firefox")
        controlSend("MySpace.com - Mozilla Firefox","","","^{F4}")
    EndIf
EndFunc

Share this post


Link to post
Share on other sites



Can you give a link to the _Adlibs.au3?


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Thanks.

I must say in passing that you've picked up a really awful udf there IMO.

Anyway, your script does call both functions _ad1 and _ad2 which you can tell by adding some debugging code to the functions.

Just add

ConsoleWrite("in _ad1" & @CR)

to the start of _ad1(), and similarly to _ad2()

The most likely problem is that there is no match for the window title "MySpace.com - Mozilla Firefox" found.

If I go to MySpace.com the title is "MySpace UK - Mozilla Firefox"


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Thanks.

I must say in passing that you've picked up a really awful udf there IMO.

:P

Share this post


Link to post
Share on other sites

joemac4130

_Timer_SetTimer()?

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