Jump to content

how to call 2 functions


Recommended Posts

so .here i am again wit another question :mellow: how do i call 2 functions?

is it

Call("func1+func2") ?

i gues it aint.. :/

or i can just write down like

Call("1")

Call("2")

"

_1()

Return"

i ave the return thingy after so tahts why im asking

Edited by TomaSzz
Link to comment
Share on other sites

so .here i am again wit another question :mellow: how do i call 2 functions?

is it

Call("func1+func2") ?

i gues it aint.. :/

Once again, you don't use "Call". If you would like to have one function call two functions, you can do the following:

Func Function1()
  MsgBox(0, "", "Hello")
Endfunc

Func Function2()
  MsgBox(0, "", "How are you?")
Endfunc

Func Function3()
  Function1()
  Function2()
Endfunc

Function3 will call Function1 and then Function2. You cannot execute 2 functions at a simultaneous time: Computers handle orders one step at a time.

Edited by Affe

[center][/center]

Link to comment
Share on other sites

What do you mean by the "+" operator? Do want the sum of the return values from the two functions?

$iAnswer = _One(3) + _Two(1)
ConsoleWrite("$iAnswer = " & $iAnswer & @LF)

Func _One($iIn)
    Return $iIn - 2
EndFunc

Func _Two($iIn)
    Return $iIn + 1
EndFunc

:mellow:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

meh its ok.. and no PsaltyDS :mellow:

btw how do i make slider read a bar and if the bar moved lower or higher then press mouse on the place where it moved.. ?

i read help file but that didnt hit me at all

Link to comment
Share on other sites

i did like this but dont work at all

$bar = PixelSearch(65, 25, 245, 31, 0xA30B00, 3)
    If Not @error Then
                $slider1 = 0
                $slider1 = GUICtrlRead($bar)
                do
                MouseClick( positions here )
                $slider1 = $slider + 1
                sleep(100)
                until $bar = $slider1
Link to comment
Share on other sites

1) I don't know what you mean by "slider", but your above code is all wrong.

2) Please, PLEASE learn to use the "edit" function on this site. You have been double posting all over the place.

[center][/center]

Link to comment
Share on other sites

ok ..what i tryed to do by that code was..

scan a red bar with few pixel shades

where red color ends send("5") or mouseclick...

and keep scanning again :P man its so hard to explain for me :mellow: im lithuanian...

Link to comment
Share on other sites

  • Moderators

TomaSzz,

Calm down. You are among friends here, but you are becoming your own worst enemy. :party:

Every day you come here firing off questions with very little code to work on and often very little explanation as to what you are trying to do. We are not mind-readers nor magicians - we can only help if you try to help us. At the moment all you are doing is annoying the very people who could help you. :P

Remember what I said to you earlier? You need to sit down and work out what you wan to do BEFORE you start codiing - that way you have a fighting chance to get some reasonable structure in your script. At the moment you give the impression that you are just randomly picking subjects on which to post.

You are trying to run before you can walk. I strongly suggest that you rein in your ambitions and start coding simpler scripts until you have a better understanding of AutoIt - and coding in general. The basic questions you have been asking today (how to return from functions - can you run 2 functions simultaneously) show how little you understand at the moment. There is nothing wrong with that - we all started there :party: - but you must know your own limits and extend them as your experience grows. Otherwise you end up with some scrappy code you do not understand and you will have to ask for help again and again - which will be frustrating for both you and us.

So, do not get discouraged - we are here to help :mellow: - but do try and increase your current knowledge of AutoIt and coding by trying to code simpler projects. Ambition is a good thing, but so is realism. :party:

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

 

Link to comment
Share on other sites

:P i just want to make a slider where u can choose from 1-100 in steps of 10

and pixel search red bar of 300,20 dimensions and send some keyboard button when that red bar is gone at 10-20-30-40-50-60-70-80-90 steps.. :mellow: and i dont have a code at all only that there on top that i tryed... but its totaly wrong as posted below it

EDIT: im going over all slider help files but still i cant figure anythig out... i looked over forum.. forum has nothing about this at all

for example:

lets say the Warning bar near ur nick is the red bar(filled) and grey(empty as it is now)

if slider is moved on 10 then program will wait for the warning (red) color to come down to 10(reading pixel in rectangle ofcourse,or maybe not..i dont know if pixel even has to be in this) or lower and the program will send mouse click with MouseGetPos or just send some button of keyboard like "g" or any other...

Edited by TomaSzz
Link to comment
Share on other sites

:P i just want to make a slider where u can choose from 1-100 in steps of 10

and pixel search red bar of 300,20 dimensions and send some keyboard button when that red bar is gone at 10-20-30-40-50-60-70-80-90 steps.. :mellow: and i dont have a code at all only that there on top that i tryed... but its totaly wrong as posted below it

EDIT: im going over all slider help files but still i cant figure anythig out... i looked over forum.. forum has nothing about this at all

Going by what you have written, I believe you are trying to do the following:

1) Create a GUI with a slider that increments by steps of 10

-Question: Why do you need the slider? The slider is designed for user input. If you are trying to show progress, you can use ProgressOn() and ProgressSet() to display a popup window, or you can use GuiCtrlCreateProgress() to create one within a GUI. I could have mis-interpreted this, though.

2) Read from a given area that has a red search bar with PixelSearch()

-Is this something that is in a window on-screen?

Edited by Affe

[center][/center]

Link to comment
Share on other sites

Going by what you have written, I believe you are trying to do the following:

1) Create a GUI with a slider that increments by steps of 10

-Question: Why do you need the slider? The slider is designed for user input. If you are trying to show progress, you can use ProgressOn() and ProgressSet() to display a popup window, or you can use GuiCtrlCreateProgress() to create one within a GUI

2) Read from a given area that has a red search bar with PixelSearch()

-Is this something that is in a window on-screen?

yep thats something i want :P ..man..its harder than i tought to explain ideas :mellow:
Link to comment
Share on other sites

i know how to make slider :P read up on wat i wrote... :mellow:

You win, I give up.

EDIT:

TomaSzz Trying to make 2nd bot.. ^^

So you have successfuly made 1 bot, but you dont know how to pixelsearch or know what a function is.

You my friend stink of a wind up merchant.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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