Little Help Needed ;)

07/14/2017 19:41 owadziak#1
Im beginner at AutoIt, and i cant figure out how to make Pause in other functions

Example

My script is hunting,
can anyone teach me how to Stop hunting script if theres a item on the ground and make my script to First loot that item then start hunting again ?

(Sorry for my english)


(Im working on these functions right now)
Use Path to walk im writing right now

Can anyone tell me how to make it ?


My script is pretty Basic ( Still learning, )
Open Spoiler to see it



#Edit1 - Dont ask me why i add "Send("{1}") to my bot :)
Im going to tell u now, cause sometimes i meet agro monsters, and if theyr not selected by mouse click, my charracter wont attack them, thats why i added Send(1) to script ( On "1" Hotkey i got "Auto Attack" Skill ;)
07/15/2017 18:13 psydinger#2
I would suggest first creating a function:

Func LootItem()

(Your logic here to loot the item).

EndFunc


Then you just call the LootItem() function everytime an item is found - with an if statement.
07/15/2017 19:31 owadziak#3
I got that function written :) already rewrited script a bit :)

Anyway. I will use this thread as my main question thread :)
I got another question.
Is there any way to do.this easier ?
Example script
I mean, i.dont want to make 4 diffrent Gui Inputs and write x,y of a specific position for pixelsearch of top and bottom position.
Is there any easier way like make a
Pixelsearch(&Pos1,&pos2,&examplecolor,1,1)
And type in Pos1 123,321
And in
Pos2 543,345 and this script will looks like that ?
Pixelsearch(123,321,543,345,&examplecolor,1,1) ?
07/17/2017 18:34 owadziak#4
#Question about checkboxes :))

Im going to add, a few Check boxes to my gui :)
But i cant figure out how to.add functions to.them :)

Is there any posybility to make like

If $CheckBox1 checked then
Pixelsearch bla bla bla
If $Checkbox1 is unchecked.then skip this script part ?
Can someone explain me how to make it works ? Cause i.were reading "help" but i didnt understand anything yet. Its.easier for me.to.get an example how to use some thing to learn it than.getting in to it my self.(Dont think im lazy )

Thanks for help :)
07/17/2017 20:13 EngelEatos#5
one input and split it

something like this:
Code:
$Path = GuiCtrlRead($Input) //123,321,543,345
$cords = StringSplit($Path, ",")

$example = PixelSearch($cords[1], $cords[2], $cords[3], $cords[4], $color,
 1, 1)
...
07/17/2017 20:33 psydinger#6
Quote:
Originally Posted by owadziak View Post
I got that function written :) already rewrited script a bit :)

Anyway. I will use this thread as my main question thread :)
I got another question.
Is there any way to do.this easier ?
Example script
I mean, i.dont want to make 4 diffrent Gui Inputs and write x,y of a specific position for pixelsearch of top and bottom position.
Is there any easier way like make a
Pixelsearch(&Pos1,&pos2,&examplecolor,1,1)
And type in Pos1 123,321
And in
Pos2 543,345 and this script will looks like that ?
Pixelsearch(123,321,543,345,&examplecolor,1,1) ?

You could just make use of arrays for your coordinates and loop through.

That makes it easier and cleaner.
07/17/2017 21:09 owadziak#7
The problem is that these.coords.will be changing everytime i change spot to hunt monsters. And when i compile script i need to make a way to put new.ones so i create gui with few "input" boxes to put correct color values, and coords to search for these pixels :)

Btw. Thanks Engel ill try this when i get back to home :)

So i can do it this way
and it will works ye ?

@Bump and reserved for future updates/Questions
Btw new question added about Checkbox above