|
You last visited: Today at 07:58
Advertisement
Little Help Needed ;)
Discussion on Little Help Needed ;) within the AutoIt forum part of the Coders Den category.
07/14/2017, 19:41
|
#1
|
elite*gold: 0
Join Date: Jul 2007
Posts: 219
Received Thanks: 43
|
Little Help Needed ;)
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
; ================
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("PixelGame", 195, 76, 192, 124)
Global $Start = GUICtrlCreateButton("Start", 8, 40, 75, 25)
Global $Exit = GUICtrlCreateButton("Exit", 96, 40, 75, 25)
Global $Input1 = GUICtrlCreateInput("MonsterColor", 8, 8, 161, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
; Gui
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Exit
MsgBox(0,"Good Bye","Exiting Bot")
Exit
Case $Start
StartMainTask()
EndSwitch
WEnd
; Gui End ===========================
; Skrypt ============================
Func StartMainTask()
While(1)
; Globalne zmienne
Global $LootColor = 0xF6F6F6
Global $MobColor = GuiCtrlRead($Input1)
Global $Attacking = False;
Global $NeedHealing = False;
; Hotkeye
HotKeySet("{F1}","StopBot") ; Zatrzymanie bota
WinActivate("PixelGame") ; Aktywne okno
Send("{Space}")
Sleep(10)
; Otwieranie skrzyni
OpenChest()
;Szukanie Dropa
StartLooting()
; Atakowanie Potwora
StartKilling()
; Leczenie
$HPBAR = PixelSearch(248,77,251,77,0x232323,1)
If Not(@Error) Then
NeedHealing()
Else
If @Error Then
EndIf
EndIf
WEnd
EndFunc
;Funkcje =============================
func StartLooting()
; Podnoszenie Dropa ===================
$Loot = PixelSearch(68,138,1261,571,$LootColor,1,1)
If not(@Error) Then
MouseClick("Left",$Loot[0],$Loot[1],1,1)
Sleep(500)
Else
If @error Then
EndIf
EndIf
EndFunc
Func StartKilling()
$Attack = PixelSearch(68,138,1261,571,$MobColor,1,1)
If not(@Error) Then
MouseClick("Left",$Attack[0],$Attack[1],1,1)
Send("{1}")
Sleep(100)
$Attacking = True
Sleep (10)
While($Attacking)
Send("1")
Sleep(1500)
$isAttacking = PixelSearch(532,122,534,122,0x424242,1,1)
If Not(@Error) Then
Else
If @error Then
$Attacking = False
EndIf
EndIf
WEnd
EndIf
EndFunc
Func StopBot()
MsgBox(0,"Ending","Bot has been Stopped")
Exit
EndFunc
Func NeedHealing()
; Healing your self using Self HealingSpell/Potion ===================
send("{0}")
Sleep(250)
EndFunc
Func OpenChest()
$ChestButton = PixelSearch(996,590,1164,645,0x2A4608,1)
if not(@Error) Then
MouseClick("Left",$ChestButton[0],$ChestButton[1],1,1)
Sleep(100)
Else
If @error Then
EndIf
EndIf
EndFunc
Func GoToArea()
EndFunc
Func GoToArea2()
EndFunc
#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
|
#2
|
elite*gold: 0
Join Date: Apr 2017
Posts: 84
Received Thanks: 12
|
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
|
#3
|
elite*gold: 0
Join Date: Jul 2007
Posts: 219
Received Thanks: 43
|
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
Global $Path1x = GuiCtrlRead($Input1)
Global $Path1y = GuiCtrlRead($Input2)
Global $Path2x = GuiCtrlRead($Input3)
Global $Path2y = GuiCtrlRead($Input4)
$example = PixelSearch($Path1x,$Path1y,$Path2x,Path2y,$Exampl eColor,1,1)
If not(@error) then
Else
If @error then
Exit
EndIf
EndIf
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
|
#4
|
elite*gold: 0
Join Date: Jul 2007
Posts: 219
Received Thanks: 43
|
#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
|
#5
|
elite*gold: 22
Join Date: May 2011
Posts: 516
Received Thanks: 178
|
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
|
#6
|
elite*gold: 0
Join Date: Apr 2017
Posts: 84
Received Thanks: 12
|
Quote:
Originally Posted by owadziak
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
Global $Path1x = GuiCtrlRead($Input1)
Global $Path1y = GuiCtrlRead($Input2)
Global $Path2x = GuiCtrlRead($Input3)
Global $Path2y = GuiCtrlRead($Input4)
$example = PixelSearch($Path1x,$Path1y,$Path2x,Path2y,$Exampl eColor,1,1)
If not(@error) then
Else
If @error then
Exit
EndIf
EndIf
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
|
#7
|
elite*gold: 0
Join Date: Jul 2007
Posts: 219
Received Thanks: 43
|
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
$Path = GuiCtrlRead($Input)
$Path2 = GuiCtrlRead($Input2)
$cords = StringSplit($Path, ",")
$cords2 = StringSplit($Path2,",")
$example = PixelSearch($cords[1], $cords[2], $cords2[1], $cords2[2] $color,
1, 1)
and it will works ye ?
@Bump and reserved for future updates/Questions
Btw new question added about Checkbox above
|
|
|
 |
Similar Threads
|
Little Gaikoz,Little Cancer & Little KazeAaze!?
10/19/2010 - Grand Chase - 6 Replies
where the heck could i get them!?
PLS GIMME HELP!! T_T
|
little help needed .. for tbot settings ( europe )
08/30/2007 - Silkroad Online - 4 Replies
hi ..
im a rogue .. and having two small problems ..
1- tbot ( cracked ) is not using poison ambue .. i tried it by putting em in skill's 2nd line and also in additional spell box .. not working .. bot stops working when it reads poison ambue line ..
2- bot keeps doing my crossbow extreme spell right after every 15 secs ( recharge time of this spell) while its added in assisting spells and it should go
after like 15mins .. =\
if any of you guys have any special settings for this...
|
Little Help Needed (crap with vista)
02/12/2007 - Conquer Online 2 - 11 Replies
I just installed vista a couple days ago and cant seem to get SV working properly. I tried running as admin and all that stuff but always get this error:
http://img510.imageshack.us/img510/3741/errorzv1. jpg
So can someone post an UNEDITED copy of agentking.exe and countrymakeinUS.dll for me, or if anyone has any tips or advice tell me please.
Thanks
|
Hmm A Little Help Needed
03/13/2006 - Conquer Online 2 - 5 Replies
Oh joy for me , hey ppl i mite as well introduce myself b4 i start getting flammed or what not since this is my first post ... u can all call me by Pyro , Code , Oz , Ollie ...w/e floats your boat .. im an old CO player from back in the beta days , i have made my return from being a reader of forums back to my first post in a long time , Anyway , down to what i started this topic for ... yes stupidly i am now stuck in bot jail , back when i used to play before i quit (long story for another...
|
All times are GMT +1. The time now is 07:59.
|
|