Jump to content

Recommended Posts

Posted (edited)

OKAY, i know this is extremely simple and everyone can do this......

SO, i created a Func

and this func works when you hit the key "alt S" (AKA "!s")

and now when that func is open, i want the func to open another func....

HOW THE HECK DO I DO THAT?!

So i want to the func to open another func

what line of code do i type.... ? 

Thank u :)

Edited by Melba23
Removed the SHOUTING
  • Moderators
Posted

dannymcf2,

Welcome to the AutoIt forum.

But please pay attention to where you post - the "Dev Chat" section where you started this thread is not for general support questions.  I have moved it for you, but would ask you to be more careful in future.

And please do not SHOUT - we can read normal-weight text and lower-case characters perfectly well.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

  • Moderators
Posted

dannymcf2,

Of course:

#include <MsgBoxConstants.au3>

HotKeySet("!s", "_Func_1")
HotKeySet("{ESC}", "_Exit")

While 1
    Sleep(10)
WEnd



Func _Func_1()
    MsgBox($MB_SYSTEMMODAL, "Hi", "Inside Func 1")
    _Func_2() ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
EndFunc



Func _Func_2()
    MsgBox($MB_SYSTEMMODAL, "Hi", "Inside Func 2")
EndFunc



Func _Exit()
    Exit
EndFunc

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Posted (edited)

Okay thanks, 

So basically it's simple, to call a func you simply just type the func name ? lol i didn't think it would be that simple.

Edited by dannymcf2
Posted (edited)

Does this make sense and do you think it will work? 

HotKeySet ("s", "Find")
HotKeySet("{ESC}", "Terminate")
Global $interval


$interval = 3000

MsgBox (0, "Finder", "Bot started, PRESS S to Run and ESC to End.")

Func Terminate()
   Exit 1
EndFunc





Func Find()
      $pixel = PixelSearch(36, 65, 73, 77, 0x000000)
   If IsArray($pixel) = True Then
     MouseClick("left", $pixel[0], $pixel[1])
   new()
     EndIf

  EndFunc

  

Func New()
     $pixel = PixelSearch(36, 65, 73, 77, 0x000000)
   If IsArray($pixel) = True Then
     MouseClick("left", $pixel[0], $pixel[1])
  EndIf

  EndFunc

  

While 1
    Sleep(100)
WEnd

 

Edited by Melba23
Added code tags
Posted (edited)

What i want to do i this....

Find specific color Then Click And then wait 3 seconds (interval) then find another color then click again.

the way i though could do it is like this....

Func Find()            
      $pixel = PixelSearch(36, 65, 73, 77, 0x000000)
   If IsArray($pixel) = True Then
     MouseClick("left", $pixel[0], $pixel[1])
   sleep($interval)


new()
     EndIf
  EndFunc

----------------------------------------------


Func New()
     $pixel = PixelSearch(36, 65, 73, 77, 0x000000)
   If IsArray($pixel) = True Then
     MouseClick("left", $pixel[0], $pixel[1])
  EndIf
  EndFunc

But it doesn't seem to work ? haven't a clue why

Edited by Melba23
Added code tags
  • Moderators
Posted

dannymcf2,

Firstly, when you post code please use Code tags - see here how to do it.  Then you get a scrolling box and syntax colouring as you can see above now I have added the tags.

Secondly, Which app are you trying to automate? There are usually much more reliable methods that searching for colours and clicking.

M23

 

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Posted

Okay, I have it working now, and im just testing with internet explorer (i want the script to do this) - click edit, find on this page...

This is the working code....

I know there are other ways to get the script to find the "edit" tab by using the Imageseach method right? 

But sadly i don't think my brain's processing power is enough to accomplish that im afraidd :( 

So that's why im using the pixelSearch method.

HotKeySet ("s", "Find")
HotKeySet("{ESC}", "Terminate")
Global $interval

$interval = 3000

MsgBox (0, "Finder", "Bot started, PRESS S TO run.")

Func Terminate()
   Exit 1
EndFunc

Func Find()
      $pixel = PixelSearch(36, 65, 73, 77, 0x000000)
   If IsArray($pixel) = True Then
     MouseClick("left", $pixel[0], $pixel[1])
     sleep ($interval)
   new()
     EndIf
  EndFunc

While 1
    Sleep(100)
 WEnd

Func New()
     $pixel = PixelSearch(69, 180, 179, 199, 0x000000)
   If IsArray($pixel) = True Then
     MouseClick("left", $pixel[0], $pixel[1])
  EndIf
  EndFunc

While 1
    Sleep(100)
WEnd

 

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
  • Recently Browsing   0 members

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